源码审计题目,
I put something in F12 for you
<?php
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) {
//要通过这里的验证,需要找到两个MD5相等但内容却不一样的两个字符串,
//md5函数有个漏洞,就是当传入参数为数组时,MD5函数返回false
echo 'You got the first step';
if(isset($_POST['passwd'])) {
$passwd=$_POST['passwd'];
if (!is_numeric($passwd))
{
if($passwd==1234567)
//要通过这里的验证,需要passwd不是数字,因为这里用的是==
//所以可以在数字后面加一个字母绕过
{
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传参设置gg和id参数,还要设置passwd参数,
但是php的md5函数有一个漏洞就是当传入参数为数组时,MD5函数会返回false,
这里的passwd要用pose传,