题目给了源码
<?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
第三个是用get传id等于margin
其中要求uname和passwd的sha1值是相等的,同时他们的数是不相等的我们通过构造成数组进行绕过
得到flag