码迷,mamicode.com
首页 > 其他好文 > 详细

/x00

时间:2017-05-28 19:34:02      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:target   接受   数字   die   source   ref   sina   isset   字符串   


view-source:

    if (isset ($_GET[‘nctf‘])) {
        if (@ereg ("^[1-9]+$", $_GET[‘nctf‘]) === FALSE)
            echo ‘必须输入数字才行‘;
        else if (strpos ($_GET[‘nctf‘], ‘#biubiubiu‘) !== FALSE)   
            die(‘Flag: ‘.$flag);
        else
            echo ‘骚年,继续努力吧啊~‘;
    }

这是源码
nctf这是php的接受值
(@ereg ("^[1-9]+$", $_GET[‘nctf‘]) === FALSE
规定此值内必须有数字
strpos ($_GET[‘nctf‘], ‘#biubiubiu‘
规定此值内含有#biubiubiu‘
看似矛盾
所以这里用%00进行字符串的截断
?nctf=1%00%23biubiubiu

得到flag

如:nctf[]=1.#biubiubiu

/x00

标签:target   接受   数字   die   source   ref   sina   isset   字符串   

原文地址:http://www.cnblogs.com/maodun/p/6916301.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!