You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An AI-powered penetration testing agent that connects to a Kali/Parrot attack
box via SSH, runs security tools autonomously, analyses output, plans next steps,
stores credentials for reuse, spawns parallel subagents, sprays credentials across
services, builds MITRE ATT&CK attack graphs, validates findings through a 6-stage
pipeline, scores exploits by risk priority, correlates findings across tools,
maintains a persistent Pentest Task Tree (PTT) as durable memory, and documents
findings.
Cross-tool dedup by host+port+CVE, confidence boosting (50%→80%→95%)
TaskTree
Pentest Task Tree (PTT)
Thread-safe hierarchical plan (todo/in_progress/done/blocked/skipped); summary_for_prompt() re-injected every turn; to_list()/from_list() for session persistence
Recon Pipelines
Key
Tools Chained
full
nmap → whatweb → wafw00f → nikto → ffuf → nuclei
quick
nmap → whatweb → ffuf
subdomain
subfinder → httpx
stealth
nmap (slow SYN) → whatweb
Defined in ReconPipeline.PIPELINES dict. Each entry is a list of (tool_name, cmd_template) tuples with {target} placeholder.
Methodology Playbooks
Key
Name
webapp
Web Application Pentest
network
Network Penetration Test
api
API Security Assessment
ad
Active Directory Assessment
cloud
Cloud Security Assessment
Defined in PLAYBOOKS dict. Each entry has name and prompt (structured methodology text).
The system prompt dynamically injects context from all 17 supporting systems:
the Pentest Task Tree (the plan), credential vault, shells, subagents, listeners,
tool status, progress, stealth, attack graph, validation pipeline, exploit
analysis, finding correlation, findings. The task tree is re-injected every turn,
so the plan survives conversation-history trimming (MAX_HISTORY_MESSAGES).
Safety Controls
DANGEROUS_PATTERNS — 13 regex patterns for destructive commands
is_dangerous() → request_approval() user prompt
--auto-approve flag bypasses approval
truncate_output() caps tool output at 15K chars
MAX_HISTORY_MESSAGES = 60 for conversation trimming — the Pentest Task Tree is
re-injected every turn so the plan is not lost when old messages are dropped
Stealth mode auto-applies evasion flags to 9 tools
JSON session includes: session_id, target, scope, objective, findings[],
credentials[], attack_graph[], task_tree[], command_history[],
total_iterations, message_count. On --load-session, both findings[] and
task_tree[] are restored.
Development Guidelines
Adding a New Agent Tool
Add tool schema dict to AGENT_TOOLS_SCHEMA
Create handle_<tool_name>() function in Tool Handlers section
Add dispatch case in PentestAgent._handle_tool()
If stateful, add context to build_system_prompt()
Optionally add a /command in CLI section
Adding a New Recon Pipeline
Add entry to ReconPipeline.PIPELINES dict
Update the run_recon_pipeline tool's enum list
Adding a New Playbook
Add entry to PLAYBOOKS dict (key, name, prompt)
Update the use_playbook tool's enum list
Adding a New Phalanx Scanner
Add entry to PHALANX_SCANNERS dict
Include command (with {target} placeholder), repo, file, description
Adding a New Kill Chain Stage
Add tuple to KILL_CHAIN_STAGES list
Update the add_attack_step tool's enum list
Testing
tests/test_task_tree.py covers the PTT (data model, handler, prompt injection)
with no LLM/network/target needed. Run: PYTHONPATH=. python -m pytest tests/ -q.
run_demo.py stubs anthropic/openai/paramiko and emits a sample report —
a quick smoke test that import + serialization still work.
Conventions
Single-file architecture — entire agent in one .py file
Pentest Task Tree (PTT) — persistent externalized plan surviving history trimming; manage_tasks tool, /tasks view, session persistence; first unit tests