提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
题目
BUUCTF的[MRCTF2020]Ez_bypass 1
一、做题步骤
1.查看源代码
代码如下:
I put something in F12 for you
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');
}
}Please input first
2.审计代码
1.使用数组绕过
id[]=1&gg[]=2
$id=$_GET['id'];
$gg=$_GET['gg'];
if (md5($id) === md5($gg) && $id !== $gg)
2.上传passwd
passwd==1234567a
$passwd=$_POST['passwd'];
if($passwd==1234567)
获取flag
flag{c75c9496-4909-4483-8bc0-c1f88fc852cd}