1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <?php highlight_file(__FILE__);
$upload = 'upload/' . md5("2021" . $_SERVER['REMOTE_ADDR']); @mkdir($upload); file_put_contents($upload . '/index.php', ''); var_dump($upload);
if (isset($_POST['file']) && isset($_POST['file'])) { if (preg_match('#.+\.ph(p[3457]?|t|tml)$|/#is', $_POST['file'])) { die('file error'); } if (preg_match('#\w{2,}|[678]|<\?|/#', $_POST['content'])) { die('content error'); } file_put_contents($upload . '/' . $_POST['file'], $_POST['content']); }
if (isset($_GET['reset'])) { @rmdir($upload); } string(39) "upload/8cecb394a757c7e7a02f7ed43677c303"
|