[极客大挑战 2019]Secret File

打开网站

image

在注释中发现PHP文件
image

点击SECRET按钮,并没有什么东西
image

image

抓包分析

发现了一个php 文件
image

访问该文件,获得源码并开始代码审计

image

<?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里
?>

使用php://filter伪协议获得flag.php源码

image

获得flag

image

posted @ 2021-12-13 20:04  oldliutou  阅读(27)  评论(0编辑  收藏  举报