AI penetration testing
$git clone https://github.com/gh05tcrew/pentestagentInstalls into the current project.
Install pentestagent by running `git clone https://github.com/gh05tcrew/pentestagent`, then use it for the current task and follow its documentation at https://github.com/gh05tcrew/pentestagent.
| 1 | <div align="center"> |
| 2 | |
| 3 | <img src="assets/pentestagent-logo.png" alt="PentestAgent Logo" width="220" style="margin-bottom: 20px;"/> |
| 4 | |
| 5 | # PentestAgent |
| 6 | ### AI Penetration Testing |
| 7 | |
| 8 | [](https://www.python.org/) [](LICENSE.txt) [](https://github.com/GH05TCREW/pentestagent/releases) [](https://github.com/GH05TCREW/pentestagent) [](https://github.com/GH05TCREW/pentestagent) |
| 9 | |
| 10 | </div> |
| 11 | |
| 12 | https://github.com/user-attachments/assets/a67db2b5-672a-43df-b709-149c8eaee975 |
| 13 | |
| 14 | ## Requirements |
| 15 | |
| 16 | - Python 3.10+ |
| 17 | - API key for OpenAI, Anthropic, or other LiteLLM-supported provider |
| 18 | |
| 19 | ## Install |
| 20 | |
| 21 | ```bash |
| 22 | # Clone |
| 23 | git clone https://github.com/GH05TCREW/pentestagent.git |
| 24 | cd pentestagent |
| 25 | |
| 26 | # Setup (creates venv, installs deps) |
| 27 | .\scripts\setup.ps1 # Windows |
| 28 | ./scripts/setup.sh # Linux/macOS |
| 29 | |
| 30 | # Or manual |
| 31 | python -m venv venv |
| 32 | .\venv\Scripts\Activate.ps1 # Windows |
| 33 | source venv/bin/activate # Linux/macOS |
| 34 | pip install -e ".[all]" |
| 35 | playwright install chromium # Required for browser tool |
| 36 | ``` |
| 37 | |
| 38 | ## Configure |
| 39 | |
| 40 | Create `.env` in the project root: |
| 41 | |
| 42 | ``` |
| 43 | ANTHROPIC_API_KEY=sk-ant-... |
| 44 | PENTESTAGENT_MODEL=claude-sonnet-4-20250514 |
| 45 | ``` |
| 46 | |
| 47 | Or for OpenAI: |
| 48 | |
| 49 | ``` |
| 50 | OPENAI_API_KEY=sk-... |
| 51 | PENTESTAGENT_MODEL=gpt-5 |
| 52 | ``` |
| 53 | |
| 54 | Any [LiteLLM-supported model](https://docs.litellm.ai/docs/providers) works. |
| 55 | |
| 56 | ### Using a relay / custom API base |
| 57 | |
| 58 | Point PentestAgent at any OpenAI-compatible endpoint via `OPENAI_API_BASE`: |
| 59 | |
| 60 | ```bash |
| 61 | OPENAI_API_KEY=your-relay-token |
| 62 | OPENAI_API_BASE=https://relay.example/v1 |
| 63 | PENTESTAGENT_MODEL=openai/<model-name-on-your-relay> |
| 64 | ``` |
| 65 | |
| 66 | For Anthropic-compatible endpoints use `ANTHROPIC_API_BASE` instead. |
| 67 | See `.env.example` for full provider notes and embedding options. |
| 68 | |
| 69 | ## Run |
| 70 | |
| 71 | ```bash |
| 72 | pentestagent # Launch TUI |
| 73 | pentestagent -t 192.168.1.1 # Launch with target |
| 74 | pentestagent tui --docker # Run tools in Docker container |
| 75 | ``` |
| 76 | |
| 77 | ## Docker |
| 78 | |
| 79 | Run tools inside a Docker container for isolation and pre-installed pentesting tools. |
| 80 | |
| 81 | ### Option 1: Pull pre-built image (fastest) |
| 82 | |
| 83 | ```bash |
| 84 | # Base image with nmap, netcat, curl |
| 85 | docker run -it --rm \ |
| 86 | -e ANTHROPIC_API_KEY=your-key \ |
| 87 | -e PENTESTAGENT_MODEL=claude-sonnet-4-20250514 \ |
| 88 | ghcr.io/gh05tcrew/pentestagent:latest |
| 89 | |
| 90 | # Kali image with metasploit, sqlmap, hydra, etc. |
| 91 | docker run -it --rm \ |
| 92 | -e ANTHROPIC_API_KEY=your-key \ |
| 93 | ghcr.io/gh05tcrew/pentestagent:kali |
| 94 | ``` |
| 95 | |
| 96 | ### Option 2: Build locally |
| 97 | |
| 98 | ```bash |
| 99 | # Build |
| 100 | docker compose build |
| 101 | |
| 102 | # Run |
| 103 | docker compose run --rm pentestagent |
| 104 | |
| 105 | # Or with Kali |
| 106 | docker compose --profile kali build |
| 107 | docker compose --profile kali run --rm pentestagent-kali |
| 108 | ``` |
| 109 | |
| 110 | The container runs PentestAgent with access to Linux pentesting tools. The agent can use `nmap`, `msfconsole`, `sqlmap`, etc. directly via the terminal tool. |
| 111 | |
| 112 | Requires Docker to be installed and running. |
| 113 | |
| 114 | ## Modes |
| 115 | |
| 116 | PentestAgent has three modes, accessible via commands in the TUI: |
| 117 | |
| 118 | | Mode | Command | Description | |
| 119 | |------|---------|-------------| |
| 120 | | Assist | `/assist <task>` | One single-shot instruction, with tool execution | |
| 121 | | Agent | `/agent <task>` | Autonomous execution of a single task | |
| 122 | | Crew | `/crew <task>` | Multi-agent mode. Orchestrator spawns specialized workers | |
| 123 | | Interact | `/interact <task>` | Interactive mode. Chat with the agent, it will help you and guide during the pentesting procedure | |
| 124 | |
| 125 | ### TUI Commands |
| 126 | |
| 127 | ``` |
| 128 | /assist <task> One single-shot instruction. |
| 129 | /agent <task> Run autonomous agent on task |
| 130 | /crew <task> Run multi-agent crew on task |
| 131 | /interact <task> Chat with the agent in guided mode |
| 132 | /target <host> Set target |
| 133 | /tools List available tools |
| 134 | /notes Show saved notes |
| 135 | /report Generate report from session |
| 136 | /memory Show token/memory usage |
| 137 | /prompt |