API Breaker
Intelligent API security testing. Discovers, maps, and exploits API vulnerabilities.
Important
CRITICAL: Only test APIs you have explicit authorization to test.
Instructions
Step 1: API Discovery
python scripts/api_discovery.py --domain {target_domain}
Discovery methods:
- Path fuzzing: /api/, /v1/, /v2/, /graphql, /rest/, /swagger.json, /openapi.json, /api-docs
- JavaScript analysis: Parse JS files for hardcoded API endpoints, base URLs, fetch/axios calls
- Wayback Machine: Historical API endpoints that may still be active
- Common patterns: /{resource}s, /{resource}/{id}, /{resource}/{id}/{subresource}
- GraphQL detection: /graphql, /graphiql, /playground, /api/graphql
- Documentation endpoints: Swagger, OpenAPI, WADL, WSDL
For each discovered API:
- Record base URL, authentication method, content type
- Detect API standard (REST, GraphQL, gRPC-web, SOAP)
Step 2: Schema Reconstruction
python scripts/schema_builder.py --api-base {api_url}
Even without documentation:
- Send requests with varying parameters and observe responses
- Analyze error messages for expected field names/types
- Use OPTIONS/HEAD to discover allowed methods
- Test content negotiation (JSON, XML, form-encoded)
- GraphQL: Send introspection query to get full schema
Output: Reconstructed API schema in OpenAPI format.
Step 3: Authentication Analysis
python scripts/auth_analyzer.py --api-base {api_url}
Detect and test:
- JWT tokens: Decode, test none algorithm, key confusion (RS256->HS256), weak secrets, claim tampering
- API keys: Test in different positions (header, query, body), check for key leakage
- OAuth flows: Test for open redirect in callback, token leakage, PKCE bypass
- Session tokens: Predictability, fixation, rotation on privilege change
- No auth: Endpoints accessible without any authentication
Step 4: Authorization Testing (BOLA/BFLA)
python scripts/authz_tester.py --schema {schema_file} --token {user_token}
BOLA (Broken Object-Level Authorization):
For every endpoint with an object ID:
- Create resource as User A, note the ID
- Access that ID as User B (different token)
- If User B can read/modify/delete User A's resource = BOLA
BFLA (Broken Function-Level Authorization):
- Map endpoints by intended role (user vs admin)
- Test admin endpoints with regular user token
- Test all HTTP methods (GET, POST, PUT, DELETE, PATCH) on each endpoint
Step 5: Mass Assignment Testing
python scripts/mass_assignment.py --schema {schema_file} --token {token}
For each creation/update endpoint:
- Send normal request, note accepted fields
- Add extra fields:
role, isAdmin, price, discount, verified, approved, permissions
- Check if extra fields are processed
- Test with nested objects:
{"user": {"role": "admin"}}
Step 6: Rate Limiting and Resource Testing
python scripts/rate_limiter.py --api-base {api_url}
Test:
- Send 100+ rapid requests to each endpoint
- Check for 429 responses or rate limit headers
- If rate limited: test bypass via IP rotation headers (X-Forwarded-For, X-Real-IP)
- Test resource-intensive endpoints for DoS potential (large pagination, deep queries)
- GraphQL: Test query batching, nested query depth, alias-based multiplication
Step 7: Business Logic Testing
python scripts/logic_tester.py --schema {schema_file} --token {token}
Context-aware tests:
- E-commerce: Price manipulation, quantity overflow, currency confusion, coupon stacking
- Financial: Double spending via race conditions, negative amount transfer
- User management: Self-privilege escalation, email verification bypass, 2FA bypass
- File handling: Path traversal in file names, SSRF in URL fields, XXE in XML endpoints
Step 8: Report Generation
python scripts/api_report.py --findings {findings_dir}
Per-finding output:
- Vulnerability type and OWASP API Security Top 10 mapping
- Affected endpoint and method
- Request/response showing the issue
- curl command for reproduction
- Impact assessment
- Remediation recommendation
Error Handling
No API Documentation Found
If no Swagger/OpenAPI exists:
- Schema reconstruction from observed behavior (Step 2)
- Use error messages as hints for field discovery
- Inform user of reduced coverage without docs
Authentication Required
- Ask user for API token/credentials
- Support: Bearer token, API key, Basic auth, OAuth token
- Usage:
--token "Bearer abc123" or --api-key "key123"
GraphQL Introspection Disabled
If introspection is blocked:
- Use field suggestion: send partial queries, use error messages to discover fields
- Use clairvoyance-style wordlist-based field discovery
- Check for GraphQL Voyager/Playground on alternative paths
Examples
Example 1: Full API Assessment
User says: "Test the API at api.example.com"
Actions:
- Discover all endpoints
- Reconstruct schema
- Test auth, BOLA, BFLA, mass assignment
- Test rate limiting
- Generate comprehensive report
Example 2: GraphQL Security Audit
User says: "Audit the GraphQL API at example.com/graphql"
Actions:
- Send introspection query
- Map all queries and mutations
- Test authorization on each mutation
- Test query depth/complexity limits
- Test batching attacks
- Report findings
Example 3: JWT Penetration Test
User says: "Test JWT security on the API"
Actions:
- Capture JWT from auth flow
- Decode and analyze claims
- Test none algorithm
- Test RS256->HS256 confusion
- Brute-force weak secrets
- Test claim manipulation (user ID, role, expiry)
1---2name: api-breaker3description: Automated API security testing starting from domains. Discovers REST, GraphQL, and SOAP APIs, reconstructs schemas, and tests for BOLA/IDOR, BFLA, mass assignment, JWT attacks, rate limiting bypass, and business logic flaws. Use when user asks to "test API security", "break API", "find API vulnerabilities", "test GraphQL", "test JWT", "API pentest", or provides domains with API endpoints. For authorized testing only.4metadata:5 source: https://skillmd.com/skills/aibot88/api-breaker6 author: orizon.one7 version: 1.0.08---910# API Breaker1112Intelligent API security testing. Discovers, maps, and exploits API vulnerabilities.1314## Important1516CRITICAL: Only test APIs you have explicit authorization to test.1718## Instructions1920### Step 1: API Discovery2122```bash23python scripts/api_discovery.py --domain {target_domain}24```2526Discovery methods:271. **Path fuzzing**: /api/, /v1/, /v2/, /graphql, /rest/, /swagger.json, /openapi.json, /api-docs282. **JavaScript analysis**: Parse JS files for hardcoded API endpoints, base URLs, fetch/axios calls293. **Wayback Machine**: Historical API endpoints that may still be active304. **Common patterns**: /{resource}s, /{resource}/{id}, /{resource}/{id}/{subresource}315. **GraphQL detection**: /graphql, /graphiql, /playground, /api/graphql326. **Documentation endpoints**: Swagger, OpenAPI, WADL, WSDL3334For each discovered API:35- Record base URL, authentication method, content type36- Detect API standard (REST, GraphQL, gRPC-web, SOAP)3738### Step 2: Schema Reconstruction3940```bash41python scripts/schema_builder.py --api-base {api_url}42```4344Even without documentation:451. Send requests with varying parameters and observe responses462. Analyze error messages for expected field names/types473. Use OPTIONS/HEAD to discover allowed methods484. Test content negotiation (JSON, XML, form-encoded)495. GraphQL: Send introspection query to get full schema5051Output: Reconstructed API schema in OpenAPI format.5253### Step 3: Authentication Analysis5455```bash56python scripts/auth_analyzer.py --api-base {api_url}57```5859Detect and test:60- **JWT tokens**: Decode, test none algorithm, key confusion (RS256->HS256), weak secrets, claim tampering61- **API keys**: Test in different positions (header, query, body), check for key leakage62- **OAuth flows**: Test for open redirect in callback, token leakage, PKCE bypass63- **Session tokens**: Predictability, fixation, rotation on privilege change64- **No auth**: Endpoints accessible without any authentication6566### Step 4: Authorization Testing (BOLA/BFLA)6768```bash69python scripts/authz_tester.py --schema {schema_file} --token {user_token}70```7172**BOLA (Broken Object-Level Authorization):**73For every endpoint with an object ID:741. Create resource as User A, note the ID752. Access that ID as User B (different token)763. If User B can read/modify/delete User A's resource = BOLA7778**BFLA (Broken Function-Level Authorization):**791. Map endpoints by intended role (user vs admin)802. Test admin endpoints with regular user token813. Test all HTTP methods (GET, POST, PUT, DELETE, PATCH) on each endpoint8283### Step 5: Mass Assignment Testing8485```bash86python scripts/mass_assignment.py --schema {schema_file} --token {token}87```8889For each creation/update endpoint:901. Send normal request, note accepted fields912. Add extra fields: `role`, `isAdmin`, `price`, `discount`, `verified`, `approved`, `permissions`923. Check if extra fields are processed934. Test with nested objects: `{"user": {"role": "admin"}}`9495### Step 6: Rate Limiting and Resource Testing9697```bash98python scripts/rate_limiter.py --api-base {api_url}99```100101Test:102- Send 100+ rapid requests to each endpoint103- Check for 429 responses or rate limit headers104- If rate limited: test bypass via IP rotation headers (X-Forwarded-For, X-Real-IP)105- Test resource-intensive endpoints for DoS potential (large pagination, deep queries)106- GraphQL: Test query batching, nested query depth, alias-based multiplication107108### Step 7: Business Logic Testing109110```bash111python scripts/logic_tester.py --schema {schema_file} --token {token}112```113114Context-aware tests:115- **E-commerce**: Price manipulation, quantity overflow, currency confusion, coupon stacking116- **Financial**: Double spending via race conditions, negative amount transfer117- **User management**: Self-privilege escalation, email verification bypass, 2FA bypass118- **File handling**: Path traversal in file names, SSRF in URL fields, XXE in XML endpoints119120### Step 8: Report Generation121122```bash123python scripts/api_report.py --findings {findings_dir}124```125126Per-finding output:127- Vulnerability type and OWASP API Security Top 10 mapping128- Affected endpoint and method129- Request/response showing the issue130- curl command for reproduction131- Impact assessment132- Remediation recommendation133134## Error Handling135136### No API Documentation Found137If no Swagger/OpenAPI exists:1381. Schema reconstruction from observed behavior (Step 2)1392. Use error messages as hints for field discovery1403. Inform user of reduced coverage without docs141142### Authentication Required1431. Ask user for API token/credentials1442. Support: Bearer token, API key, Basic auth, OAuth token1453. Usage: `--token "Bearer abc123"` or `--api-key "key123"`146147### GraphQL Introspection Disabled148If introspection is blocked:1491. Use field suggestion: send partial queries, use error messages to discover fields1502. Use clairvoyance-style wordlist-based field discovery1513. Check for GraphQL Voyager/Playground on alternative paths152153## Examples154155### Example 1: Full API Assessment156User says: "Test the API at api.example.com"157158Actions:1591. Discover all endpoints1602. Reconstruct schema1613. Test auth, BOLA, BFLA, mass assignment1624. Test rate limiting1635. Generate comprehensive report164165### Example 2: GraphQL Security Audit166User says: "Audit the GraphQL API at example.com/graphql"167168Actions:1691. Send introspection query1702. Map all queries and mutations1713. Test authorization on each mutation1724. Test query depth/complexity limits1735. Test batching attacks1746. Report findings175176### Example 3: JWT Penetration Test177User says: "Test JWT security on the API"178179Actions:1801. Capture JWT from auth flow1812. Decode and analyze claims1823. Test none algorithm1834. Test RS256->HS256 confusion1845. Brute-force weak secrets1856. Test claim manipulation (user ID, role, expiry)