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
if (md5(
i
d
)
=
=
=
m
d
5
(
id) === md5(
id)===md5(gg) && $id !== $gg)
可以用结果等于0exxxxxx的字符串,也可以使用数组
a[]=1&b[]=2;php语法规定md5只不能加密数组,加密数组就会返回空值,空值就与空值相等了
if (!is_numeric(KaTeX parse error: Expected '}', got 'EOF' at end of input: passwd)) { if(passwd==1234567)
进入第二个判断。is_numeric()函数用1234567a绕。1234567a是字符串,但是弱比较的时候,1在前,php会将其整体转成数字,就可以通过比较了。