PenTest MCP Server
🏗️ Architektur
┌──────────────────────────────────────────────────────────┐
│ $ pentest ask --query "scan for SQLi and XSS" \ │
│ --target http://localhost:3000 --consent │
└──────────────────┬───────────────────────────────────────┘
│ Direct Python execution
▼
┌──────────────────────────────────────────────────────────┐
│ GEMINI-POWERED AGENT (Python) │
│ │
│ Phase 1: PLAN → LLM selects tools from query │
│ Phase 2: EXECUTE → Runs tools, collects findings │
│ Phase 3: REPORT → LLM generates professional report │
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌────────────────┐ │
│ │ Session │ │ Scan Mode │ │ Tool │ │
│ │ Manager │ │ Orchestrator│ │ Registry │ │
│ └─────────────┘ └──────┬───────┘ └────────────────┘ │
│ │ │
│ ┌────────────────┼────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌────────────┐ ┌────────────┐ ┌────────────────┐ │
│ │ nmap │ │ sqlmap │ │ ffuf │ │
│ │ nuclei │ │ dalfox │ │ nikto │ │
│ │ sslyze │ │ commix │ │ gobuster │ │
│ │ wafw00f │ │ arjun │ │ subfinder │ │
│ │ ... 30+ │ │ ... │ │ ... │ │
│ └────────────┘ └────────────┘ └────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────┐ │
│ │ GEMINI API │ │
│ │ (Flash Lite) │ │
│ │ Triage · Analysis │ │
│ │ CVSS · Reporting │ │
│ └──────────────────────┘ │
└──────────────────────────────────────────────────────────┘Related MCP server: Pentest-mcp
✨ Funktionen
Funktion | Beschreibung |
Natürliche Sprachschnittstelle | Stellen Sie Sicherheitsfragen in einfachem Englisch — die KI wählt die passenden Tools aus und führt sie aus |
3 Scan-Modi | Schnell (5-10 Min.), Mittel (15-30 Min.), Umfangreich (45+ Min.) — jeder mit unterschiedlicher Tiefe und KI-Analyse |
30+ Sicherheitstools | nmap, sqlmap, nuclei, ffuf, dalfox, nikto, wafw00f, subfinder, sslyze und mehr |
KI-gestützte Analyse | Gemini KI (Flash Lite) führt Schwachstellen-Triage und CVSS-Bewertung durch und erstellt Management-Berichte |
Automatisierte Tool-Auswahl |
|
Sitzungsverwaltung | Verfolgen, pausieren und fortsetzen Sie Sicherheitsbewertungen über mehrere Ziele hinweg |
OWASP Top 10 Abdeckung | Systematische Scans, die den OWASP 2021 Kategorien zugeordnet sind |
Intelligente Fallbacks | Wenn ein professionelles Tool nicht installiert ist, schließen Python-native Implementierungen die Lücke |
📋 Inhaltsverzeichnis
🚀 Schnellstart
Voraussetzungen
Python 3.11+
uv (Python Paketmanager)
Gemini API Key (kostenlose Stufe verfügbar)
1. Klonen & Installieren
git clone https://github.com/yourusername/pentest-ai-cli
cd pentest-ai-cli
# Install dependencies
uv sync2. Umgebung konfigurieren
cp .env.example .envBearbeiten Sie .env und fügen Sie Ihren Gemini API-Schlüssel hinzu:
GEMINI_API_KEY=your_gemini_api_key_here3. Sicherheitstools installieren (Optional)
Der Server funktioniert mit Python-nativen Fallbacks, aber für Scans auf professionellem Niveau installieren Sie die externen Tools:
# macOS (Homebrew)
brew install nmap sqlmap
# Install ffuf (Go-based fuzzer)
go install github.com/ffuf/ffuf/v2@latest
# Install nuclei (vulnerability scanner)
go install github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
# Install subfinder (subdomain discovery)
go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latestTipp: Führen Sie
session_initaus, um zu sehen, welche Tools auf Ihrem System erkannt werden.
4. Scan starten!
pentest ask \
--query "run a quick security scan" \
--target https://example.com \
--consent🎯 Scan-Modi
Schnell-Modus (5-10 Minuten)
Schnelle Triage für eine sofortige Risikobewertung.
Test | Tool |
WAF-Erkennung | wafw00f / custom |
DNS-Enumeration | dnsrecon / custom |
Port-Scan (Top 20) | nmap / custom |
Header-Analyse | custom |
TLS/SSL-Audit | sslyze / custom |
Tech-Fingerprinting | whatweb / custom |
Suche nach sensiblen Dateien | ffuf / custom |
Mittel-Modus (15-30 Minuten)
Standard-Penetrationstest, der die OWASP Top 10 abdeckt.
Test | Tool |
Alles aus Schnell | — |
Port-Scan (Top 100) | nmap |
XSS-Scan | dalfox / custom |
SQL-Injection | sqlmap |
Verzeichnissuche | ffuf / gobuster |
CORS-Fehlkonfiguration | corscanner / custom |
Pfad-Traversal | custom |
Open Redirect | custom |
CSRF-Prüfungen | custom |
Umfangreicher Modus (45+ Minuten)
Umfassende Sicherheitsbewertung auf Management-Ebene.
Test | Tool |
Alles aus Mittel | — |
Port-Scan (Top 1000) | nmap / masscan |
Subdomain-Enumeration | subfinder / amass |
Erweitertes Fuzzing | wfuzz / ffuf |
SSRF-Probing | custom |
Secret-Scanning | trufflehog |
Git-Exposition | git-dumper |
JWT-Analyse | jwt_tool |
GraphQL-Sicherheit | graphql-cop |
Command-Injection | commix |
🔧 Unterstützte Tools
Der Server integriert 30+ Sicherheitstools mit automatischer Erkennung. Wenn ein Tool nicht installiert ist, stellen Python-native Fallbacks sicher, dass der Scan dennoch ausgeführt wird.
Tool | Kategorie | Erforderlich |
nmap | Port-Scanning | Optional (hat Fallback) |
sqlmap | SQL-Injection | Optional |
ffuf | Fuzzing / Dateisuche | Optional (hat Fallback) |
nuclei | Schwachstellen-Scan | Optional |
dalfox | XSS-Scan | Optional |
subfinder | Subdomain-Suche | Optional |
wafw00f | WAF-Erkennung | Optional (hat Fallback) |
sslyze | TLS/SSL-Audit | Optional (hat Fallback) |
nikto | Webserver-Scan | Optional |
gobuster | Verzeichnis-Brute-Force | Optional |
whatweb | Tech-Fingerprinting | Optional (hat Fallback) |
wfuzz | Erweitertes Fuzzing | Optional |
arjun | Suche nach versteckten Parametern | Optional |
testssl | SSL/TLS-Test | Optional |
masscan | Schnelles Port-Scanning | Optional |
amass | OSINT / Subdomain-Enum | Optional |
dnsrecon | DNS-Enumeration | Optional (hat Fallback) |
theHarvester | E-Mail/Domain OSINT | Optional |
retire.js | JS-Bibliothek CVE-Scan | Optional |
trufflehog | Secret-Erkennung | Optional |
git-dumper | Git-Repo-Exposition | Optional |
commix | Command-Injection | Optional |
corscanner | CORS-Fehlkonfiguration | Optional (hat Fallback) |
jwt_tool | JWT-Analyse | Optional |
graphql-cop | GraphQL-Sicherheit | Optional |
xsstrike | Erweitertes XSS | Optional |
hydra | Brute-Force | Optional |
shodan | Internet-Intelligenz | Optional |
enum4linux-ng | SMB-Enumeration | Optional |
💬 Anwendungsbeispiele
Der pentest ask Befehl verwendet Gemini KI, um Sicherheits-Scans basierend auf Anfragen in natürlicher Sprache automatisch zu planen und auszuführen.
Schneller Schwachstellen-Scan
pentest ask \
--query "scan for SQL injection and XSS vulnerabilities" \
--target http://localhost:3000 \
--consentVollständiges OWASP Top 10 Audit
pentest ask \
--query "perform a comprehensive OWASP Top 10 security audit" \
--target https://example.com \
--consentNur Aufklärung (Reconnaissance)
pentest ask \
--query "enumerate subdomains and check for exposed sensitive files" \
--target example.com \
--consentBenutzerdefinierter Berichtspfad
pentest ask \
--query "check security headers and TLS configuration" \
--target https://example.com \
--consent \
--output security-audit-2024.md📖 Vollständige Dokumentation: Siehe CLI_USAGE_GUIDE.md für detaillierte Anleitungen, Beispiele und Fehlerbehebung.
📁 Projektstruktur
pentest-ai/
├── pentest_mcp/
│ ├── scan_modes.py # Quick/Medium/Extensive scan orchestration
│ ├── agent.py # Standalone CLI orchestrator
│ ├── session.py # Session state management
│ ├── models.py # Pydantic data models
│ ├── config.py # Environment & settings
│ ├── cli.py # CLI interface (includes "ask" command)
│ ├── cli_ui.py # Beautiful CLI UI components
│ ├── tools/
│ │ ├── __init__.py # Python-native security tools
│ │ ├── professional.py # External tool wrappers (nmap, sqlmap, etc.)
│ │ └── tool_registry.py # Tool execution and result processing
│ └── utils/
│ └── sanitizer.py # Input validation & sanitization
├── tests/
│ └── test_system.py # System tests
├── wordlists/ # Fuzzing wordlists for ffuf/gobuster
├── reports/ # Generated scan reports (Markdown)
├── CLI_USAGE_GUIDE.md # Example prompts and detailed usage guide
├── pyproject.toml # Project dependencies & metadata
├── Makefile # Development shortcuts
├── install_tools.sh # Security tool installer script
└── .env.example # Environment variable template⚙️ Konfiguration
Umgebungsvariablen
Variable | Beschreibung | Standard |
| Ihr Gemini API-Schlüssel | Erforderlich |
| LLM-Modell für die Analyse |
|
| Maximale Antwort-Token |
|
| LLM-Temperatur |
|
| Pfad zur Sitzungsspeicherung |
|
| Protokollierungs-Ausführlichkeit |
|
| Maximale Tools pro |
|
KI-Analyse-Pipeline
Jeder Scan-Modus verwendet eigene Gemini KI-Prompts, die auf die Scan-Tiefe kalibriert sind:
Schnell: Prägnante Triage — konzentriert sich nur auf kritische/hochgradige Funde
Mittel: OWASP Top 10 Analyse mit ausgewogener Risikobewertung und Behebungsvorschlägen
Umfangreich: Zusammenfassung auf Management-Ebene mit erschöpfenden CVSS-bewerteten Funden, Compliance-Zuordnung und strategischen Empfehlungen
🔍 Fehlerbehebung
Read-only file system Fehler
Berichte werden unter <project_root>/reports/ gespeichert. Stellen Sie sicher, dass das Projektverzeichnis beschreibbar ist.
Gemini API Fehler
Überprüfen Sie Ihren API-Schlüssel:
echo $GEMINI_API_KEYÜberprüfen Sie die Ratenbegrenzungen unter aistudio.google.com
Der Server setzt den Scan auch dann fort, wenn Gemini nicht verfügbar ist — die rohe Tool-Ausgabe wird weiterhin zurückgegeben
Tools nicht erkannt
Installieren Sie fehlende Tools über Homebrew oder Ihren Paketmanager. Python-Fallbacks decken die Kernfunktionalität auch ohne externe Tools ab.
⚠️ Sicherheitshinweis
Dieses Tool ist nur für autorisierte Sicherheitstests bestimmt.
Holen Sie immer eine ausdrückliche schriftliche Genehmigung ein, bevor Sie ein Ziel scannen
Nicht autorisierte Tests verstoßen gegen den Computer Fraud and Abuse Act (CFAA), das IT Act 2000/2008 und ähnliche Gesetze weltweit
Der Parameter
consent_confirmeddient als ethische Sicherheitsmaßnahme — umgehen Sie ihn niemalsCommitten Sie niemals API-Schlüssel in die Versionskontrolle
📝 Lizenz
Siehe LICENSE für Details.
Available Tools
29 toolsamassD
Advanced subdomain enumeration
Inputs: domain (required), session_id (required).
arjunD
HTTP parameter discovery
Inputs: url (required), session_id (required).
commixC
Command injection vulnerability scanner
Inputs: url (required), session_id (required).
corscannerC
CORS misconfiguration scanner
Inputs: url (required), session_id (required).
dalfoxD
XSS vulnerability scanner
Inputs: url (required), session_id (required), params, consent.
dnsreconC
DNS enumeration and reconnaissance
Inputs: domain (required), session_id (required).
extensive_scanA
Comprehensive scan (20-45 min): WAF detection, full recon, top-1000 port scan, tech fingerprinting, TLS audit, directory discovery, XSS, SQLi, CSRF, sensitive file discovery
Inputs: target (required), consent (required).
ffufC
Fast web fuzzer for directory/file discovery
Inputs: url (required), session_id (required), mode, consent.
get_reportC
Generate final security assessment report
Inputs: session_id (required).
git_dumperC
Exposed .git directory dumper
Inputs: url (required), session_id (required).
gobusterC
Directory/file brute forcing
Inputs: url (required), session_id (required), mode.
graphql_copC
GraphQL security scanner
Inputs: url (required), session_id (required).
init_sessionC
Initialize new security assessment session
Inputs: target (required).
jwt_toolC
JWT security testing
Inputs: token (required), session_id (required), url.
masscanC
Fast port scanner
Inputs: target (required), session_id (required), ports.
niktoC
Web server vulnerability scanner
Inputs: url (required), session_id (required), consent.
nmapC
Port scanning and service detection
Inputs: host (required), session_id (required), ports, consent.
nucleiC
Fast vulnerability scanner with templates
Inputs: url (required), session_id (required).
quick_scanB
Fast triage scan (10-15 min): WAF detection, subdomain enum, top-port scan, header analysis, TLS audit, tech fingerprinting, sensitive file discovery, SSRF probe, CSRF check
Inputs: target (required), consent (required).
retireC
JavaScript library vulnerability scanner
Inputs: url (required), session_id (required).
sqlmapC
SQL injection detection and exploitation
Inputs: url (required), session_id (required), params, consent.
sslyzeC
TLS/SSL configuration analyzer
Inputs: host (required), session_id (required), port, consent.
subfinderC
Passive subdomain enumeration
Inputs: domain (required), session_id (required), consent.
testsslC
TLS/SSL security testing
Inputs: host (required), session_id (required), port.
theharvesterD
OSINT gathering from public sources
Inputs: domain (required), session_id (required).
trufflehogC
Secret and credential scanner
Inputs: target (required), session_id (required), scan_type.
wafw00fD
Web Application Firewall detection
Inputs: url (required), session_id (required).
wfuzzC
Web application fuzzer
Inputs: url (required), session_id (required), fuzz_param.
whatwebC
Web technology fingerprinting
Inputs: url (required), session_id (required), consent.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
Most tools have distinct purposes (e.g., sqlmap vs nmap), but some overlap exists between masscan and nmap for port scanning, and multiple fuzzing tools like ffuf, wfuzz, and gobuster may cause confusion for an agent. Descriptions help differentiate but are not entirely unambiguous.
Tool names are consistently lowercase with underscores for multi-word names, but they do not follow a strict verb_noun pattern. Some are single words (e.g., amass, nikto) while others are compound (e.g., git_dumper, jwt_tool), which is consistent but not highly patterned.
With 29 tools, the server covers a broad range of penetration testing tasks, which is appropriate for a comprehensive tool set. While on the higher end, the count is justified by the diversity of functionality and does not feel excessive.
The tool set covers most key areas of penetration testing: reconnaissance, scanning, web fuzzing, vulnerability detection, and reporting. However, it lacks network vulnerability scanners (e.g., OpenVAS) and exploitation tools, leaving minor gaps. The inclusion of quick_scan and extensive_scan helps cover comprehensive workflows.
Maintenance
Related MCP Connectors
AI pentesting: run scans, triage vulnerabilities, review PRs, manage schedules and assets.
Governed security assessments, findings and signed reports for your domains, from your AI agent.
Pay-per-call cybersecurity for AI agents: vuln scans, threat intel, compliance, code security.
Security scanner for AI agents and MCP servers: injection, jailbreak, tool abuse.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that integrates various penetration testing tools, enabling security professionals to perform reconnaissance, vulnerability scanning, and API testing through natural language commands in compatible LLM clients like Claude Desktop.7-
- FlicenseNot gradedqualityDmaintenanceUnified penetration testing MCP server for Claude Desktop providing 34 security tools for reconnaissance, web scanning, code analysis, and authenticated testing.1-
- FlicenseNot gradedqualityDmaintenanceAI-powered Attack Surface Intelligence server that exposes industry-standard penetration testing tools via MCP, enabling AI agents to perform comprehensive security assessments.3-
- AlicenseNot gradedqualityDmaintenanceAI-driven penetration testing MCP server that equips Claude with 13 tools for automated reconnaissance, analysis, vulnerability validation, and exploitation.4GPL 3.0