<?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!';
}
?>
页面提示
三个变量:id , uname , passed
要求是:
- id,uname是get方式
- passwd是post方式
- uname和passwd不能相同
- 但是sha1(uname)和sha1(passwd)要相同
- id要=='margin'
关于sha1漏洞,和md5差不多
so~