Gabson0x/pentdem
pentdem is an autonomous AI-powered pentesting CLI/pipeline that fans out 15+ vulnerability-class hunters (XSS, SQLi, SSRF, IDOR, SSTI, JWT, GraphQL, etc.) and 8 advanced attack skills (mass assignment, race conditions, cloud metadata, OAuth/OIDC, subdomain takeover, credential harvesting) in parallel, using an LLM to adapt strategy mid-scan. It wraps real tools (nmap, sqlmap, nuclei, ffuf, subfinder, httpx) in Docker isolation and adds a novel gate chain — quality gate, kill-chain builder, adversarial cross-model validation (a second model tries to disprove each finding), a capability execution ledger (proves each hunter actually ran instead of silently crashing), and a ship-discipline gate — before mapping surviving findings to MITRE ATT&CK/OWASP Top 10/CVSS and generating reports.
What it is
pentdem (Gabson0x/pentdem) is a CLI-driven autonomous pentesting orchestrator. The default agent engine runs an AutonomousAgent with 34 tools, LLM analysis, and a WAF-bypass engine; a legacy pipeline engine runs parallel vuln-class hunting. Findings from both merge, then pass through Quality Gate → Adversarial Validation → Ship Gate → kill-chain → compliance mapper → report. It requires Python 3.11+, free-tier API keys from GLM (open.bigmodel.cn) and Featherless (featherless.ai), and optionally Docker to sandbox sqlmap, nuclei, and nmap.
How it works — the three gates
The page's substance is the semantics of the three newer gates, which the summary names but does not explain:
- Adversarial validation hands each finding to a different model family than produced it, with the single instruction "refute it." It hunts benign readings (reflected-but-escaped, a 200 that is really a login page, an id returning public data, SSRF inside the app's own trust boundary). A finding is dropped only on a confident refutation; transport or parse errors fail open so a human still sees it.
- Capability ledger exists because hunts fan out with
asyncio.gather(..., return_exceptions=True)and each advanced skill is wrapped inexcept: return []— so a crashed class looks identical to a class that found nothing. The ledger records per-capability evidence recomputed from what happened (URLs probed, probes returned vs errored, whether the coroutine raised), never a self-reported flag. Missing execution setscoverage_complete = falseand the report says so. - Ship gate reads
--platformand buckets findings into report / informational / duplicate (duplicates tracked in a per-target ledger). Onlyreportfindings enter the vulnerability section.
What to do
git clone <repo>
cd pentdem
pip install -e .
cp .env.example .env # add GLM + Featherless keys
pentdem example.com --mock # dry run, no API calls
pentdem example.com --mode quick
pentdem example.com --docker --mode full # recommended
pentdem example.com --mode targeted # IDOR, SSRF, XSS, SQLi onlyUse --mock first to exercise the pipeline without spending API calls, and --docker to keep sqlmap/nuclei/nmap off the host.
Caveats
- Fail-open by design: adversarial validation passes on transport/parse errors, and the older validate step "even passes on timeout." Surviving a finding does not mean it was actively confirmed — only that nothing confidently refuted it.
- A "0 findings" or clean result is only trustworthy when
coverage_completeis true; otherwise the run carries coverage debt from a capability that never ran. - This is an autonomous attack tool that runs real scanners against a named target — only point it at systems you are authorized to test.
Technologies named here
Techniques named here
- IDOR
- SSRF
- Cross-site scripting
- SQLi
- Auth bypass
- SSTI
- Open redirect
- Local file inclusion
- Command injection
- NoSQLi
- GraphQL
- JWT Attack Suite
- Deserialization
- Path traversal
- Race Condition
- Subdomain takeover
- API Discovery
- Mass assignment
- Cloud Metadata Exploitation
- Credential harvesting
- OAuth/OIDC Attacks
- Multi-Stage Chains
- WAF Fingerprinting & Auto-Bypass
- Adversarial Cross-Model Validation
- Deep Exploration
- Session Bypass
Related in Offensive Security