Skip to content

Instantly share code, notes, and snippets.

@saru2017
Created June 13, 2019 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saru2017/853074ab9fa29e17ff3b8d2987d4c3ca to your computer and use it in GitHub Desktop.
Save saru2017/853074ab9fa29e17ff3b8d2987d4c3ca to your computer and use it in GitHub Desktop.
proto04.php
<?php
$line = trim(fgets(STDIN));
$filename = '/home/proto04/flag.txt';
class B {
function __destruct() {
global $filename;
$flag = file_get_contents($filename);
echo $flag;
}
}
$a = @unserialize($line);
throw new Exception('You should not rearch here.');
echo $a;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment