他提示说put something in F12 for you include 'flag.php',即F12里面放了一些东西包括flag.php,那我们就ctrl+u看页面源代码
得到源码
I put something in F12 for you
include 'flag.php'; //文件包含flag.php
$flag='MRCTF{xxxxxxxxxxxxxxxxxxxxxxxxx}';
if(isset($_GET['gg'])&&isset($_GET['id'])) { //检验GET参数id和gg是否存在
$id=$_GET['id']; //接收外部传入的id的值
$gg=$_GET['gg']; //接收外部传入的gg的值
if (md5($id) === md5($gg) && $id !== $gg) { //===强类型比较 即id和gg的md5值必须一模一样,但是id和gg的值不能一样
echo 'You got the first step'; //你完成了第一步
if(isset($_POST['passwd'])) { //检验POST参数passwd是否存在
$passwd=$_POST['passwd']; //存在则接收外部POST传入的passwd值
if (!is_numeric($passwd)) //如果passwd的值不是数字型
{
if($passwd==1234567) //并且如果passwd等于1234567 注意==是弱类型比较
{
echo 'Good Job!';
highlight_file('flag.php'); //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
观察源码我们可以知道,首先需要满足传入的id和gg值不相等,但是他们的md5加密后的值一定得相等,并且是===强比较相等,可以用到科学技术法知识,0e代表0的次方,我们知道0的多少次方最后都是0,所以我们要找两个md5加密后都是0e开头的字符串,
常见md5加密后是0e开头的可以去这里这博客看
https://blog.csdn.net/qq_29566629/article/details/108736519
hackbar构造GET请求
发现还是返回you are not a real hacker 那这个方法应该是不行了
可以尝试第二个方法,数组绕过
id[]=QNKCDZO&gg[]=s878926199a 这样子id和gg的md5值都是null,就相等了
这样就可,回显了you got the first step
提示还有一步就get the flag
也就是最后一个if判断
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');
}
要求传入POST ,传入的passwd值不能被判断为数字类型,且弱比较后需等于1234567
那我们可以用数字加字母的形式绕过 ,比如1234567a 这不是数字类型,但是弱比较后只取1234567
就是可以被当做等于1234567
hackbar GET和POST一起传,拿到flag