当前位置:网站首页>[MRCTF2020]Ez_ bypass --BUUCTF

[MRCTF2020]Ez_ bypass --BUUCTF

2022-06-13 00:27:00 Golden silk

Open the connection

emmm, Careful observation shows that these are php Code , Copy, paste and organize to get

include 'flag.php';
$flag='MRCTF{xxxxxxxxxxxxxxxxxxxxxxxxx}';
if(isset($_GET['gg'])&&isset($_GET['id'])) {
    $id=$_GET['id'];
    $gg=$_GET['gg'];
    if (md5($id) === md5($gg) && $id !== $gg) {
        echo 'You got the first step';
        if(isset($_POST['passwd'])) {
            $passwd=$_POST['passwd'];
            if (!is_numeric($passwd))
            {
                 if($passwd==1234567)
                 {
                     echo 'Good Job!';
                     highlight_file('flag.php');
                     die('By Retr_0');
                 }
                 else
                 {
                     echo "can you think twice??";
                 }
            }
            else{
                echo 'You can not get it !';
            }
 
        }
        else{
            die('only one way to get the flag');
        }
}
    else {
        echo "You are not a real hacker!";
    }
}
else{
    die('Please input first');
}

Next audit php Code ,md5 The function has a drawback that when the parameter passed in is an array , Returns the false, So here we build payload,get The ginseng

?id[]=1&gg[]=2

Next, according to PHP characteristic , When comparing , It will be converted to the same type before comparison , such as

if('1562adsfa' > 111)

Will be converted into

if(1562 > 111)

Then compare

So we can post The ginseng , structure payload

passwd=1234567abc

use hackbar The ginseng  

  Get flag

原网站

版权声明
本文为[Golden silk]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206130018276746.html