kakashi-kx/WAFMANCER

GitHub: kakashi-kx/WAFMANCER

一款研究级的 WAF 绕过框架,融合 AI 驱动 payload 合成、决策边界映射与信誉操纵技术,实现对主流 WAF 的智能化绕过测试。

Stars: 1 | Forks: 0

#

WAFMANCER v2.0

下一代 WAF 绕过研究框架

Response Oracle 技术 🟣 | Neural Exploit 合成 🧠 | Trust Corruptor 🔥

“不是工具,而是研究武器。”

作者 :: kakashi-kx

## 📖 目录 - [什么是 WAFMANCER?](#-what-is-wafmancer) - [为什么 WAFMANCER 与众不同](#-why-wafmancer-is-different) - [功能特性](#-features) - [模块](#-modules) - [安装说明](#-installation) - [快速开始](#-quick-start) - [用法示例](#-usage-examples) - [攻击链](#-attack-chain) - [已测试的 WAF](#-wafs-tested) - [配置](#-configuration) - [项目结构](#-project-structure) - [Bug Bounty 用法](#-bug-bounty-usage) - [截图](#-screenshots) - [研究与出版物](#-research--publications) - [贡献指南](#-contributing) - [免责声明](#-disclaimer) - [许可证](#-license) - [致谢](#-credits) ## 🧠 什么是 WAFMANCER? WAFMANCER 是一个**研究级的 WAF 绕过框架**,引入了以前从未在单一工具中实现过的三种全新攻击概念: 1. **Response Oracle 技术** — 通过系统化探测映射 WAF 的完整决策边界 2. **Neural Exploit 合成** — 由 AI 驱动的 payload 生成,可合成前所未见的攻击向量 3. **Trust Corruptor** — 利用 WAF 信誉评分,在建立信任后投递 payload 与仅仅向目标盲目投递 payload 的传统 Fuzzer 不同,WAFMANCER 能够**理解**它所攻击的 WAF,并据此调整其策略。 ## 🔥 为什么 WAFMANCER 与众不同 | 特性 | 传统工具 | WAFMANCER | |---------|------------------|-----------| | Payload 生成 | 预先构建的字典 | **AI 合成的新型 Payload** | | WAF 交互 | 盲目模糊测试 | **决策边界映射** | | 投递策略 | 单一请求 | **基于信任的多请求定时投递** | | WAF 感知 | 无 | **指纹识别 + 战术配置** | | 输出 | 成功/失败 | **完整战术情报 + PoC + 数据渗出** | | 信誉利用 | 无概念 | **信任衰减曲线映射** | | ML 规避 | 基础编码 | **多向量链接 + ML 盲点针对** | ## ⚡ 功能特性 ### 核心能力 - 🔮 **Response Oracle** — 使用 50 多个变异模板映射 WAF 决策边界 - 🧬 **智能变异引擎** — 针对 WAF 的专属 payload(Cloudflare、AWS、Akamai、ModSecurity、Sucuri) - 🎯 **WAF 指纹识别器** — 通过 header/cookie/响应分析进行被动检测 - 🧠 **Neural Exploit 合成** — AI 驱动的 payload 生成,包含 5 层混淆链 - 🔥 **Trust Corruptor** — 利用 WAF 信誉评分进行定时 payload 投递 - 💰 **Bug Bounty 模式** — 带有速率限制的自动化多目标扫描 - 📊 **研究数据库** — 基于 SQLite 的发现结果与完整历史记录 - 📄 **导出引擎** — 可直接发布的 Markdown/JSON 报告 - 🐍 **PoC 生成器** — 自动生成 Python exploit 脚本 - 🎨 **赛博朋克终端** — 独特的标志性主题与战术情报显示 ### 攻击技术 - HTTP 请求走私(CL.TE, TE.CL, TE.TE 变体) - Header 注入与篡改 - 路径遍历与 URL 混淆 - Unicode/HTML 实体/URL/Hex 编码绕过 - 协议级攻击(HTTP/2, Pipelining) - 方法篡改 - Content-Type 混淆 - 缓存欺骗与投毒 - ML 盲点利用 - 信誉评分操纵 ## 📦 模块 | 模块 | 命令 | 描述 | |--------|---------|-------------| | 🟣 Response Oracle | `wafmancer oracle` | 映射 WAF 决策边界 | | 🧠 Neural Exploit | `wafmancer neural` | AI 驱动的 payload 合成 | | 🔥 Trust Corruptor | `wafmancer corrupt` | 基于信任的投递 + 数据渗出 | | 💰 Bug Bounty | `wafmancer bounty` | 自动化多目标扫描 | | 📊 History | `wafmancer history` | 查看研究会话历史 | | 📈 Stats | `wafmancer stats` | 研究统计仪表板 | | 📄 Export | `wafmancer export` | 可发布的报告 | | ℹ️ Info | `wafmancer info` | 配置显示 | | 📋 Modules | `wafmancer modules` | 列出所有可用模块 | ## 🔧 安装说明 ### 前置条件 - Python 3.10+ - pip - git ### 设置 ``` # 克隆仓库 git clone https://github.com/CSAT-DEVELOPER/wafmancer.git cd wafmancer # 创建虚拟环境(推荐用于 Kali Linux) python3 -m venv venv source venv/bin/activate # 安装依赖 pip install 'httpx[http2]' rich pyyaml structlog click # 以开发模式安装 WAFMANCER pip install -e . ``` ### Kali Linux 注意事项 Kali 使用 PEP 668 外部管理环境。请始终使用虚拟环境: ``` sudo apt install python3-venv -y python3 -m venv venv source venv/bin/activate ``` ## 🚀 快速开始 ``` # 1. 运行基本扫描 python -m wafmancer oracle -t https://example.com --probes 15 # 2. 生成 AI 合成的 payload python -m wafmancer neural -p "" # 3. 通过信任操纵投递 payload python -m wafmancer corrupt -t https://example.com -p "" # 4. 查看您的研究历史 python -m wafmancer history # 5. 检查统计数据 python -m wafmancer stats # 6. 导出发现 python -m wafmancer export ``` ## 📝 用法示例 ### Oracle — 映射 WAF 决策边界 ``` # 基本扫描 python -m wafmancer oracle -t https://example.com --probes 15 # 针对 Cloudflare 的更多探测 python -m wafmancer oracle -t https://www.cloudflare.com --probes 30 # 保存报告 python -m wafmancer oracle -t https://example.com -o report.md ``` ### Neural — AI Payload 合成 ``` # XSS payload 合成 python -m wafmancer neural -p "" # 针对 Cloudflare 的 SQLi python -m wafmancer neural -p "' OR 1=1 --" --waf Cloudflare # 针对 AWS WAF 的 Path traversal python -m wafmancer neural -p "../../../etc/passwd" --waf "AWS WAF" # 使用 ModSecurity 配置文件的 Command injection python -m wafmancer neural -p "; cat /etc/shadow" --waf ModSecurity ``` ### Trust Corruptor — 基于信任的投递与数据渗出 ``` # 带数据提取的 Path traversal python -m wafmancer corrupt -t https://example.com -p "../../../etc/passwd" # 使用 Cloudflare 配置文件的 SQL injection 绕过 python -m wafmancer corrupt -t https://example.com -p "' OR 1=1 --" --waf Cloudflare # 跳过神经合成(使用原始 payload) python -m wafmancer corrupt -t https://example.com -p "../../../etc/passwd" --no-synthesize # 针对激进 WAF 的慢速模式 python -m wafmancer corrupt -t https://example.com -p "" --requests 10 ``` ### Bounty 模式 — 自动化多目标扫描 ``` # 创建目标列表 cat > targets.txt << 'EOF' https://api.example.com https://app.example.com https://admin.example.com EOF # 运行赏金扫描(符合赏金合规的速率限制) python -m wafmancer bounty -f targets.txt --probes 15 --concurrency 1 --delay 5 # 导出结果 python -m wafmancer export ``` ## 🔄 攻击链 ``` ┌─────────────────────────────────────────────────────────────────────┐ │ WAFMANCER ATTACK CHAIN │ └─────────────────────────────────────────────────────────────────────┘ STEP 1: ORACLE PROBES ├── Sends 50+ mutations at the target ├── Maps WAF decision boundary └── Output: "These payloads got blocked, these got through" STEP 2: FINGERPRINT ├── Identifies WAF vendor (Cloudflare, AWS, Akamai, etc.) └── Output: "Cloudflare detected — confidence 67%" STEP 3: NEURAL EXPLOIT SYNTHESIS ├── Takes BLOCKED payloads from Step 1 ├── Synthesizes novel payloads via 5-layer obfuscation chains ├── Targets WAF-specific ML blindspots └── Output: "Here are NEW payloads that bypass ML detection" STEP 4: TRUST CORRUPTOR ├── Takes BYPASSED payloads from Step 3 ├── Builds trust with benign browser-like requests ├── Maps trust decay curve ├── Injects payload at peak trust window └── Output: "DATA EXFILTRATED — 391,764 bytes" STEP 5: RESEARCH DATABASE ├── Saves all findings with full metadata ├── Generates PoC scripts └── Output: Publication-ready reports ``` ## 🛡️ 已测试的 WAF | WAF 供应商 | 检测 | 绕过率 | 难度 | |-----------|-----------|-------------|------------| | **Cloudflare** | ✅ 已指纹识别 | 37.5% | 中等 | | **AWS WAF** | ✅ 已指纹识别 | — | 低-中 | | **Akamai Kona** | ✅ 已指纹识别 | 0%(激进的流重置) | 困难 | | **Sucuri WAF** | ✅ 已指纹识别 | 30% | 中-高 | | **ModSecurity** | ✅ 已指纹识别 | 高 | 低 | | **Fortinet** | 支持 | — | — | | **Citrix NetScaler** | 支持 | — | — | | **Imperva/Incapsula** | 支持 | — | — | ## ⚙️ 配置 编辑 `config.yaml` 以自定义 WAFMANCER: ``` oracle: max_probes: 50 # Maximum probes per scan concurrency: 1 # 1 = bounty-compliant probe_delay: 0.6 # 600ms between probes bounty: concurrency: 1 # Never parallel delay_between_targets: 5 # 5 seconds between targets probe_delay: 0.6 # ~1.6 req/sec (safe for 2/sec limit) ``` 环境变量覆盖: ``` export WAFMANCER_ORACLE__MAX_PROBES=100 export WAFMANCER_LOGGING__LEVEL=DEBUG ``` ## 📁 项目结构 ``` wafmancer/ ├── wafmancer/ │ ├── __init__.py │ ├── __main__.py │ ├── cli.py # Rich CLI with cyberpunk theme │ ├── config.py # YAML configuration management │ ├── logging_config.py # Structured JSON logging │ ├── exceptions.py # Custom exception hierarchy │ ├── core/ │ │ ├── __init__.py │ │ ├── oracle.py # Response Oracle Engine │ │ ├── http_client.py # Async HTTP/2 client │ │ ├── diff_engine.py # Advanced response comparison │ │ ├── fingerprinter.py # WAF fingerprinting │ │ ├── mutation_engine.py # 50+ payload library │ │ ├── neural_exploit.py # AI payload synthesis │ │ ├── trust_corruptor.py # Trust manipulation + data exfiltration │ │ ├── bounty_mode.py # Automated multi-target scanning │ │ └── research_store.py # SQLite research database │ ├── utils/ │ │ └── helpers.py # Utility functions │ └── plugins/ │ ├── base.py # Abstract plugin interface │ └── fuzzer.py # Advanced fuzzer plugin ├── config.yaml # Default configuration ├── requirements.txt ├── pyproject.toml # Modern Python packaging ├── README.md └── research/ # Research findings └── findings_export.md ``` ## 💰 BUG BOUNTY 用法 ### 最佳实践 1. **务必先阅读项目规则** — 不同平台有不同的速率限制 2. **使用符合 Bounty 规范的设置** — `--concurrency 1 --delay 5` 3. **首先在您自己的基础设施上进行测试** — 在用于 Bounty 之前验证 WAFMANCER 是否正常工作 4. **记录所有内容** — WAFMANCER 会自动生成报告 5. **提交 PoC 脚本** — 自动生成的 Python 脚本可以证明影响 ### 速率限制合规性 | 平台 | 速率限制 | WAFMANCER 设置 | |----------|-----------|-------------------| | HackerOne | 2 请求/秒 | `concurrency: 1, probe_delay: 0.6` | | Bugcrowd | 不定 | 检查项目政策 | | Intigriti | 3 请求/秒 | `concurrency: 1, probe_delay: 0.4` | | YesWeHack | 2 请求/秒 | `concurrency: 1, probe_delay: 0.6` | ## 📸 截图 ## 📚 研究与出版物 ### 引入的新概念 1. **Response Oracle 技术** — 系统化的 WAF 决策边界映射 2. **Neural Exploit 合成** — 采用多向量链接的 AI 驱动 payload 生成 3. **Trust Corruptor** — WAF 信誉评分操纵,用于定时 payload 投递 ### 潜在的研究论文 - *“映射决策边界:一种系统化的 WAF 绕过方法”* - *“遗传算法 vs 机器学习:进化 Payload 以绕过 AI 驱动的 WAF”* - *“不要相信任何人:利用现代 Web 应用防火墙中的信誉评分”* ## ⚠️ 免责声明 **WAFMANCER 仅设计用于授权的安全研究。** - ✅ Bug Bounty 项目(获得许可) - ✅ 授权的渗透测试 - ✅ 您自己的基础设施 - ✅ 安全研究实验室 - ❌ 未经授权测试第三方系统 - ❌ 任何形式的非法活动 **作者对滥用本工具不承担任何责任。在测试任何系统之前,请务必获得适当的授权。** ## 📄 许可证 MIT License — 详见 [LICENSE](LICENSE)。
标签:AI赋能, Akamai, AppImage, AWS WAF, CISA项目, GitHub项目, HTTP请求变异, ModSecurity, Payload生成, PoC生成, Python, SQLi, WAF测试, WAF绕过, Web应用防火墙, XSS, 恶意代码分类, 数据展示, 无后门, 深度学习安全, 漏洞情报, 红队, 绕过Cloudflare, 网络安全, 自动化攻击, 运行时操纵, 隐私保护, 黑盒测试