跳到正文
Skillpedia
安全35k · #7731

conducting-api-security-testing

它能做什么

这个智能体用于测试 API(即程序之间相互通信所用的接口)的安全性。它会查找黑客可能利用的缺陷,从而获得未授权访问、篡改数据或破坏服务。

适用场景

  • ✓当你想验证某个 API 是否能抵御入侵时。
  • ✓当你要上线一个新 API,需要确保其安全性时。
  • ✓对现有 API 进行安全审计时。

技能链接

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/conducting-api-security-testing/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/conducting-api-security-testing/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“测试登录 API 的安全性,看看身份验证能否被绕过。”

每周 5 个新技能,1 分钟读完。

工作原理

它会借助专用工具和 API 文档模拟常见攻击。目标是在恶意攻击者之前发现弱点。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Conducting API Security Testing

When to Use

  • Testing API endpoints for authorization flaws, injection vulnerabilities, and business logic bypasses
  • Assessing the security of microservices architecture where APIs are the primary communication method
  • Validating that API gateway protections (rate limiting, authentication, input validation) are properly enforced
  • Testing third-party API integrations for data exposure and insecure configurations
  • Evaluating GraphQL APIs for introspection disclosure, query complexity attacks, and authorization bypasses

Do not use against APIs without written authorization, for load testing or denial-of-service testing unless explicitly scoped, or for testing production APIs that process real financial transactions without safeguards.

Prerequisites

  • API documentation (OpenAPI/Swagger, GraphQL schema, Postman collection) or application access to reverse-engineer the API
  • Burp Suite Professional configured to intercept API traffic with JSON/XML content type handling
  • Postman or Insomnia for organizing and replaying API requests across different authentication contexts
  • Valid API tokens or credentials at multiple privilege levels (unauthenticated, standard user, admin)
  • Target API base URL and version information

Workflow

Step 1: API Discovery and Documentation

Map the complete API attack surface:

  • Import API documentation: Load OpenAPI/Swagger specs into Postman or Burp Suite to catalog all endpoints, methods, parameters, and authentication requirements
  • Reverse-engineer undocumented APIs: Proxy the mobile app or web frontend through Burp Suite and exercise all features to capture API calls. Export the Burp sitemap as the baseline endpoint inventory.
  • GraphQL introspection: Send an introspection query to discover the full schema:
    {"query": "{__schema{types{name,fields{name,args{name,type{name}}}}}}"}
    
  • Endpoint enumeration: Fuzz for hidden API versions (/api/v1/, /api/v2/, /api/internal/), debug endpoints (/api/debug, /api/health, /api/metrics), and administrative endpoints
  • Document authentication mechanisms: Identify if the API uses API keys, OAuth 2.0 Bearer tokens, JWT, session cookies, or mutual TLS

Step 2: Authentication and Token Testing

Test authentication mechanisms for weaknesses:

  • JWT analysis: Decode the JWT and inspect claims (sub, exp, iss, aud, role). Test:
    • Algorithm confusion: Change alg to none and remove the signature
    • Key confusion: Change alg from RS256 to HS256 and sign with the public key
    • Weak secret: Brute-force the HMAC secret with hashcat -m 16500 jwt.txt wordlist.txt
    • Token expiration: Verify tokens expire and cannot be used after expiration
    • Claim tampering: Modify role, userId, or permission claims and re-sign
  • OAuth 2.0 testing: Check for redirect_uri manipulation, authorization code reuse, token leakage in Referer headers, and missing state parameter (CSRF)
  • API key security: Test if API keys are validated per-endpoint, if revoked keys are immediately rejected, and if keys in query strings appear in access logs or analytics

Step 3: Authorization Testing (BOLA/BFLA)

Test for Broken Object Level Authorization (BOLA) and Broken Function Level Authorization (BFLA):

  • BOLA (IDOR) testing: For every endpoint that returns user-specific data, replace the object identifier with another user's identifier:
    • GET /api/users/123/orders -> GET /api/users/456/orders
    • Test with numeric IDs, UUIDs, usernames, and email addresses
    • Automate with Burp Autorize extension: configure it with two sessions (attacker and victim) and replay all requests
  • BFLA testing: Using a low-privilege token, attempt to access administrative endpoints:
    • DELETE /api/users/456 (admin-only delete)
    • PUT /api/users/456/role (role modification)
    • GET /api/admin/dashboard (admin panel data)
  • Mass assignment: Send additional JSON properties not shown in the documentation:
    PUT /api/users/123
    {"name": "Test", "role": "admin", "isVerified": true, "balance": 99999}
    
  • HTTP method testing: If GET works on an endpoint, try PUT, PATCH, DELETE, and OPTIONS to discover unprotected methods

Step 4: Input Validation and Injection Testing

Test API inputs for injection and validation flaws:

…

常见问题

什么是 API?

API 就像“信使”,让不同的计算机程序能够以有组织的方式相互交换信息和功能。

什么是安全漏洞?

安全漏洞是系统中的缺陷或漏洞,恶意人员可能利用它们造成危害、窃取数据或获得未授权访问。

什么是 OWASP Top 10?

它是网页应用和 API 中最严重、最常见的 10 类安全漏洞清单,常被用作安全测试的指南。

详情

作者的原始描述

Conducts security testing of REST, GraphQL, and gRPC APIs to identify vulnerabilities in authentication, authorization, rate limiting, input validation, and business logic. The tester uses the OWASP API Security Top 10 as the testing framework, combining Burp Suite interception with Postman collections and custom scripts to test endpoint security at every privilege level. Activates for requests in

repo: mukul975/Anthropic-Cybersecurity-Skills

热度

GitHub 星标
35k
排名
#7731
许可证
Apache-2.0
更新时间
2026/8/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能