GH05TCREW/pentestagent
PentestAgent (GhostCrew) is an LLM-powered pentesting agent with a TUI that runs single-shot, autonomous-agent, or multi-agent "crew" modes against a target, backed by built-in terminal/browser/notes tools and prebuilt black-box attack playbooks. It supports Docker/Kali images preloaded with nmap, Metasploit, sqlmap and hydra, exposes itself as an MCP server for external clients, and can spawn hierarchical child agents over MCP (with RAG-based tool selection) to delegate recon subtasks in parallel.
What it is
Concrete operational detail for PentestAgent (GhostCrew) beyond the catalog summary: the exact install path, the provider/relay configuration, the Docker image tags, and the mechanics of its self-spawning MCP child agents. Python 3.10+ and an OpenAI/Anthropic/LiteLLM key are required; the browser tool needs playwright install chromium.
How it works
Modes are driven by TUI slash-commands: /assist (single-shot), /agent (autonomous), /crew (multi-agent), /interact (guided). An agent can call the built-in spawn_mcp_agent tool to launch a child copy of itself as a subordinate MCP server over stdio — fully isolated runtime, LLM client, history, and notes. The child's entire tool set (run_task, run_task_async, await_tasks, get_task_result, etc.) is then injected back into the parent's available tools, enabling hierarchical delegation with no external orchestrator. When a spawned MCP server exposes more than 128 tools, PentestAgent auto-replaces the full catalogue with a single mcp_<server>_rag_optimizer meta-tool that selects by embedding similarity.
What to do
Run tools inside Docker for isolation and preinstalled tooling:
pentestagent tui --docker
# Kali image with metasploit, sqlmap, hydra, etc.
docker run -it --rm \
-e ANTHROPIC_API_KEY=your-key \
ghcr.io/gh05tcrew/pentestagent:kaliRun a prebuilt playbook non-interactively:
pentestagent run -t example.com --playbook thp3_webManage child agents manually from the TUI:
/spawn 10.0.1.1 --scope 10.0.1.0/24 --model claude-sonnet-4-20250514
/despawn child_agent_1
/mcp listCaveats
- The provider is arbitrary: setting
OPENAI_API_BASE/ANTHROPIC_API_BASEpoints the agent — and therefore all target data, tool output, and notes — at any OpenAI-compatible relay you name. Treat the relay as a data-egress boundary. - Child agents auto-name (
child_agent_1, …) and their tools appear on the next tool call, not immediately; collection is via explicitawait_taskswith atimeout_seconds. web_searchrequiresTAVILY_API_KEY; the browser tool requires the Chromium install step above.
Technologies named here
- PentestAgent
- Nmap
- Netcat
- curl
- Metasploit
- sqlmap
- hydra
- Docker
- LiteLLM
- MCP
- Playwright
- TAVILY_API_KEY web_search tool
- thp3_web playbook
- Pytest
- Black
- ruff
- Model Context Protocol
- Kali Linux
Techniques named here
- Autonomous agent task execution
- Multi-agent crew execution
- Hierarchical multi-agent delegation via spawn_mcp_agent
- Playbook-driven black-box security testing
- Async task recon pattern
- RAG-based tool retrieval
- Shadow Graph knowledge derivation
Related in Offensive Security