<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
# Automated Penetration Testing — API Reference

## Nuclei CLI

```bash
# Run with severity filter
nuclei -target http://10.0.1.10 -severity high,critical -json -silent

# Run specific templates
nuclei -target http://10.0.1.10 -t cves/2024/ -json

# Run against multiple targets
nuclei -l targets.txt -severity critical -o results.json -json
```

## Nmap NSE Scripts

```bash
# Vulnerability detection
nmap --script vuln -p 80,443,8080 10.0.1.0/24 -oX vuln_scan.xml

# Default credentials check
nmap --script http-default-accounts -p 8080 10.0.1.20

# SSL/TLS audit
nmap --script ssl-enum-ciphers -p 443 10.0.1.10
```

## MITRE ATT&CK Mapping

```python
TECHNIQUE_MAP = {
    "T1190": "Exploit Public-Facing Application",
    "T1059": "Command and Scripting Interpreter",
    "T1059.007": "JavaScript",
    "T1078.001": "Default Accounts",
    "T1083": "File and Directory Discovery",
    "T1133": "External Remote Services",
    "T1557": "Adversary-in-the-Middle",
}
```

## Finding Data Contract

```python
finding = {
    "template_id": "sqli-error-based",
    "host": "10.0.1.30",
    "severity": "high",         # info | low | medium | high | critical
    "name": "Error-Based SQL Injection",
    "tags": ["sqli"],
    "url": "http://10.0.1.30/search?q=test",
    "attck_ids": ["T1190"],     # enriched by correlation
}
```

## Exit Codes

| Code | Meaning |
|------|---------|
| 0 | Scan completed — no critical findings |
| 1 | Findings detected — review report |
| 2 | Scan execution failure |
