各种绕过----bugku 之 SHA1 碰撞

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/New_feature/article/details/83188321
<?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!'; 

} 
?>

注意点:

1. get方式提交uname 和 id 值 ,post方式提交passwd值

2. uname和passwd的哈希值相同

3. id == “margin”

解决

1 get和post提交,方式1:火狐的HackBar,方式:python程序 。。。

2 把uname和passwd定义成数组,数组的哈希值相同

3 url传入时,令id=margin

最后采用post和get两种方式同时提交,得到flag。。。
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/New_feature/article/details/83188321