Su1ph3r/bypassburrito

GitHub: Su1ph3r/bypassburrito

一款基于大语言模型的 WAF 绕过 Payload 生成器,用于授权渗透测试场景下智能生成能够规避 Web 应用防火墙检测的攻击载荷。

Stars: 5 | Forks: 1

# BypassBurrito **绕过任何 WAF** - 一款由 LLM 驱动的 Web 应用防火墙绕过生成器,用于授权渗透测试。 [![Go Version](https://img.shields.io/badge/Go-1.23+-00ADD8?style=flat&logo=go)](https://go.dev) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) ## 概述 BypassBurrito 利用大语言模型(LLM)通过迭代变异策略智能生成 WAF 绕过 Payload。它分析 WAF 响应,理解拦截模式,并进化 Payload 以规避检测,同时保持攻击功能。 ``` ____ ____ _ _ | __ ) _ _ _ __ __ _ ___ ___ | __ ) _ _ _ __ _ __(_) |_ ___ | _ \| | | | '_ \ / _` / __/ __| | _ \| | | | '__| '__| | __/ _ \ | |_) | |_| | |_) | (_| \__ \__ \ | |_) | |_| | | | | | | || (_) | |____/ \__, | .__/ \__,_|___/___/ |____/ \__,_|_| |_| |_|\__\___/ |___/|_| ``` ## 功能特性 ### 多提供商 LLM 支持 - **Anthropic Claude** - 使用 Claude 3.5 Sonnet/Opus 进行复杂分析 - **OpenAI GPT** - 使用 GPT-4o 进行通用绕过生成 - **Groq** - 使用 Llama 3.1 70B 实现快速推理 - **Ollama** - 支持本地模型以保护隐私 - **LM Studio** - 本地模型集成 - **Ensemble Mode** - 结合多个模型实现基于共识的绕过 ### 智能 WAF 检测 - **基于签名的检测** - 支持 12+ 家 WAF 供应商(Cloudflare、ModSecurity、AWS WAF、Akamai、Imperva、F5、Sucuri 等) - **行为分析** - 时序模式、速率限制、响应指纹识别 - **OWASP CRS 检测** - 识别 ModSecurity 核心规则集配置 - **置信度评分** - WAF 识别的贝叶斯概率 ### 高级变异策略 - **编码** - URL、Unicode、HTML 实体、混合编码、超长 UTF-8 - **混淆** - 注释注入、大小写随机化、空格操纵 - **分片** - Payload 分割、分块编码、参数污染 - **多态** - 语义等效但结构不同的 Payload - **上下文感知** - HTTP 上下文感知变异(JSON、XML、表单数据) - **对抗性 ML** - 同形字、不可见字符、双向覆盖 - **SSTI** - 服务端模板注入变异(Jinja2、Twig、Freemarker) - **NoSQL** - MongoDB/CouchDB 注入变异及操作符混淆 ### 响应 Oracle 分析 - **时序分析** - 时序侧信道的统计 z-score 检测 - **差异分析** - 使用 Levenshtein 相似度评分进行 Body 比对 - **错误指纹识别** - 从错误信息中提取 WAF 类型、框架和数据库信息 - **Content-Length 异常** - 通过响应大小变化检测拦截行为 ### 协议层规避 - **HTTP/2 操纵** - 伪头部重排序、优先级操纵 - **WebSocket 攻击** - 基于升级的 Payload 交付、消息分片 - **分块编码** - 无效的分块大小、延迟、Trailer 头部技巧 ### JavaScript 验证码求解器 - **Headless Browser** - 自动化 JS 验证码求解(需要 go-rod) - **Cloudflare Bypass** - 针对 Cloudflare 的验证码处理 - **CAPTCHA 集成** - 支持 2captcha 和 AntiCaptcha API ### 多请求状态机 - **攻击序列** - YAML 定义的多步骤攻击链 - **变量提取** - 从响应中提取 Token、Cookie - **条件分支** - 基于响应分析的动态流程 ### 学习系统 - **模式持久化** - 存储成功的绕过方法以备后用 - **成功率跟踪** - 按有效性对每个 WAF 的变异进行排名 - **遗传进化** - 随时间进化绕过模式 - **团队共享** - 导入/导出已学习的模式 ### Payload 最小化 - **Delta 调试** - 将有效的绕过方法缩减为最小可行 Payload - **二分搜索缩减** - 高效查找关键字符 - **Token 简化** - 感知攻击类型的简化 - **关键部分识别** - 理解绕过生效的原因 ### WAF 规则推断 - **模式检测** - 识别 WAF 使用的正则表达式模式 - **关键词分析** - 发现被拦截的关键词和术语 - **编码检测** - 查找哪些编码被拦截 - **规避提示** - 获取绕过已检测规则的建议 ### 插件 SDK - **自定义变异** - 使用 Go 编写自己的变异插件 - **热加载** - 无需重新编译即可加载插件 - **优先级控制** - 控制变异顺序 - **特定 WAF 插件** - 针对特定 WAF 类型 ### Burp Suite Pro 集成 - **原生扩展** - 通过配套扩展实现完整的 Burp Suite Pro 集成 - **右键绕过** - 发送任何请求进行绕过测试 - **实时流** - 绕过尝试期间的 WebSocket 更新 - **问题报告** - 绕过结果作为 Burp Scanner 发现报告 ### 多种输出格式 - **JSON** - 机器可读结果 - **Markdown** - 人类可读报告 - **HTML** - 交互式 Web 报告 - **Burp XML** - 将发现导入 Burp - **Nuclei** - 从成功的绕过生成 Nuclei 模板 - **Curl** - 可复现的 curl 命令 ## 安装 ### 从源码安装 ``` # 克隆仓库 git clone https://github.com/su1ph3r/bypassburrito.git cd bypassburrito # 构建 go build -o burrito ./cmd/burrito/ # 或全局安装 go install ./cmd/burrito/ ``` ### 系统要求 - Go 1.23 或更高版本 - LLM API 密钥(Anthropic、OpenAI 或 Groq)或本地模型(Ollama/LM Studio) ## 快速开始 ### 1. 设置 API 密钥 ``` # 针对 Anthropic(推荐) export ANTHROPIC_API_KEY="your-key-here" # 或针对 OpenAI export OPENAI_API_KEY="your-key-here" # 或针对 Groq export GROQ_API_KEY="your-key-here" ``` ### 2. 检测 WAF ``` burrito detect -u "https://target.com" # 结合行为分析的深度分析 burrito detect -u "https://target.com" --deep ``` ### 3. 生成绕过 ``` # SQLi 绕过 burrito bypass -u "https://target.com/api" --param id --type sqli # 结合 proxy 的 XSS 绕过(用于 Burp) burrito bypass -u "https://target.com/search" --param q --type xss \ --proxy http://127.0.0.1:8080 # 多种攻击类型 burrito bypass -u "https://target.com/api" --param input --type sqli,xss # 自定义 payload burrito bypass -u "https://target.com/api" --param id \ --payload "' OR 1=1--" ``` ## 使用方法 ### Bypass 命令 ``` burrito bypass [flags] Target: -u, --url string Target URL (required) -m, --method string HTTP method (default: GET) -d, --data string Request body -H, --header strings Custom headers --param string Target parameter (required) --position string Parameter position: query, body, header, cookie Attack: -t, --type string Attack type: xss, sqli, cmdi, path_traversal, ssti, xxe -P, --payload string Custom payload --payload-file string File with payloads Engine: --max-iterations int Max iterations per payload (default: 15) --max-payloads int Max base payloads (default: 30) --detect-waf Auto-detect WAF (default: true) --use-learned Use learned patterns (default: true) --evolve Enable genetic evolution --minimize Minimize successful bypasses to shortest form --min-iterations int Max minimization iterations (default: 50) LLM: -p, --provider string LLM provider: anthropic, openai, ollama, groq --model string Model name --ensemble Use multi-model ensemble HTTP: --proxy string HTTP proxy URL --rate-limit float Requests/second (default: 5) --timeout duration Request timeout (default: 30s) Output: -o, --output string Output file -f, --format string Format: json, markdown, html, burp, nuclei --show-all Show all attempts --curl Generate curl commands ``` ### Detect 命令 ``` burrito detect [flags] -u, --url string Target URL (required) --deep Deep behavioral analysis --probe-payloads Use payloads to trigger WAF (default: true) --identify-ruleset Identify WAF ruleset (OWASP CRS) -o, --output string Output file -f, --format string Format: json, text, markdown ``` ### Infer 命令 分析 WAF 行为以推断正在使用的规则和模式。 ``` burrito infer [flags] Target: -u, --url string Target URL (required) -m, --method string HTTP method (default: GET) --param string Target parameter (required) --position string Parameter position: query, body, header Inference: --samples int Number of test samples (default: 50) --min-confidence float Minimum confidence threshold (default: 0.6) -t, --type string Attack types to test (default: sqli,xss,cmdi,path_traversal) --hints Include evasion hints (default: true) Output: -o, --output string Output file -f, --format string Format: json, yaml, text ``` ### Plugins 命令 管理变异插件。 ``` # 列出所有已加载的 plugin burrito plugins list # 显示 plugin 详情 burrito plugins info # 显示 plugin 目录 burrito plugins dir ``` ### 服务器模式(Burp 集成) ``` burrito serve [flags] --port int Server port (default: 8089) --host string Host to bind (default: localhost) --cors Enable CORS (default: true) --auth-token string Require auth token --max-concurrent int Max concurrent operations (default: 5) --websocket Enable WebSocket (default: true) ``` ## Burp Suite 扩展 BypassBurrito 包含一个原生 Burp Suite Pro 扩展,用于无缝集成。 ### 构建扩展 ``` cd burp-extension mvn clean package # 输出:target/bypassburrito-burp-1.0.0.jar ``` ### 安装 1. 启动 BypassBurrito 服务器:`burrito serve` 2. 在 Burp Suite 中:Extensions → Add → 选择 JAR 文件 3. 在 BypassBurrito 标签页中配置服务器 URL ### 功能 - 在任何请求上右键点击“Send to BypassBurrito” - 针对 SQLi、XSS、CMDi、Path Traversal 的快速绕过选项 - 从上下文菜单进行 WAF 检测 - 在专用标签页中实时显示结果 - 自动报告 Burp Scanner 问题 完整文档请参阅 [burp-extension/README.md](burp-extension/README.md)。 ## 支持的 WAF | WAF | 检测 | 规避配置 | |-----|-----------|-----------------| | Cloudflare | 是 | 是 | | ModSecurity | 是 | 是 | | AWS WAF | 是 | 是 | | Akamai | 是 | 是 | | Imperva/Incapsula | 是 | 是 | | F5 BIG-IP | 是 | 是 | | Sucuri | 是 | 是 | | Wordfence | 是 | 是 | | Fortinet | 是 | 是 | | Barracuda | 是 | 是 | | Citrix | 是 | 是 | | Palo Alto | 是 | 是 | | Radware | 是 | 是 | ## 支持的攻击类型 | 类型 | 描述 | |------|-------------| | `sqli` | SQL 注入(Union、Boolean Blind、Time Blind、Error-based) | | `xss` | 跨站脚本攻击(Reflected、Stored、DOM) | | `cmdi` | 命令注入(Unix、Windows) | | `path_traversal` | 路径/目录遍历 | | `ssti` | 服务端模板注入(Jinja2、Twig、Freemarker) | | `xxe` | XML 外部实体 | | `nosqli` | NoSQL 注入(MongoDB、CouchDB) | ## 配置 配置文件:`~/.bypassburrito.yaml` ``` provider: name: anthropic model: claude-sonnet-4-20250514 temperature: 0.3 http: timeout: 30s rate_limit: 5.0 proxy_url: "" protocol: prefer_http2: false enable_websocket: true chunked_evasion: true bypass: max_iterations: 15 max_payloads: 30 detect_waf: true use_learned: true strategies: enabled: - encoding - obfuscation - fragmentation - polymorphic - contextual - adversarial - ssti - nosql oracle: enabled: true timing_threshold: 0.3 content_length_threshold: 0.1 baseline_samples: 5 learning: enabled: true store_path: ~/.bypassburrito/learned-patterns.yaml auto_save: true solver: enabled: false headless: true captcha_service: "" # "2captcha" or "anticaptcha" max_attempts: 3 sequence: enabled: false path: ~/.bypassburrito/sequences output: format: text color: true show_all_attempts: false ``` ## 示例 ### 基础 SQLi 绕过 ``` burrito bypass -u "https://shop.example.com/product" \ --param id --type sqli ``` ### 使用 Burp Proxy 进行 XSS ``` burrito bypass -u "https://app.example.com/search" \ --param q --type xss \ --proxy http://127.0.0.1:8080 \ --show-all ``` ### 深度 WAF 分析 + 定向绕过 ``` # 首先,分析 WAF burrito detect -u "https://target.com" --deep -o waf-report.json # 然后使用特定的 WAF 类型绕过 burrito bypass -u "https://target.com/api" \ --param query --type sqli \ --waf-type cloudflare \ --use-learned --evolve \ -f markdown -o report.md ``` ### 生成 Nuclei 模板 ``` burrito bypass -u "https://target.com/vuln" \ --param input --type xss \ -f nuclei -o templates/ ``` ### Ensemble 模式(多个 LLM) ``` burrito bypass -u "https://critical-target.com/api" \ --param data --type sqli \ --ensemble \ --max-iterations 25 ``` ### 最小化成功的绕过 ``` # 查找绕过方法并简化为最短的有效形式 burrito bypass -u "https://target.com/api" \ --param id --type sqli \ --minimize ``` ### 推断 WAF 规则 ``` # 探查 WAF 拦截的模式 burrito infer -u "https://target.com/api" \ --param id --samples 100 \ -f json -o rules.json # 专注于特定的攻击类型 burrito infer -u "https://target.com/api" \ --param id --type sqli,xss ``` ## 架构 ``` ┌─────────────────────────────────────────────────────────────────────┐ │ BypassBurrito v0.3.1 │ ├─────────────────────────────────────────────────────────────────────┤ │ CLI (Cobra) │ │ ├── bypass - Generate WAF bypasses │ │ ├── detect - WAF detection & fingerprinting │ │ ├── infer - WAF rule inference │ │ ├── plugins - Plugin management │ │ └── serve - Server mode for Burp integration │ ├─────────────────────────────────────────────────────────────────────┤ │ Core Engine │ │ ├── LLM Providers - Anthropic, OpenAI, Groq, Ollama, LM Studio │ │ ├── WAF Detector - Signature + behavioral analysis │ │ ├── Rule Inference - Pattern and keyword detection │ │ ├── Mutation Engine - 8 strategy types (incl. SSTI, NoSQL) │ │ ├── Response Oracle - Timing, differential, fingerprint analysis │ │ ├── State Machine - Multi-request attack sequences │ │ ├── Challenge Solver - JS/CAPTCHA solving (Cloudflare, etc.) │ │ ├── Protocol Evasion - HTTP/2, WebSocket, chunked encoding │ │ ├── Minimizer - Delta debugging payload reduction │ │ ├── Plugin SDK - Custom mutation plugins │ │ ├── Learning System - Pattern storage, ranking, evolution │ │ └── HTTP Client - Rate limiting, retries, session management │ ├─────────────────────────────────────────────────────────────────────┤ │ Output │ │ └── Reporters - JSON, Markdown, HTML, Burp XML, Nuclei │ └─────────────────────────────────────────────────────────────────────┘ │ REST API / WebSocket │ ┌───────────────────────────────────┴───────────────────────────────┐ │ Burp Suite Pro Extension │ │ ├── Context Menu - Right-click integration │ │ ├── Custom Tab - Results, queue, configuration │ │ └── Issue Reporter - Scanner findings │ └────────────────────────────────────────────────────────────────────┘ ``` ## 跨工具集成 BypassBurrito 参与跨工具安全管道: ``` Nubicustos (cloud) ──containers──> Cepheus (container escape) Reticustos (network) ──endpoints──> Indago (API fuzzing) Indago (API fuzzing) ──WAF-blocked──> BypassBurrito (WAF bypass) Ariadne (attack paths) ──endpoints──> Indago (API fuzzing) All tools ──findings──> Vinculum (correlation) ──export──> Ariadne (attack paths) ``` ### 从 Indago 导入 从 Indago 导入被 WAF 拦截的发现结果进行定向绕过测试: ``` # Indago 导出 WAF 拦截的 endpoint indago scan --spec api.yaml --export-waf-blocked waf-blocked.json # BypassBurrito 自动检测攻击类型并生成绕过方法 burrito bypass --from-indago waf-blocked.json ``` ### 导出到 Vinculum 导出绕过结果到 Vinculum 进行关联: ``` burrito bypass -u "https://target.com/api" --param id --type sqli -f json -o results.json vinculum ingest results.json --format ariadne --output correlated.json ``` 另请参阅:[Vinculum](https://github.com/Su1ph3r/vinculum) | [Nubicustos](https://github.com/Su1ph3r/Nubicustos) | [Reticustos](https://github.com/Su1ph3r/Reticustos) | [Indago](https://github.com/Su1ph3r/indago) | [Cepheus](https://github.com/Su1ph3r/Cepheus) | [Ariadne](https://github.com/Su1ph3r/ariadne) ## 法律免责声明 BypassBurrito 专为**授权安全测试**而设计。 - 仅在您拥有明确测试权限的系统上使用 - 测试前获取书面授权 - 遵循负责任的披露实践 - 遵守所有适用法律和法规 作者不对本工具的滥用负责。 ## 贡献 欢迎贡献!请: 1. Fork 本仓库 2. 创建一个功能分支 3. 进行您的更改 4. 提交 Pull Request ## 许可证 MIT 许可证 - 详见 [LICENSE](LICENSE)。 ## 致谢 - 灵感来源于各种 WAF 绕过研究和工具 - 使用 [Cobra](https://github.com/spf13/cobra) 和 [Viper](https://github.com/spf13/viper) 构建 - Burp 扩展使用 [Montoya API](https://portswigger.net/burp/documentation/desktop/extensions/creating)
标签:AI风险缓解, AppImage, Beacon Object File, C2, CISA项目, Cloudflare, DLL 劫持, DNS 反向解析, Go语言, IP 地址批量处理, Maven, MITRE ATT&CK, ModSecurity, Payload生成, WAF绕过, Web应用防火墙, 人工智能安全, 合规性, 大语言模型, 安全测试, 攻击性安全, 攻击混淆, 日志审计, 漏洞验证, 程序破解, 绕过工具, 编码技术, 网络安全, 自动化攻击, 隐私保护