dalisecurity/Fray

GitHub: dalisecurity/Fray

一款结构化的 WAF 安全测试工具包,集成 5500+ Payload、25 种 WAF 指纹检测和 AI 工作流支持,实现从检测到报告的一站式安全测试。

Stars: 3 | Forks: 0

Fray — Open-source WAF security testing toolkit

### ⚔️ *开源 WAF 安全测试工具包 — 5500+ Payload,25 种 WAF 检测,用于 AI 工作流的 MCP server* **开源进攻性安全工具包** • 5,500+ Payload • 25 种 WAF 指纹 • 零依赖 • 61 项测试 [![Total Payloads](https://img.shields.io/badge/Total_Payloads-5500+-brightgreen.svg?style=for-the-badge)](https://github.com/dalisecurity/fray) [![OWASP Coverage](https://img.shields.io/badge/OWASP_Coverage-100%25-success.svg?style=for-the-badge&logo=owasp)](https://github.com/dalisecurity/fray) [![WAF Detection](https://img.shields.io/badge/WAF_Vendors-25+-blue.svg?style=for-the-badge&logo=cloudflare)](https://github.com/dalisecurity/fray) [![Tests](https://img.shields.io/badge/Tests-61_Passing-success.svg?style=for-the-badge)](https://github.com/dalisecurity/fray/actions) [![PyPI](https://img.shields.io/pypi/v/fray.svg)](https://pypi.org/project/fray/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) ## ⚡ 为什么选择 Fray? 大多数 Payload 集合只是静态文本文件。**Fray 与众不同** —— 它是一个结构化的工具包,让你在几秒钟内**检测、测试和生成报告**: - 🤖 **兼容 AI** —— 结构化的 JSON Payload 适用于 Claude Code 和 ChatGPT - 🔍 **自动检测 WAF** —— 即时指纹识别 25 家供应商 - 📊 **一键生成报告** —— 包含漏洞分析的专业 HTML 输出 - 🎯 **4,025+ 实战验证的 Payload** —— XSS、SQLi、SSRF、SSTI、LLM 越狱等 - ⚡ **零配置** —— `pip install fray` 即可开始测试 ### 🔥 适用对象 - **Bug bounty 猎人** —— 来自真实披露和 120 个 CVE 的现成 Payload - **红队与渗透测试人员** —— WAF 检测 → Payload 选择 → 报告,一站式工具 - **安全研究人员** —— 用于绕过研究和分析的结构化 Payload - **蓝队** —— 使用 4,000+ 种真实攻击模式验证你的 WAF 配置 - **学生** —— 通过引导式 AI 工作流学习进攻性安全 ### 🛡️ WAF 供应商检测 — 支持 25 家供应商 Fray 使用 Header 分析、Cookie 检查、响应模式和错误签名来检测和指纹识别 **25 个主要 WAF 供应商**。 | # | WAF 供应商 | 检测方法 | 关键签名 | |---|-----------|-----------------|----------------| | 1 | **Cloudflare** | Headers, Cookies, Error Page | `cf-ray`, `__cfduid`, Ray ID pattern | | 2 | **Akamai** | Headers, Cookies, Bot Manager | `akamai-grn`, `ak_bmsc`, Reference # | | 3 | **AWS WAF** | Headers, Cookies, Response Body | `x-amzn-waf-action`, `awsalb`, CloudFront | | 4 | **Imperva (Incapsula)** | Headers, Cookies, Challenge | `x-iinfo`, `incap_ses`, Incident ID | | 5 | **F5 BIG-IP** | Headers, Cookies, Error Page | `x-wa-info`, `bigipserver`, Support ID | | 6 | **Fastly (Signal Sciences)** | Headers, Cookies, Server | `x-sigsci-requestid`, `x-served-by` | | 7 | **Microsoft Azure WAF** | Headers, Cookies, Front Door | `x-azure-fdid`, `x-azure-ref`, `arr_affinity` | | 8 | **Google Cloud Armor** | Headers, Server, reCAPTCHA | `x-cloud-trace-context`, `gfe`, Cloud Armor | | 9 | **Barracuda** | Headers, Cookies, Server | `x-barracuda-url`, `barra_counter_session` | | 10 | **Citrix NetScaler** | Headers, Cookies, Server | `citrix-transactionid`, `nsc_`, NetScaler | | 11 | **Radware** | Headers, Response Text | `x-protected-by`, AppWall | | 12 | **Palo Alto (Prisma Cloud)** | Headers, Response Text | `x-pan-`, `x-prisma` | | 13 | **Check Point** | Headers, Response Text | `x-checkpoint`, Check Point | | 14 | **Trustwave (ModSecurity)** | Headers, Server, Response | `x-mod-security`, ModSecurity | | 15 | **Qualys WAF** | Headers, Response Text | `x-qualys` | | 16 | **Penta Security (WAPPLES)** | Headers, Cookies | `x-wapples`, `wapples` | | 17 | **StackPath** | Headers, Server | `x-stackpath-shield`, StackPath | | 18 | **Sophos** | Headers, Response Text | `x-sophos`, UTM | | 19 | **Scutum** | Headers, Response Text | `x-scutum` | | 20 | **Rohde & Schwarz** | Headers, Response Text | `x-rs-` | | 21 | **Sucuri** | Headers, Cookies, Server | `x-sucuri-id`, `sucuri_cloudproxy_uuid` | | 22 | **Fortinet FortiWeb** | Headers, Cookies, Server | `x-fortiweb`, `fortiwafsid` | | 23 | **Wallarm** | Headers, Server | `x-wallarm-waf-check`, `nginx-wallarm` | | 24 | **Reblaze** | Headers, Cookies, Server | `x-reblaze-protection`, `rbzid` | | 25 | **Vercel** | Headers, Server | `x-vercel-id`, `x-vercel-cache` | ## ⚡ 快速开始 ``` # 从 PyPI 安装 pip install fray # 检测 WAF 厂商 fray detect https://example.com # 使用 XSS payloads 测试 fray test https://example.com -c xss --max 10 # 列出所有 payload 类别 fray payloads # 或 Clone 并直接使用 git clone https://github.com/dalisecurity/fray.git cd fray python3 waf_tester.py -i ``` ## 🤔 为什么选择 Fray? [PayloadsAllTheThings](https://github.com/swisskyrepo/PayloadsAllTheThings) 是一个很棒的 Payload 参考。Fray 解决了不同的问题 —— 它是一个**测试工具包**,而不是百科全书。 | | PayloadsAllTheThings | Fray | |---|---|---| | **格式** | Markdown 文档 | 结构化 JSON (`id`, `description`, `technique`, `source`) | | **WAF 检测** | ❌ | ✅ 25 家供应商指纹识别 | | **MCP server** | ❌ | ✅ 6 种用于 AI 助手的工具 | | **CLI 测试** | ❌ 仅供参考 | ✅ `fray test -c xss` | | **报告** | ❌ | ✅ 包含拦截率分析的 JSON/HTML | | **pip install** | ❌ | ✅ `pip install fray` | | **Payload 广度** | **更深入** | 较窄 —— 价值在于工具化 | ## 🧪 测试套件 — 61 项测试 每次推送时在 CI 中运行的真实测试 (Python 3.9–3.13): | 类别 | 测试 | |----------|-------| | WAF 检测逻辑 | 10 (`_analyze_signatures` 使用 4 个 WAF 供应商的模拟数据) | | MCP server | 13 (工具注册 + 执行) | | Payload 完整性 | 8 (无重复、无假数据、来源溯源) | | IoT RCE CVEs | 6 (CVE 元数据准确性) | | CLI 命令 | 8 | | 包 + 加载 + 报告 | 9 | | 数据质量 | 2 (无代码片段、无捏造结果) | ## 📄 示例报告 运行扫描后,Fray 会生成一个独立的 HTML 报告,你可以与团队分享或作为渗透测试交付物附上。 **报告内容:** - **执行摘要** —— 测试的 Payload 总数、被拦截与绕过的数量、安全评分 - **拦截率进度条** —— 一目了然的可视化效果指标 - **类别细分表** —— 每个类别 (XSS, SQLi, SSRF 等) 的拦截率及状态徽章 - **发现的漏洞** —— 按严重程度 (Critical → Low) 分组的绕过 Payload - **建议** —— WAF 特定的调优建议和 OWASP 修复步骤 - **详细结果** —— 完整的 Payload 逐条日志及状态码 ![Fray Sample Report](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/c688f8599c154132.png) **导出:** ``` fray report --sample # generate a demo report fray report -i results.json -o report.html # from real scan results ``` 输出是一个独立的 HTML 文件 —— 在任何浏览器中打开或打印为 PDF。 ## 📚 文档 - [快速入门指南](docs/quickstart.md) - [完整文档](README.md) - [Docker 使用](docs/docker.md) - [OWASP 覆盖范围](docs/owasp-complete-coverage.md) ## 🤖 MCP Server — AI 集成 Fray 包含一个 AI 助手可以直接调用的 MCP server: ``` pip install fray[mcp] fray mcp ``` **6 种 MCP 工具:** `list_payload_categories`, `get_payloads`, `search_payloads`, `get_waf_signatures`, `get_cve_details`, `suggest_payloads_for_waf` 配置 Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json`): ``` { "mcpServers": { "fray": { "command": "python", "args": ["-m", "fray.mcp_server"] } } } ``` ### CLI ``` fray detect https://example.com fray test https://example.com -c xss --max 10 fray payloads ``` ## 📊 完整的 OWASP 覆盖 **40 多个类别中的 4,025+ 个 Payload:** ### OWASP Top 10:2021 (Web) - 1,690+ Payloads - A01: Broken Access Control (150+) - A02: Cryptographic Failures (50+) - A03: Injection (500+ - XSS, SQLi, XXE, SSTI, Command Injection) - A04: Insecure Design (80+) - A05: Security Misconfiguration (100+) - A06: Vulnerable Components (450+ - WordPress CVEs) - A07: Authentication Failures (200+) - A08: Software/Data Integrity (70+) - A09: Logging/Monitoring (30+) - A10: SSRF (60+) ### OWASP Mobile Top 10:2024 - 575+ Payloads - M1-M10: 完整的移动安全覆盖 (Android & iOS) ### OWASP LLM Top 10 - 300+ Payloads - LLM01: Prompt Injection (100+) - LLM02-LLM10: AI/ML 安全测试 ### OWASP API Security Top 10 - 520+ Payloads - API1-API10: 完整的 API 安全覆盖 (REST, GraphQL, SOAP) ### WordPress Security - 450+ Payloads - REST API auth bypass & user enumeration (150+) - File upload bypass & web shell detection (200+) - XML-RPC amplification & brute force (100+) ### Additional Attack Vectors - 490+ Payloads - XSS, SQLi, SSRF, Path Traversal, LDAP, XPath, CRLF 等 详细细分请参阅 [docs/owasp-complete-coverage.md](docs/owasp-complete-coverage.md)。 ## 🔒 法律与合规使用 **重要提示**:仅对你拥有或明确获得测试许可的系统进行测试。完整免责声明请参阅 [LICENSE](LICENSE)。 ## 🤝 贡献 欢迎贡献!请参阅 [CONTRIBUTING.md](CONTRIBUTING.md) ## 📜 许可证 MIT License - 请参阅 [LICENSE](LICENSE) **⭐ 如果觉得有用,请给本仓库一个 Star!** 📚 **文档**: [docs/](docs/) | [PyPI](https://pypi.org/project/fray/) | [Blog](https://dalisec.io/research/blog-fray-launch.html)
标签:AI安全, C2日志可视化, Chat Copilot, ChatGPT, CISA项目, Claude, CVE检测, GitHub项目, Homebrew安装, LLM越狱, MCP服务器, Payload生成, Promptflow, Python, SSRF, SSTI, URL发现, WAF测试, Web安全, XSS攻击, XXE攻击, 反取证, 多模态安全, 安全工具包, 安全检测, 安全评估, 指纹识别, 无后门, 网络安全, 蓝队分析, 逆向工具, 隐私保护, 零依赖