Pentest‑AI: One‑Command, Fully Automated Penetration Testing in 4 Minutes
Pentest‑AI is an MIT‑licensed, locally‑run framework that automates reconnaissance, authentication, vulnerability chaining, PoC validation, and report generation for web, AD, cloud, and more, delivering a client‑ready Markdown/HTML/PDF/SARIF report in about four minutes with a single command.
Project Overview
Pentest‑AI is an AI‑driven autonomous penetration‑testing framework. It runs recon, logs into the target application, chains discovered vulnerabilities into multi‑step attack paths, validates each finding with a non‑destructive proof‑of‑concept, generates Sigma/SPL/KQL detection rules, and emits a client‑ready report in Markdown, HTML, PDF, SARIF, or JUnit format.
Key Features
10 autonomous agents covering recon, web‑app testing, Active Directory, cloud security, vulnerability chaining, PoC validation, detection‑rule generation, and report output.
Authentication session maintenance so downstream tools inherit cookies.
Credential references only (environment variables, 1Password path, Vault ARN); passwords never appear in shell history or LLM context.
Non‑destructive PoC validation for every finding.
YAML playbooks encode penetration‑testing methodology and are version‑controlled via Git.
Diff mode ( ptai retest <id>) compares old and new results, enabling fix‑retest‑confirm in a single step.
CI‑native support: GitHub Action template, SARIF output, severity gate.
LLM red‑team module with 80+ probes for OWASP LLM Top 10.
MCP server integrating 35+ tools (Claude Code, Cursor, Copilot) controllable via natural language.
Fully local execution under the MIT license; can run offline with Ollama.
Installation & Usage
Install with a single pip command: pip install ptai The first run automatically installs required tools (nmap, nuclei, ffuf, sqlmap, gobuster, etc.).
Basic scan: ptai start https://your-target.com Authenticated scan example (credential reference stored, not in plain text):
# Add authentication profile
ptai auth profile add staging-acme
# Start scan with auth
ptai start https://staging.acme.com --auth-profile staging-acmeSample output (excerpt):
[+] engagement eng-e512f47b target=staging.acme.com scope=web
[auth] ✓ Logged in as admin. Session captured, refresh in 14:32.
[recon] ✓ 3 open ports, 7 subdomains, Apache/PHP fingerprint.
[web] ✓ 21 findings behind auth. 3 SQLi, 4 XSS, missing CSP, CSRF gap.
[chain] ✓ Attack path found in 2 hops:
reflected XSS + cookie without Secure flag → admin session hijack
[validate] ✓ 3 findings proven with non‑destructive PoCs.
[detect] ✓ Generated Sigma, SPL, KQL rules for the blue team.
[report] ✓ reports/eng-e512f47b.html · 12 pages · client‑ready
Total: 4m 18s. Cost: $0.73 in Claude tokens.Technical Architecture
The workflow is a directed graph:
ptai start <target>
└─────────────────────────────────────────────────────────────┘
┌──────────────────┼──────────────────┐
▼ ▼ ▼
┌───────┐ ┌───────┐ ┌───────┐
│ recon │ → │ auth │ → │ web │
└───────┘ └───────┘ └───────┘
│ │
│ ┌────────────────────────────────────┐
▼ ▼ ▼
┌───────┐ ┌───────┐
│ ad │ ┌──────────────────┐ │ cloud │
└───────┘ │ Findings DB │ └───────┘
│ (SQLite + scope guard + dedup) │
└──────────────────────────────────┘
┌─────────────────┼─────────────────┐
▼ ▼ ▼
┌───────┐ ┌─────────┐ ┌──────────┐
│ chain │ │ validate│ │ detect │
└───────┘ └─────────┘ └──────────┘
│
▼
┌──────────┐
│ report │ md·html·pdf·SARIF·JUnit
└──────────┘Supported Scenarios
AppSec teams: CI/CD integration via GitHub Actions, automatic fail‑on‑high, SARIF upload.
Pentest engineers: encode AD penetration methodology as YAML playbooks, share and version‑control.
Bug bounty hunters: run a single command overnight and obtain a PoC‑validated vulnerability list ready for HackerOne.
Red teams: standardize custom AD attack paths as reusable playbooks.
AI feature testing: LLM red‑team mode detects prompt injection, jailbreak, and OWASP LLM Top 10 issues with built‑in probes.
Toolchain Scale
200+ tool wrappers (nmap, masscan, nuclei, ffuf, sqlmap, gobuster, wapiti, nikto, dalfox, xsstrike, enum4linux, bloodhound‑python, impacket suite, trufflehog, gitleaks, kube‑hunter, trivy, …).
4000+ Nuclei templates covering web, network, cloud, and CVE‑specific checks.
35+ MCP tools integrating AI assistants such as Claude Code and Cursor.
300+ LLM models (Anthropic, OpenAI, Ollama, Azure, OpenRouter, DeepSeek, Groq, Mistral, Together AI, Bedrock, Vertex AI, Cohere, …).
Comparison with Other Tools
Feature | Pentest‑AI | Sn1per | Nuclei | Burp Pro | PentestGPT
-----------------------|------------|--------|--------|----------|-----------
Autonomous Agent Loop | ✅ | ❌ | ❌ | ❌ | ❌
Authenticated Scan | ✅ | Partial| Raw HTTP| ✅ | ❌
Vulnerability Chaining| ✅ | Partial| ❌ | ❌ | ❌
PoC Validation | ✅ | Partial| ❌ | ❌ | ❌
Diff / Retest | ✅ | ❌ | ❌ | ❌ | ❌
CI‑native (SARIF+Gate)| ✅ | ❌ | Partial| ❌ | ❌
LLM Red‑Team | ✅ | ❌ | ❌ | ❌ | ❌
YAML Playbook | ✅ | ❌ | Template| ❌ | ❌
MCP Server | ✅ | ❌ | ❌ | ❌ | ❌
License | MIT | GPL | MIT | Commercial| MITUsage Notes
⚠️ Disclaimer: Pentest‑AI is intended for authorized testing only. Scope files reject out‑of‑scope hosts. PoCs are non‑destructive and rate‑limiting enables stealth mode. Obtain written permission before testing any non‑owned target.
Conclusion
Pentest‑AI eliminates repetitive glue work for penetration‑testing engineers. A single command can produce a complete, PoC‑validated report with detection rules and attack‑path analysis in about four minutes.
Applicable audiences include AppSec engineers, penetration‑testing consultants, bug‑bounty hunters, red‑team members, and product‑security testers who need AI‑enhanced automation.
Source code: https://github.com/0xSteph/pentest-ai
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Black & White Path
We are the beacon of the cyber world, a stepping stone on the road to security.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
