Created
October 9, 2023 16:11
-
-
Save phith0n/b02f5777b443dad1a63a9467623c490e to your computer and use it in GitHub Desktop.
A small PHP challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('FLAG', 'flag{y0uW1n}'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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