Skip to content

Instantly share code, notes, and snippets.

@phith0n
Created October 9, 2023 16:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phith0n/b02f5777b443dad1a63a9467623c490e to your computer and use it in GitHub Desktop.
Save phith0n/b02f5777b443dad1a63a9467623c490e to your computer and use it in GitHub Desktop.
A small PHP challenge
<?php
define('FLAG', 'flag{y0uW1n}');
<?php
require_once __DIR__ . '/flag.php';
$password = trim($_REQUEST['password'] ?? '');
$name = trim($_REQUEST['name'] ?? 'viewsource');
function viewsource() {show_source(__FILE__);}
if (strcmp(hash('sha256', $password), 'ca572756809c324632167240d208681a03b4bd483036581a6190789165e1387a') === 0) {
function readflag() {
echo FLAG;
}
}
$name();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment