yogsec/API-Pentesting-Tools

GitHub: yogsec/API-Pentesting-Tools

一份系统化分类的 API 渗透测试工具集合,覆盖从侦察到漏洞利用的完整测试流程。

Stars: 306 | Forks: 51

# API 渗透测试工具
![API 渗透测试工具](https://media2.giphy.com/media/v1.Y2lkPTc5MGI3NjExeHhzM3plejZjYmdxeXk5bmx1ZDY0aGM3dnUwMTBkNzA1dXd5cmM1MyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/137EaR4vAOCn1S/giphy.gif)
API 渗透测试工具是一个开源列表,旨在自动化和简化 API 的渗透测试过程。它帮助安全研究员和漏洞赏金猎人在 RESTful 和 GraphQL API 中识别常见漏洞。
WhatsApp Channel Telegram Channel LinkedIn WhatsApp Channel Lichess Email Telegram Channel
## API 渗透测试方法 API 渗透测试包含多种用于评估安全弱点的方法论: 1. **侦察 (Reconnaissance)** - 收集有关 API endpoint、技术和身份验证机制的信息。 2. **身份验证测试 (Authentication Testing)** - 检查薄弱或有缺陷的身份验证机制,包括 token 管理不当。 3. **授权测试 (Authorization Testing)** - 验证访问控制,以防止权限提升和未经授权的访问。 4. **输入验证测试 (Input Validation Testing)** - 识别注入漏洞,如 SQL 注入、NoSQL 注入和命令注入。 5. **速率限制与 DoS 测试 (Rate Limiting & DoS Testing)** - 评估 API 的速率限制以及潜在的拒绝服务 风险。 6. **安全标头与 CORS 测试 (Security Headers & CORS Testing)** - 检查 HTTP 安全标头和 CORS 配置是否存在配置错误。 7. **会话管理测试 (Session Management Testing)** - 分析会话 token 和 cookie 是否存在劫持漏洞。 8. **业务逻辑测试 (Business Logic Testing)** - 测试 API 工作流中可能被滥用的逻辑缺陷。 9. **模糊测试 (Fuzzing)** - 发送意外输入以发现 API 处理中的潜在缺陷。 10. **日志与监控测试 (Logging & Monitoring Testing)** - 确保安全事件被正确记录和监控。 ## API 测试的侦察工具 侦察是 API 渗透测试的第一阶段,测试人员在此阶段收集有关目标 API 的信息,以识别潜在的攻击面。 1. **[Nmap](https://nmap.org/)** – 扫描开放的端口、服务和 API endpoint。 2. **[Amass](https://github.com/OWASP/Amass)** – 执行子域名枚举以发现 API 主机。 3. **[Subfinder](https://github.com/projectdiscovery/subfinder)** – 查找可能托管 API 的子域名。 4. **[crt.sh](https://crt.sh/)** – 在 SSL 证书中搜索 API 子域名。 5. **[MassDNS](https://github.com/blechschmidt/massdns)** – 解析并发现隐藏的 API 域名。 6. **[Aquatone](https://github.com/michenriksen/aquatone)** – API endpoint 的可视化侦察。 7. **[httprobe](https://github.com/tomnomnom/httprobe)** – 检查哪些 API endpoint 处于活跃状态。 8. **[Waybackurls](https://github.com/tomnomnom/waybackurls)** / **[Gau](https://github.com/lc/gau)** – 查找已存档的 API endpoint。 9. **[ffuf](https://github.com/ffuf/ffuf)** – 对隐藏的 API 路径进行模糊测试。 10. **[Kiterunner](https://github.com/assetnote/kiterunner)** – 发现未记录在案的 API endpoint。 11. **[Swagger Editor](https://editor.swagger.io/)** – 解析 API 文档以寻找潜在的 endpoint。 12. **[GraphQL Voyager](https://github.com/APIs-guru/graphql-voyager)** – 分析 GraphQL API schema。 13. **[Burp Suite](https://portswigger.net/burp)** – 通过流量分析被动发现 API endpoint。 14. **[Google Dorking](https://www.exploit-db.com/google-hacking-database)** – 通过搜索引擎发现暴露的 API endpoint。 15. **[Shodan](https://www.shodan.io/)** – 搜索运行特定技术的暴露 API。 ## API 测试的身份验证测试工具 身份验证测试侧重于验证 API 身份验证机制(如 API 密钥、JWT、OAuth 和会话 token)的安全性。 1. **[Burp Suite](https://portswigger.net/burp)** – 拦截并篡改身份验证请求。 2. **[Postman](https://www.postman.com/)** – 手动测试 API 身份验证流程。 3. **[JWT_TOOL](https://github.com/ticarpi/jwt_tool)** – 测试 JWT 身份验证中的漏洞。 4. **[AuthAnalyzer (Burp Extension)](https://github.com/s0md3v/AuthAnalyzer)** – 分析身份验证机制。 5. **[OWASP ZAP](https://www.zaproxy.org/)** – 识别与身份验证相关的漏洞。 6. **[SAML Raider](https://github.com/SAMLRaider/SAMLRaider)** – 测试 SAML 身份验证安全性。 7. **[OAuth2 Proxy](https://github.com/oauth2-proxy/oauth2-proxy)** – 分析 OAuth2 身份验证流程。 8. **[Kerbrute](https://github.com/ropnop/kerbrute)** – 对 Kerberos 身份验证进行暴力破解。 9. **[TokenSpray](https://github.com/0xZDH/TokenSpray)** – 通过喷射泄露的 token 来测试 API token 身份验证。 10. **[CyberChef](https://gchq.github.io/CyberChef/)** – 解码并分析身份验证 token。 11. **[HackBrowserData](https://github.com/moonD4rk/HackBrowserData)** – 从浏览器中提取存储的 API 凭据。 12. **[mitmproxy](https://mitmproxy.org/)** – 拦截并修改 API 身份验证请求。 13. **[GraphQL Raider](https://github.com/doyensec/GraphQL-raider)** – 测试 GraphQL API 中的身份验证。 14. **[AQUATONE](https://github.com/michenriksen/aquatone)** – 发现 API 中的身份验证 endpoint。 15. **[ffuf](https://github.com/ffuf/ffuf)** – 对身份验证 token 和会话 ID 进行暴力破解。 ## API 测试的授权测试工具 授权测试确保用户和 API 客户端只能访问被允许的资源。它有助于识别诸如 IDOR、权限提升和基于角色的访问控制 (RBAC) 缺陷等漏洞。 1. **[Burp Suite](https://portswigger.net/burp)** – 篡改 API 请求以测试授权缺陷。 2. **[Postman](https://www.postman.com/)** – 手动修改标头、token 和角色以进行访问控制测试。 3. **[Autorize (Burp Extension)](https://github.com/Quitten/Autorize)** – 自动检查授权漏洞。 4. **[JWT_TOOL](https://github.com/ticarpi/jwt_tool)** – 分析并篡改 JWT token 以测试权限提升。 5. **[OWASP ZAP](https://www.zaproxy.org/)** – 识别 API 授权弱点。 6. **[GraphQL Raider](https://github.com/doyensec/GraphQL-raider)** – 探索 GraphQL 授权问题。 7. **[Arjun](https://github.com/s0md3v/Arjun)** – 检测可能绕过授权的隐藏参数。 8. **[AuthMatrix (Burp Extension)](https://github.com/SecurityInnovation/AuthMatrix)** – 测试基于角色的访问控制 (RBAC) 漏洞。 9. **[ffuf](https://github.com/ffuf/ffuf)** – 对 API endpoint 进行模糊测试以查找未经授权的访问。 10. **[Hoppscotch](https://hoppscotch.io/)** – 使用不同的用户角色测试 API 授权。 11. **[mitmproxy](https://mitmproxy.org/)** – 拦截并修改 API 请求以测试访问控制。 12. **[Google Dorking](https://www.exploit-db.com/google-hacking-database)** – 查找授权薄弱的暴露 endpoint。 13. **[IAM Vulnerability Scanner](https://github.com/nccgroup/iam-vulnerability-scanner)** – 识别 API 中的 IAM 配置错误。 14. **[GraphQL Voyager](https://github.com/APIs-guru/graphql-voyager)** – 可视化 GraphQL 权限以检测缺陷。 15. **[CyberChef](https://gchq.github.io/CyberChef/)** – 解码并分析授权 token。 ## API 测试的输入验证测试工具 输入验证测试确保 API 能够正确过滤和处理用户输入,以防止 SQL 注入、命令注入和 XSS 等攻击。 1. **[Burp Suite](https://portswigger.net/burp)** – 对 API 参数进行模糊测试和篡改,以发起注入攻击。 2. **[Postman](https://www.postman.com/)** – 发送精心构造的输入以测试验证机制。 3. **[OWASP ZAP](https://www.zaproxy.org/)** – 识别 API endpoint 中的输入验证缺陷。 4. **[SQLmap](https://sqlmap.org/)** – 检测并利用 SQL 注入漏洞。 5. **[Commix](https://github.com/commixproject/commix)** – 测试命令注入漏洞。 6. **[XSStrike](https://github.com/s0md3v/XSStrike)** – 检测并利用 API 响应中的 XSS 漏洞。 7. **[ffuf](https://github.com/ffuf/ffuf)** – 对 API endpoint 进行模糊测试以查找基于输入的漏洞。 8. **[Arjun](https://github.com/s0md3v/Arjun)** – 查找可能缺乏验证的隐藏 API 参数。 9. **[WFuzz](https://github.com/xmendez/wfuzz)** – 自动化对 API 输入字段的模糊攻击。 10. **[Nikto](https://cirt.net/Nikto2)** – 扫描 API 的常见配置错误和漏洞。 11. **[NoSQLMap](https://github.com/codingo/NoSQLMap)** – 检测 NoSQL 注入漏洞。 12. **[GraphQL Raider](https://github.com/doyensec/GraphQL-raider)** – 查找 GraphQL API 中的输入验证缺陷。 13. **[CyberChef](https://gchq.github.io/CyberChef/)** – 对输入进行编码和解码以绕过过滤器。 14. **[mitmproxy](https://mitmproxy.org/)** – 拦截并修改 API 请求以测试输入验证。 15. **[KNOXSS](https://knoxss.me/)** – 针对 API 响应的自动化 XSS 扫描器。 ## API 测试的速率限制与 DoS 测试工具 速率限制和拒绝服务 测试有助于识别可能允许攻击者通过过量请求使 API 超载的漏洞。 1. **[Burp Suite](https://portswigger.net/burp)** – 通过自动化快速请求来测试 API 速率限制。 2. **[Postman](https://www.postman.com/)** – 手动发送重复请求以观察速率限制行为。 3. **[OWASP ZAP](https://www.zaproxy.org/)** – 自动化请求突发以测试 API 速率限制。 4. **[Slowloris](https://github.com/gkbrk/slowloris)** – 模拟针对 API 的低带宽 DoS 攻击。 5. **[hping3](https://github.com/antirez/hping)** – 生成大流量 API 请求以进行压力测试。 6. **[Taurus](https://gettaurus.org/)** – 对 API 进行负载测试以测量其速率限制响应。 7. **[Gatling](https://gatling.io/)** – 模拟 API 负载测试以识别性能瓶颈。 8. **[Apache JMeter](https://jmeter.apache.org/)** – 执行高负载 API 测试以检测速率限制问题。 9. **[ffuf](https://github.com/ffuf/ffuf)** – 发送高频请求以测试速率限制。 10. **[K6](https://k6.io/)** – 用于评估 API 在繁重请求下性能的负载测试工具。 11. **[Locust](https://locust.io/)** – 用于 API 压力测试的分布式负载测试工具。 12. **[Artillery](https://www.artillery.io/)** – 用于 DoS 和速率限制验证的可扩展负载测试工具。 13. **[Tsunami Security Scanner](https://github.com/google/tsunami-security-scanner)** – 识别 API 速率限制弱点。 14. **[Metasploit (auxiliary modules)](https://www.metasploit.com/)** – 模拟对 API endpoint 的 DoS 攻击。 15. **[Boofuzz](https://github.com/jtpereyda/boofuzz)** – 对 API endpoint 进行模糊测试以检测速率限制绕过漏洞。 ## API 测试的安全标头与 CORS 测试工具 安全标头和 CORS(跨源资源共享)测试有助于识别可能导致数据暴露、未经授权的访问或安全绕过的配置错误。 1. **[Burp Suite](https://portswigger.net/burp)** – 测试并篡改安全标头和 CORS 策略。 2. **[OWASP ZAP](https://www.zaproxy.org/)** – 识别不安全的 CORS 配置和缺失的安全标头。 3. **[Postman](https://www.postman.com/)** – 手动检查 API 响应是否存在与 CORS 相关的问题。 4. **[Curl](https://curl.se/)** – 获取 API 响应以分析 CORS 标头。 5. **[Nikto](https://cirt.net/Nikto2)** – 扫描 API 响应中缺失的安全标头。 6. **[HTTP Toolkit](https://httptoolkit.tech/)** – 捕获并检查 API 流量以发现 CORS 漏洞。 7. **[C Scanner (OWASP)](https://github.com/awslabs/cors-scanner)** – 识别 API 中的 CORS 配置错误。 8. **[Mitmproxy](https://mitmproxy.org/)** – 拦截 API 请求以分析安全标头和 CORS 策略。 9. **[SecurityHeaders.com](https://securityheaders.com/)** – 用于评估 API 安全标头的在线工具。 10. **[CSRF Tester](https://github.com/cure53/CSRF-Tester)** – 检查依赖安全标头的 API 中的 CSRF 漏洞。 11. **[Header Security Tool (Mozilla Observatory)](https://observatory.mozilla.org/)** – 测试 API 是否缺失安全标头。 12. **[Retire.js](https://github.com/RetireJS/retire.js)** – 检测可能影响 CORS 安全的过时 JavaScript 库。 13. **[CSP Evaluator (Google)](https://csp-evaluator.withgoogle.com/)** – 测试内容安全策略 (CSP) 配置。 14. **[Nmap (http-headers script)](https://nmap.org/nsedoc/scripts/http-headers.html)** – 从 API 中提取并评估安全标头。 15. **[TestCORS.com](https://testcors.com/)** – 用于检查 CORS 策略配置的在线工具。 ## API 测试的会话管理测试工具 会话管理测试确保 API 安全地处理用户会话,防止会话劫持、会话固定或不当的会话终止。 1. **[Burp Suite](https://portswigger.net/burp)** – 测试会话 token 的生成、管理和过期。 2. **[OWASP ZAP](https://www.zaproxy.org/)** – 识别 API 响应中的会话管理缺陷。 3. **[Postman](https://www.postman.com/)** – 在 API 请求中管理和检查会话 token。 4. **[mitmproxy](https://mitmproxy.org/)** – 拦截并修改会话 token 以进行漏洞分析。 5. **[JWT.io](https://jwt.io/)** – 解码并分析 JWT token 的安全缺陷。 6. **[AuthAnalyzer (Burp Extension)](https://github.com/qllone/AuthAnalyzer)** – 识别身份验证和会话管理问题。 7. **[Session Hijacking Toolkit](https://github.com/antichown/SessionHijackingToolkit)** – 测试 API 会话管理弱点。 8. **[CSRF Tester](https://owasp.org/www-project-csrfguard/)** – 评估 API 会话安全性以抵御 CSRF 攻击。 9. **[Nmap (http-sessions script)](https://nmap.org/nsedoc/scripts/http-sessions.html)** – 提取并评估会话 cookie。 10. **[Ettercap](https://www.ettercap-project.org/)** – 在网络环境中测试 API 会话安全。 11. **[Wireshark](https://www.wireshark.org/)** – 捕获并分析网络流量中的 API 会话 token。 12. **[Cookie Cadger](http://www.cookiecadger.com/)** – 检测传输中不安全的 API 会话 cookie。 13. **[ModHeader (Browser Extension)](https://modheader.com/)** – 修改会话 token 以进行 API 安全测试。 14. **[Session Fixation Tester](https://github.com/codingo/SessionFixationTester)** – 测试 API 的会话固定漏洞。 15. **[JWT Cracker](https://github.com/brendan-rius/c-jwt-cracker)** – 尝试对 JWT 会话 token 进行暴力破解攻击。 ## API 测试的业务逻辑测试工具 业务逻辑测试侧重于识别 API 核心功能中的安全缺陷,确保工作流、访问控制和用户交互不可被利用。 1. **[Burp Suite (Manual Testing & Extensions)](https://portswigger.net/burp)** – 通过修改 API 请求识别逻辑缺陷。 2. **[OWASP ZAP](https://www.zaproxy.org/)** – 通过拦截和修改请求来测试 API 工作流。 3. **[Postman](https://www.postman.com/)** – 手动干预 API 调用以检查意外行为。 4. **[Mitmproxy](https://mitmproxy.org/)** – 拦截并修改 API 流量以分析逻辑漏洞。 5. **[GraphQL Voyager](https://github.com/APIs-guru/graphql-voyager)** – 分析 GraphQL schema 的逻辑安全缺陷。 6. **[Kiterunner](https://github.com/assetnote/kiterunner)** – 对 API endpoint 进行模糊测试以发现隐藏的逻辑漏洞。 7. **[Fuzzapi](https://github.com/Fuzzapi)** – 自动化 API 模糊测试以检测异常的业务逻辑缺陷。 8. **[Restler Fuzzer](https://github.com/microsoft/restler-fuzzer)** – 检测 REST API 序列和工作流中的逻辑缺陷。 9. **[GraphQL Raider (Burp Extension)](https://github.com/doyensec/GraphQL-raider)** – 查找 GraphQL API 中的逻辑漏洞。 10. **[AuthMatrix (Burp Extension)](https://portswigger.net/bappstore/745fb476395d4973b7ac09b1df5c8dc8)** – 测试权限提升和业务逻辑缺陷。 11. **[SecApps Logic Analyzer](https://secapps.com/)** – 检查 API 响应的逻辑不一致性。 12. **[API Hammer](https://github.com/Azure/api-hammer)** – 模拟不同的 API 请求场景以测试工作流安全。 13. **[BOLA Detector](https://github.com/BOLA-Detector)** – 识别失效的对象级别授权 (BOLA) 问题。 14. **[GadgetProbe](https://github.com/BishopFox/GadgetProbe)** – 测试影响 API 逻辑的反序列化漏洞。 15. **自定义 Python 脚本** – 量身定制的自动化脚本,用于检测 API 逻辑缺陷。 ## API 测试的模糊测试工具 API 测试中的模糊测试通过向 API endpoint 发送格式错误、意外或随机数据并观察其响应,来帮助识别安全漏洞。 1. **[Burp Suite Intruder](https://portswigger.net/burp/documentation/desktop/tools/intruder)** – 使用可自定义的 payload 自动化 API 模糊测试。 2. **[ffuf](https://github.com/ffuf/ffuf)** – 用于 API endpoint 发现和模糊测试的快速 Web 模糊测试器。 3. **[wfuzz](https://github.com/xmendez/wfuzz)** – 用于测试 API 参数和 endpoint 的基于 CLI 的模糊测试器。 4. **[Kiterunner](https://github.com/assetnote/kiterunner)** – 对未记录的 endpoint 进行暴力破解的特定于 API 的模糊测试器。 5. **[Restler Fuzzer](https://github.com/microsoft/restler-fuzzer)** – 微软针对 REST API 的模糊测试工具。 6. **[Fuzzapi](https://github.com/laluka/fuzzapi)** – 用于测试 API 安全漏洞的模糊测试框架。 7. **[Gfuzz](https://github.com/google/gfuzz)** – 用于检测输入验证缺陷的轻量级 API 模糊测试器。 8. **[Radamsa](https://gitlab.com/akihe/radamsa)** – 通过变异 API 请求生成测试用例。 9. **[JBroFuzz](https://www.owasp.org/index.php/OWASP_JBroFuzz)** – OWASP 的模糊测试工具,用于测试 API 稳定性和安全性。 10. **[基于语料的模糊测试器 (例如 AFL, LibFuzzer)](https://llvm.org/docs/LibFuzzer.html)** – 针对 API 响应的自定义模糊测试。 ## API 测试的日志与监控测试工具 日志和监控对于检测安全威胁、确保合规性以及维护 API 安全至关重要。这些工具可帮助分析日志、检测异常并监控 API 活动。 1. **[Graylog](https://www.graylog.org/)** – 用于 API 安全监控的集中式日志管理和分析工具。 2. **[Splunk](https://www.splunk.com/)** – 提供实时的安全分析和 API 活动监控。 3. **[ELK Stack (Elasticsearch, Logstash, Kibana)](https://www.elastic.co/what-is/elk-stack)** – 开源的日志分析和监控平台。 4. **[OpenTelemetry](https://opentelemetry.io/)** – 用于监控 API 请求的 API 可观测性和追踪工具。 5. **[Prometheus](https://prometheus.io/)** – 监控 API 性能并检测异常活动。 6. **[Grafana](https://grafana.com/)** – 可视化 API 日志和监控数据以获取安全洞察。 7. **[Sumo Logic](https://www.sumologic.com/)** – 用于 API 安全分析的基于云的日志管理工具。 8. **[Datadog](https://www.datadoghq.com/)** – 监控 API 流量、日志和安全事件。 9. **[Wazuh](https://wazuh.com/)** – 开源安全监控和日志分析工具。 10. **[New Relic](https://newrelic.com/)** – 追踪 API 性能并检测安全异常。
标签:API安全, CTI, GraphQL, JSON输出, RESTful, 主机安全, 密码管理