All skills
hardw00t avatar

/api-security

@f9bb3b2

Router skill for API penetration testing across REST, GraphQL, gRPC, and WebSocket. Covers OWASP API Top 10 (2023) including BOLA/BFLA/BOPLA, JWT attack chains, GraphQL introspection abuse, and mass assignment. Invoke when the user asks to pentest an API, analyze OpenAPI/Swagger, test auth/authorization, fuzz endpoints, or find API vulnerabilities.

Use this Skill: https://skilld.dev/gh/hardw00t/ai-security-arsenal/api-security

This session only. Nothing lands on disk.

workflowsrest_testing.md

≈922 tokens on demand. Your agent reads this file only when SKILL.md points to it.

REST API Testing Workflow

End-to-end runbook for a REST API engagement. Each phase lists independent operations you can parallelize.

Phase 1 — Reconnaissance (parallelizable)

Run these concurrently; they are independent.

# Spec discovery (run in parallel)
curl -s https://target.tld/api/docs           | tee recon/docs.json
curl -s https://target.tld/swagger.json       | tee recon/swagger.json
curl -s https://target.tld/openapi.json       | tee recon/openapi.json
curl -s https://target.tld/.well-known/openapi.json | tee recon/well-known.json
curl -s https://target.tld/v1/api-docs        | tee recon/v1-api-docs.json
curl -s https://target.tld/v2/api-docs        | tee recon/v2-api-docs.json
curl -s https://target.tld/api/schema         | tee recon/schema.json

# Common path brute force
ffuf -u https://target.tld/FUZZ -w api-wordlist.txt \
     -mc 200,201,204,301,302,401,403 -o recon/ffuf.json

# Endpoint discovery from JS / kiterunner / katana (parallel)
kr scan https://target.tld -w routes-large.kite -o recon/kr.txt
katana -u https://target.tld -jc -o recon/katana.txt

# Parameter discovery per-endpoint
arjun -u https://target.tld/api/users -m GET,POST -oJ recon/arjun-users.json

Common paths to probe manually if brute-force is noisy: /api/, /api/v1/, /api/v2/, /api/internal/, /rest/, /graphql, /graphiql, /api-docs, /swagger, /swagger-ui, /swagger.json, /openapi.json, /.well-known/, /actuator/, /actuator/env, /actuator/heapdump, /management/, /console/.

Phase 2 — Spec Parsing (run alongside recon)

If you obtained an OpenAPI/Swagger spec, parse it and emit:

  • endpoints.txt — one METHOD path per line
  • params.json — parameter list per endpoint
  • auth_modes.txt — security schemes referenced

This unblocks fuzzers while recon is still running.

Phase 3 — Auth Enumeration (parallelizable per auth mode)

For each identified auth mechanism, confirm a working token:

  • Unauthenticated (no creds)
  • User-role (regular account A and B)
  • Admin-role (if available)
  • Service-to-service (API key, mTLS, OIDC client-credentials)

See workflows/jwt_attack_chooser.md if JWTs are in use.

Phase 4 — Authorization Matrix (SEQUENTIAL, high reasoning)

This is the highest-value phase for REST APIs. Spend extended thinking budget here.

For every endpoint x every auth context, record the response code and whether cross-user data leaks. Spawn one sub-agent per auth mode and merge.

  • BOLA: see methodology/bola_bfla_matrix.md
  • BFLA: same doc, privilege section
  • Payload ID lists: payloads/bola_idor.txt, payloads/bfla_privilege.txt

Phase 5 — Input Validation (parallelizable per endpoint)

# SQLi
sqlmap -r request.txt --batch --level 5 --risk 3
# NoSQLi, cmdi, SSRF, XXE payloads
# -> payloads/injection.txt
# Mass assignment
# -> payloads/mass_assignment.txt

Phase 6 — Resource / Rate Limit

# Rapid-fire (check 429 enforcement)
seq 1 1000 | xargs -P50 -I{} curl -s -o /dev/null -w "%{http_code}\n" \
  https://target.tld/api/login -d '{"user":"test","pass":"test"}' \
  | sort | uniq -c

# Pagination abuse
GET /api/users?limit=1000000
GET /api/users?page=-1
GET /api/users?offset=9999999999

# Field expansion / projection
GET /api/users?expand=all
GET /api/users?fields=password,secret,api_key

# Batch inflation
POST /api/batch   # body: array of 10k subrequests

Phase 7 — Misconfig / Inventory (parallelizable)

nuclei -u https://target.tld/api -t exposures/ -t vulnerabilities/ -t misconfiguration/
nuclei -l endpoints.txt -t api-tests/

Record every finding per schemas/finding.json with api_type: "rest".

Source: SKILL.md on GitHub

1 warning16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The analyzed skill contains standard penetration testing guides, methodology documents, and common vulnerability checklists for API security auditing. No malicious behavior, prompt injection, or hidden execution channels were detected.

  • Socket16d

    3 alerts: gptSecurity

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    1/1 file flagged

Signed by skilld at f9bb3b2. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 6 months ago

README badge

README badge for hardw00t/ai-security-arsenal/api-security