bess1lie/apihunter

GitHub: bess1lie/apihunter

一款基于异步架构的专业 REST API 安全测试 CLI 工具,自动化完成 OpenAPI 规范发现、漏洞启发式扫描与认证审计并生成多格式报告。

Stars: 0 | Forks: 0

# apihunter [![PyPI 版本](https://img.shields.io/pypi/v/apihunter.svg)](https://pypi.org/project/apihunter/) [![许可证: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python 版本](https://img.shields.io/pypi/pyversions/apihunter.svg)](https://pypi.org/project/apihunter/) [![构建状态](https://static.pigsec.cn/wp-content/uploads/repos/cas/39/39faa54be350a1dab8afd3b2fb8c1c83e4d9cff84abfef2374d19a18053687c4.svg)](https://github.com/bess1lie/apihunter/actions)

apihunter banner

自动化 REST API 安全测试 CLI —— OpenAPI 发现、认证分析及安全启发式检测。

报告 Bug参与贡献版本发布

## 🚀 概述 **apihunter** 是一款专为 Bug 猎人和安全工程师构建的高性能、模块化安全工具。它自动化了 API 侦察中最繁琐的部分:查找规范文件、映射 endpoint 结构,以及识别诸如弱认证或信息泄露等低垂的果实。 基于 `asyncio` 和 `httpx` 构建,旨在随着您的目标规模而扩展。 ## ✨ 核心特性 | 特性 | 描述 | | :--- | :--- | | 🔍 **智能发现** | 自动查找 OpenAPI、Swagger 和 GraphQL 规范。 | | 🛡️ **启发式扫描** | 检测注入、IDOR、CORS 配置错误和信息泄露。 | | 🔐 **认证审计** | 分析认证方案及绕过的可能性。 | | 📊 **专业报告** | 输出 HTML、Markdown 和 SARIF 格式,以便集成到 CI/CD 中。 | | ⚡ **极速高效** | 完全异步的引擎,实现大规模并发。 | ## 🛠 快速入门 ### 安装 ``` pip install apihunter ``` ### 基本工作流 1. **发现** endpoint 和规范: ``` apihunter discover https://api.example.com ``` ![发现](https://static.pigsec.cn/wp-content/uploads/repos/cas/b8/b8ab76b1f96029249c127f58b0fde5082529acfb9417829358c6b0d838fe2c33.svg) 2. **扫描**漏洞: ``` apihunter scan https://api.example.com ``` ![扫描](https://static.pigsec.cn/wp-content/uploads/repos/cas/70/706d9a5e9c8e6ccf364cf51bf2c54d8993f0b41924e832316988f8e3e4cdbe35.svg) 3. **生成**报告: ``` apihunter report --format html ``` ![报告](https://static.pigsec.cn/wp-content/uploads/repos/cas/fc/fc6e73495b4b5e265ef623a5c38e85ece41ec53a45bc8246d52582531fc45cf5.svg) ## 🏗 架构 apihunter 采用基于 provider 的编排引擎。 ``` graph TD A[CLI] --> B[Orchestrator] B --> C[Discovery Engine] B --> D[Scanner Engine] C --> C1[Path Provider] C --> C2[Other Providers] D --> D1[Auth Analyzer] D --> D2[Injection Analyzer] D --> D3[CORS Analyzer] B --> E[(SQLite DB)] D --> F[Reporting Engine] ``` - **发现引擎**:注入 provider 以探测目标面。 - **扫描引擎**:针对发现的 endpoint 执行专门的扫描器。 - **核心**:主要管理数据库、HTTP 客户端和作用域。 ## ⚙️ 配置 通过 `scope.yaml` 文件控制您的扫描。 ``` targets: - https://api.example.com exclude_extensions: - .png - .jpg - .css deny: - https://api.example.com/admin/* ``` 在指定作用域下运行: ``` apihunter scan https://api.example.com --scope-file scope.yaml ``` ## 🗑 路线图 - [ ] **高级发现**:集成 DNS 和子域名枚举。 - [ ] **GraphQL 深度扫描**:高级的基于查询的注入测试。 - [ ] **实时仪表盘**:用于监控活动扫描的实时 Web UI。 - [ ] **云集成**:自动化的 AWS/GCP/Azure 元数据探测。 ## 🔒 安全 如果您发现漏洞,**请勿公开提交 issue**。请通过 [SECURITY.md](SECURITY.md) 私下报告。 ## 📄 许可证 [MIT](LICENSE)
标签:API安全测试, Python, REST API, 主机安全, 无后门, 计算机取证, 运行时操纵, 逆向工具