<?php
highlight_file('flag.php');
$_GET['id'] = urldecode($_GET['id']);
$flag = 'flag{xxxxxxxxxxxxxxxxxx}';
if (isset($_GET['uname']) and isset($_POST['passwd'])) {
if ($_GET['uname'] == $_POST['passwd'])
print 'passwd can not be uname.';
else if (sha1($_GET['uname']) === sha1($_POST['passwd'])&($_GET['id']=='margin'))
die('Flag: '.$flag);
else
print 'sorry!';
}
?>
稍微看看知道需要GET传入的uname和POST传入的passwd不能相同,但是sha1
函数加密后需要强比较相等
sha1()
加密函数和md5()
的绕过一样,可以用数组造成函数错误输出空来进行绕过
所以payload: