TL;DR
- 目的:API-focused security testing for modern applications: SPA backend APIs, GraphQL, gRPC, WebSocket. Covers discovery, schema enumeration, auth…
- 适用:辅助/通用
- 输入:目标 URL + API 端点列表 + 鉴权方式
- 输出:资产清单/子域/端口表
- 红线:禁止越权访问他人租户;爆破需账号确认门
- 关联:上游:003-src-session-start → 下游:003-src-session-start(按需调用)
Workflow
- Component fingerprint — Detect technology stack via Wappalyzer, WhatWeb, or headers
- Endpoint discovery — Crawl JS files, sitemap.xml, robots.txt, OpenAPI/Swagger
- Schema enumeration — Hit
/api/v*/openapi.json or trigger introspection
- Authentication analysis — Find JWT tokens, OAuth flows, API keys
- Authorization testing — BOLA/BFLA per endpoint matrix
- Rate limit testing — Identify thresholds and bypass techniques
- Mass assignment — Try adding fields not in schema
- Documentation — Per-endpoint findings with reproduction
Common Tools
- Burp Suite Pro with Autorify, JSON Web Token, Autorize extensions
- Postman / Insomnia — Manual API testing
- curl / httpie — CLI request crafting
- jwt_tool / PyJWT — JWT manipulation
- kiterunner — API endpoint discovery
When to Use
- Target presents indicators of the vulnerability class this skill covers
- Fingerprint or recon indicates the relevant technology stack is in use
- Authorized testing scope covers the target endpoint or component
- Findings need to be validated through this skill's methodology
When NOT to Use
- Target is clearly outside this skill's scope (refer to other web-vulns skills)
- No authorization for testing
- Need reconnaissance rather than exploitation (use 1-recon-osint skills instead)
SRC API Security Testing
Quick Start
# 枚举 API 端点
grep -rn "router\|@app\|@router\|@bp" src/ | head -30
# 查看 API 文档(如有)
curl -s http://target/api/docs | jq .
Objective
Find vulnerabilities in the API layer of scoped modern applications (SPA/mobile backends): broken auth, BOLA, schema abuse, injection, excessive data.
Workflow
1. API Discovery
- From JS bundles: route maps, endpoint lists; from mobile apps (APK decompile if in scope).
- Identify API style: REST / GraphQL / gRPC / WebSocket.
- Note base URLs and auth scheme (JWT, session, key).
2. Schema Enumeration
- OpenAPI/Swagger: /swagger-ui.html, /api-docs, /v2/api-docs, /openapi.json, /swagger/v1/swagger.json.
- GraphQL: introspection query (if enabled) to dump full schema; build query/field map.
- gRPC: reflection (grpcurl -plaintext list).
3. API Auth Testing
- Missing auth on endpoints (public access to protected resources).
- JWT weaknesses: alg confusion (none/HS256 with public key), weak secret, expired token acceptance.
- Token scope/privilege mismatch; IDOR via path/body parameters.
4. Injection & Abuse on API Layer
- GraphQL: injection on arguments, deep nesting (DoS), alias abuse, field duplication (cost attack).
- REST: BOLA (object-level), mass assignment, parameter pollution (HPP).
- WebSocket: auth on upgrade, message injection, IDOR over socket.
- gRPC: field fuzzing, reflection leaks.
5. Evidence
- For each finding: request/response pair, auth context (which token/session), impact.
Red Lines
- No bulk enumeration of other users' data; no DoS (depth/volume limits on GraphQL probes).
- Rate-limit requests (-rl 10).
- Log to /root/dig/audit/oplog.md.
Advanced Techniques
Multi-Session Coordination
Use multiple agent sessions in parallel for different scopes (e.g., one per target subdomain) with shared share/intel/ directory.
Session Persistence
Maintain session state in dig/<agent>/sessions/<target>-<timestamp>/ with notes.md, findings.md, screenshots/ subdirectories.
1---2name: src-api-testing3description: Perform src api testing assessment during authorized security testing. Use this skill when indicators of the vulnerability class are present in the target environment.4license: Apache-2.05---67## TL;DR89- **目的**:API-focused security testing for modern applications: SPA backend APIs, GraphQL, gRPC, WebSocket. Covers discovery, schema enumeration, auth…10- **适用**:辅助/通用11- **输入**:目标 URL + API 端点列表 + 鉴权方式12- **输出**:资产清单/子域/端口表13- **红线**:禁止越权访问他人租户;爆破需账号确认门14- **关联**:上游:003-src-session-start → 下游:003-src-session-start(按需调用)15161718## Workflow19201. **Component fingerprint** — Detect technology stack via Wappalyzer, WhatWeb, or headers212. **Endpoint discovery** — Crawl JS files, sitemap.xml, robots.txt, OpenAPI/Swagger223. **Schema enumeration** — Hit `/api/v*/openapi.json` or trigger introspection234. **Authentication analysis** — Find JWT tokens, OAuth flows, API keys245. **Authorization testing** — BOLA/BFLA per endpoint matrix256. **Rate limit testing** — Identify thresholds and bypass techniques267. **Mass assignment** — Try adding fields not in schema278. **Documentation** — Per-endpoint findings with reproduction2829## Common Tools3031- **Burp Suite Pro** with Autorify, JSON Web Token, Autorize extensions32- **Postman / Insomnia** — Manual API testing33- **curl / httpie** — CLI request crafting34- **jwt_tool / PyJWT** — JWT manipulation35- **kiterunner** — API endpoint discovery3637## When to Use3839- Target presents indicators of the vulnerability class this skill covers40- Fingerprint or recon indicates the relevant technology stack is in use41- Authorized testing scope covers the target endpoint or component42- Findings need to be validated through this skill's methodology4344## When NOT to Use4546- Target is clearly outside this skill's scope (refer to other web-vulns skills)47- No authorization for testing48- Need reconnaissance rather than exploitation (use 1-recon-osint skills instead)4950# SRC API Security Testing5152## Quick Start5354```bash55# 枚举 API 端点56grep -rn "router\|@app\|@router\|@bp" src/ | head -3057# 查看 API 文档(如有)58curl -s http://target/api/docs | jq .59```6061## Objective62Find vulnerabilities in the API layer of scoped modern applications (SPA/mobile backends): broken auth, BOLA, schema abuse, injection, excessive data.6364## Workflow6566### 1. API Discovery67- From JS bundles: route maps, endpoint lists; from mobile apps (APK decompile if in scope).68- Identify API style: REST / GraphQL / gRPC / WebSocket.69- Note base URLs and auth scheme (JWT, session, key).7071### 2. Schema Enumeration72- OpenAPI/Swagger: /swagger-ui.html, /api-docs, /v2/api-docs, /openapi.json, /swagger/v1/swagger.json.73- GraphQL: introspection query (if enabled) to dump full schema; build query/field map.74- gRPC: reflection (grpcurl -plaintext list).7576### 3. API Auth Testing77- Missing auth on endpoints (public access to protected resources).78- JWT weaknesses: alg confusion (none/HS256 with public key), weak secret, expired token acceptance.79- Token scope/privilege mismatch; IDOR via path/body parameters.8081### 4. Injection & Abuse on API Layer82- GraphQL: injection on arguments, deep nesting (DoS), alias abuse, field duplication (cost attack).83- REST: BOLA (object-level), mass assignment, parameter pollution (HPP).84- WebSocket: auth on upgrade, message injection, IDOR over socket.85- gRPC: field fuzzing, reflection leaks.8687### 5. Evidence88- For each finding: request/response pair, auth context (which token/session), impact.8990## Red Lines91- No bulk enumeration of other users' data; no DoS (depth/volume limits on GraphQL probes).92- Rate-limit requests (-rl 10).93- Log to /root/dig/audit/oplog.md.949596## Advanced Techniques9798### Multi-Session Coordination99Use multiple agent sessions in parallel for different scopes (e.g., one per target subdomain) with shared `share/intel/` directory.100101### Session Persistence102Maintain session state in `dig/<agent>/sessions/<target>-<timestamp>/` with notes.md, findings.md, screenshots/ subdirectories.