刚刚做了bugku的题目,现在整理一下
写出解题思路,希望能够帮助到那些需要帮助的人
所有的wp都是以一题一篇的形式写出
主要是为了能够让读者更好的阅读以及查找,
希望你们不要责怪!!共勉!!!
flag在index里
80
http://120.24.86.145:8005/post/
解题思路:
首先打开这道题,页面只给你click me? no
点击进去显示test5
第一步,查看源代码,无果
第二步bp,无果
结合到题目,flag在index里,大胆尝试http://120.24.86.145:8005/post/index.php,可惜和之前一样
注意到了传值为http://120.24.86.145:8005/post/index.php?file=show.php
file这个变量应该是关键,可惜无果
参考到别的博主的wp:
file传值为:
php://filter/read=convert.base64-encode/resource=index.php
就会得到:
base64解密下就得到flag了
可能很多人到这里并不太理解,这里我做具体解释:
首先来解释下这段代码的意思:
即以base64加密的方式读取resource的内容
然后我们来看一下php://filter的限制
要求将传进来的参数进入include();在这题即是$file //这里就打乱了我的胡思乱想,哈哈哈,还以为所有题目都可以呢
这点要求在后来拿到的题目源码中也可确认:
<html>
<title>Bugku-ctf</title>
<html>
<title>Bugku-ctf</title>
<html>
<title>Bugku-ctf</title>
<?php
error_reporting(0);
if(!$_GET[file]){echo '<a href="./index.php?file=show.php">click me? no</a>';}
$file=$_GET['file'];
if(strstr($file,"../")||stristr($file, "tp")||stristr($file,"input")||stristr($file,"data")){
echo "Oh no!";
exit();
}
include($file);
//flag:flag{edulcni_elif_lacol_si_siht}
?>
</html>
这里我转载一个师傅写的关于php://filter的知识点:https://www.leavesongs.com/PENETRATION/php-filter-magic.html
![微信](https://yqfile.alicdn.com/img_c8685be5aaafcc81358be5b8b5b00255.jpeg)
![支付宝](https://yqfile.alicdn.com/img_05cc443ae6d0969b5396a34d10dca100.jpeg)