agentleFS
fatihkanfatihkan/badi/.claude/skills-vault/pentest-api/SKILL.md

pentest-api

Skill8 starsChanged 3 months agoMITView on GitHub

API security testing — REST/GraphQL/WebSocket, OWASP API Top 10, JWT/OAuth analysis, mass assignment, broken object-level authorization advisory. Triggers on API pentest, OWASP API, REST security, GraphQL test, WebSocket, JWT analysis, OAuth flow, BOLA, BFLA, mass assignment.

  • Sends data out

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the response returns isAdmin: true, the vulnerability is present.

    line 109

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

pentest-api

REST + GraphQL + WebSocket security testing methodology. Focused on OWASP API Security Top 10 (2023).

Triggers

  • "API pentest"
  • "OWASP API Top 10"
  • "GraphQL introspection"
  • "JWT swap attempt"
  • "OAuth flow test"
  • "BOLA / BFLA"
  • "mass assignment"
  • "WebSocket security"

OWASP API Top 10 (2023)

#CategoryTest Approach
API1BOLA (Broken Object Level Auth)/users/123 -> /users/124 enum, unauthorized data access
API2Broken AuthenticationToken replay, JWT manipulation, brute force endpoint
API3Broken Object Property Level AuthMass assignment (admin: true), excessive exposure
API4Unrestricted Resource ConsumptionMissing rate limit, pagination size, file upload size
API5BFLA (Broken Function Level Auth)Is /admin/* reachable with a user role
API6Unrestricted Business FlowsBizlogic exploit (delegate to pentest-bizlogic)
API7SSRFURL parameter cloud metadata reach
API8Security MisconfigVerbose error, CORS *, default endpoint
API9Improper Inventoryv1/v2 same endpoint, different auth, shadow API
API10Unsafe Consumption of 3rd Party APIAPI key exfil, response trust

REST Test Methodology

1. Find the spec document: /swagger.json, /openapi.yaml, /api-docs
2. List endpoints + auth requirements
3. BOLA: numeric ID enum (user_id, doc_id, order_id)
4. BFLA: role change (cookie/header swap)
5. Rate limit: 100 requests/sec within 60s
6. CORS: Origin: evil.com -> reflect?
7. Verbose error: malformed body, sql-like input

GraphQL Test

# Introspection check (QUIET)
curl -X POST https://<target>/graphql -H 'Content-Type: application/json' -d '{"query":"{__schema{types{name fields{name}}}}"}'

# Common queries
- Field suggestion (typo) -> auto-suggest reveal
- Batching: 1000 queries in a single POST (DoS-readiness test)
- Alias overloading
- Deep nesting: { user { friend { friend { ... } } } } depth 10+

JWT Analysis

TestApproach
alg: noneSet the header to {"alg":"none","typ":"JWT"}, remove the signature
alg confusionRS256 -> HS256, use the public key as the secret
kid injectionkid: ../../../dev/null (SQLi if the kid is SQL-backed)
exp ignoreexp is in the past, does the server still accept it
Weak secretCrack the JWT secret with hashcat (offline)
# QUIET — decode only (no request to any target)
echo "<token>" | python3 -c "import sys,jwt; print(jwt.decode(sys.stdin.read().strip(), options={'verify_signature': False}))"

OAuth Flow Test

  • redirect_uri tampering: send the token to evil.com
  • missing state parameter -> CSRF
  • is response_type=token (implicit) still supported
  • PKCE missing (mandatory for mobile/SPA)
  • scope creep: request minimal scope, did max scope come back
  • missing refresh token rotation

Mass Assignment Test

POST /api/users
Content-Type: application/json

{
  "name": "test",
  "email": "test@example.com",
  "isAdmin": true,           # mass assignment
  "subscription": "premium"  # mass assignment
}

If the response returns isAdmin: true, the vulnerability is present.

WebSocket

  • Is Origin header validation missing (CSRF-like)
  • Is authentication a single handshake (mid-session re-auth?)
  • Message size limit
  • Binary message + WS Frame manipulation

Output Template

## API Analysis — <baseURL>

### Findings
- [HIGH] BOLA in GET /api/orders/{id} — user A can see user B's order
- [MEDIUM] GraphQL introspection is open in production
- [LOW] CORS Origin reflection (null origin only)

### Untested Areas
- BFLA admin endpoint (no admin token)
- WebSocket /ws — handshake not tested
- Rate limit threshold (outside the client's test window)

Out-of-Scope

  • Live brute force (pentest-credentials)
  • DDoS via rate limit absent
  • Automated tool that enables a token replay attack

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.