BugKu-WEB-各种绕过哟

BugKu-WEB-各种绕过哟

Mel0ny Lv5

BugKu-WEB-各种绕过哟

题目

Question
Question

思路

先看了一眼f12,没什么大问题,开始代码审计

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?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.urldecode()
2.and
3.sha1()
首先可以确定的是有三个变量,分别是id,uname,passwd,传递方式分别是GET,GET,POST
直接来看最核心的地方:首先变量uname和passwd不能相等,但是是弱比较,然后是对变量uname和passwd的sha1值进行比较,再和变量id是否等于margin进行按位于进行比较
和md5似曾相识,查询资料可知2个数组的sha1值都是null,null===null返回true,接下来只要让id=margin就可以了

注:在本地运行的时候发现在php8的情况下会直接TypeError报错,在php7以下会返回null

Question

用hackbar传入数据

1
_GET:?uname[]=1&id=margin;  _POST:passwd[]=2

Question

Flag

1
flag{193cc93dbc220417980e3916c5831ca8}
  • 标题: BugKu-WEB-各种绕过哟
  • 作者: Mel0ny
  • 创建于 : 2025-09-03 21:25:11
  • 更新于 : 2025-09-03 23:01:54
  • 链接: https://mel0nyrame.github.io/2025/09/03/BugKu-WEB-各种绕过哟/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论
目录
BugKu-WEB-各种绕过哟