
evilwaf is a penetration testing tool designed to detect and bypass common Web Application Firewalls (WAFs).
EvilWAF 是一款先进的透明 MITM 防火墙绕过代理和深度 WAF 漏洞扫描器,专为授权安全测试而设计。它在传输层运行——不会触碰来自你工具的载荷、Cookie 或请求头。适用于任何支持 --proxy 的工具(如 ffuz、sqlmap、nuclei 等)。
--proxy 的工具。工具端零配置。CF-Connecting-IP、CF-Ray、True-Client-IP),使用精心构造的值来测试 WAF 对请求头的信任并尝试绕过 IP 白名单。Layer 1 Network — 虚拟主机绕过、敏感路径探测、Host 请求头操纵Layer 2 RuleEngine — 基于载荷的规则缺口检测:SQLi、XSS、RCE、LFILayer 3 RateLimit — 突发和持续速率限制执行测试Layer 4 Evasion — 编码和规范化绕过,每个载荷提供 10 种编码变体Layer 5 Behavioural — 时序分析:tarpit、JS 挑战延迟、退避检测Layer 6 Header — HTTP 请求头注入和 IP 欺骗绕过Layer 7 TLS — TLS 版本探测、SNI 绕过、证书指纹识别Layer 8 MethodVerb — HTTP 方法绕过,包括 WebDAV 方法Layer 9 Session — Cookie 操纵、认证绕过、会话固定探测Layer 10 Misconfig — WAF 错误配置和信息泄漏检测_fast_scanner.c)— 高性能 Python C 扩展,用于分类、熵分析、时序异常检测和统计热路径。--no-tui 标志。--scan-only 单独运行 WAF 漏洞扫描器,而不启动代理。Cloudflare 被广泛认为是当今世界上最复杂的 Web 应用防火墙。它不仅仅是一组规则——而是一个多层防御系统,结合了多项同时工作的技术来保护 Web 应用。
在网络层面,Cloudflare 在全球数百个数据中心运行,这意味着每个请求都会经过能够同时洞察数百万网站流量模式的底层设施。这种全球可见性是其最强大的优势之一——它能在数秒内检测到世界任何地方出现的攻击模式,并在所有受保护的资产上部署缓解措施。
在检测层面,Cloudflare 同时从多个维度分析请求:TCP/IP 指纹、TLS 指纹、HTTP/2 帧结构、请求头顺序、请求时序、跨会话的行为模式以及载荷内容。这些信号中的任何单一信号都不足以阻止一个请求,但 Cloudflare 会将所有信号关联在一起,为每个请求构建风险评分。
机器学习组件是 Cloudflare 与传统 WAF 的根本区别所在。基于规则的 WAF 寻找已知的恶意模式,而 Cloudflare 的 ML 模型则在 PB 级的真实攻击流量上训练。它们学习合法浏览器流量在传输层的样貌——TCP 选项的确切顺序、TLS ClientHello 的精确结构、HTTP/2 SETTINGS 帧的排列——并标记任何偏离该基线的行为,即使载荷本身看起来是干净的。这就是为什么仅仅对载荷进行编码或轮换请求头不足以对抗 Cloudflare。绕过必须发生在传输层,而不是应用层。
大多数 WAF 绕过技术都针对规则引擎——混淆载荷、使用编码变体、将攻击字符串拆分到多个参数中。这些技术对基于签名的 WAF 有效,因为这类 WAF 只检查载荷内容。
Cloudflare 的防御在载荷被检查之前就已生效。来自 Python HTTP 库的请求,即使发送的是完全良性的载荷,也可能被挑战或阻止,因为其 TLS 指纹与任何已知浏览器都不匹配。这意味着发起请求的工具在内容被分析之前就被识别了。Cloudflare 称之为行为指纹识别,这也是标准渗透测试工具即使底层载荷正确却仍会失败的主要原因。
Cloudflare 的速率限制同样智能——它不仅仅是每 IP 每秒请求数的计数器。它会跨会话跟踪请求模式,关联共享同一 ASN 的 IP 之间的行为,并采用渐进式挑战而非硬性阻止,这使得通过自动化测试难以探测其阈值。
EvilWAF 的开发者将 Cloudflare 视为研究对象,而非攻击目标。研究方法系统化:观察 Cloudflare 如何响应不同的传输层身份,衡量哪些信号会触发挑战、阻止或静默放行,并基于实时数据构建其行为的统计模型。
这与阅读文档或研究 CVE 有本质区别。Cloudflare 的行为无法完全从外部来源理解,因为它持续变化——模型会被重新训练、阈值会被调整、新的信号会被加入。理解它的唯一可靠方式是通过实时的、受控的、经授权的实验,并对所收集的数据进行仔细分析。
这项研究的目标是产出工具和知识,帮助安全研究社区了解 2026 年在技术层面上 WAF 绕过的真实样貌——不是为了造成伤害,而是为了确保防御者理解他们所依赖技术的真实能力与局限。理解 Cloudflare 如何检测和阻止请求的安全研究员,能更好地测试其背后的应用是否真正受到保护。
EvilWAF 的扫描器架构——持久会话、统计置信度、多层分析、时序异常检测——之所以存在,是因为这类研究需要长时间的观察期和严谨的数据收集,而非快速扫描。真正的 WAF 研究需要时间,工具也应体现这一点。
重要提示:使用 EvilWAF 前请阅读
我不为非法使用场景提供支持,但我会在授权测试中帮助你达成目标。
EvilWAF 由 Matrix Leons 制作。
如果 EvilWAF 对你有用,请考虑支持其开发。你的贡献有助于这个项目持续维护和发展。
# EvilWAF generates a local CA to intercept HTTPS traffic. Trust it once.
# Run EvilWAF first — CA is auto-generated at startup
# Then find the cert:
ls /tmp/evilwaf_ca_*/evilwaf-ca.pem
# Linux — trust system-wide
sudo cp /tmp/evilwaf_ca_*/evilwaf-ca.pem /usr/local/share/ca-certificates/evilwaf-ca.crt
sudo update-ca-certificates
# macOS
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain \
/tmp/evilwaf_ca_*/evilwaf-ca.pem
# For tools like sqlmap, pass --ignore-proxy=False or equivalent for your tool.
# 1. Create virtual environment
python3 -m venv myenv
# 2. Activate virtual environment
source myenv/bin/activate
# 3. Clone and install
git clone https://github.com/matrixleons/evilwaf.git
cd evilwaf
pip3 install -r requirements.txt
# 4. Build C extension (optional, improves scanner performance)
python setup_fast_scanner.py build_ext --inplace
python3 evilwaf.py -h
docker build -t evilwaf .
docker run -it evilwaf -t https://example.com
# Basic — Standard Proxy Mode
python3 evilwaf.py -t https://target.com
# Auto-Hunt Origin IP Behind WAF
python3 evilwaf.py -t https://target.com --auto-hunt
# EvilWAF runs 10 scanners in parallel, ranks candidates by confidence, then asks:
# [?] Use 1.2.3.4 as origin IP for bypass? [y/n]:
# If confirmed, all traffic goes directly to the real server, bypassing WAF completely.
# Manual Origin IP (if already known)
python3 evilwaf.py -t https://target.com --server-ip 1.2.3.4
# With Tor IP Rotation
python3 evilwaf.py -t https://target.com --enable-tor
# Headless Mode (No TUI)
python3 evilwaf.py -t https://target.com --no-tui
# WAF Vulnerability Scanner — alongside proxy
python3 evilwaf.py -t https://target.com --scan-vulns
# WAF Vulnerability Scanner — standalone, no proxy
python3 evilwaf.py -t https://target.com --scan-only
# WAF Vulnerability Scanner — custom rate and output
python3 evilwaf.py -t https://target.com --scan-only --scan-rps 5.0 --scan-output ./results
# Upstream Proxy
python3 evilwaf.py -t https://target.com --upstream-proxy socks5://127.0.0.1:1080
python3 evilwaf.py -t https://target.com --upstream-proxy http://user:[email protected]:8080
python3 evilwaf.py -t https://target.com --proxy-file proxies.txt
# Custom Listen Address and Port
python3 evilwaf.py -t https://target.com --listen-host 0.0.0.0 --listen-port 9090
EvilWAF 运行后,通过代理将任何工具指向它:
# sqlmap
sqlmap -u "https://target.com/page?id=1" --proxy=http://127.0.0.1:8080 --ignore-proxy=False
# ffuf
ffuf -u https://target.com/FUZZ -x http://127.0.0.1:8080
# nuclei
nuclei -u https://target.com -proxy http://127.0.0.1:8080
# curl (for testing)
curl -x http://127.0.0.1:8080 https://target.com
export SHODAN_API_KEY="your_key"
export SECURITYTRAILS_API_KEY="your_key"
export VIRUSTOTAL_API_KEY="your_key"
export CENSYS_API_ID="your_id"
export CENSYS_API_SECRET="your_secret"
即使没有 API 密钥,EvilWAF 仍可使用免费来源运行(DNS 历史、SSL 证书、HTTP 请求头、favicon 哈希、子域枚举)。
欢迎贡献。EvilWAF 正在成长,有许多领域可以改进。
# Fork and clone
git clone https://github.com/matrixleons/evilwaf/fork
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
# Submit a pull request
根据 Apache License 2.0 许可。