Bugku CTF web38(Web)

0、打开网页,查看题目提示

根据提示,布尔盲注。

但测试后发现and被过滤,只能使用异或^

空格也被过滤

逗号被过滤,使用mid((password)from(1)for(1))代替mid((password),1,1)

等号被过滤,使用不等号<>

for被过滤,使用ascii取字符串第一个字符转换为ascii码

构造如下

username=admin'^(ascii(mid((password)from(1)))<>ascii('b'))#&password=123

sql语句中在运算时会将字符串转换为0,

注入后,sql语句变为

where username=‘admin'^(ascii(mid((password)from(1)))<>ascii('b'))#

当后面语句为真时,0^1=1,语句相当于

where username=1,因为username全为字符串,不可能等于1,所以会查找失败,显示username no exist

当后面语句为假时,0^0=0,语句相当于

where username=0,因为username都为字符串,比较会恒成立,所以会查找成功,显示password error

1、使用BurpSuite的intruder功能爆破

拼凑后password=4dcc88f8f1bc05e7c2ad1a60288481a2

2、MD5解码password后登录

和web36一样,md5解密后为bugkuctf

3、得到flag:flag{880229c98b2f17c00287e335090872c5}

猜你喜欢

转载自blog.csdn.net/ChaoYue_miku/article/details/115057139