GreyDGL/PentestGPT
PentestGPT
AI-Powered Autonomous Penetration Testing Agent
Published at USENIX Security 2024
Research Paper
·
Report Bug
·
Request Feature
[!WARNING] PentestGPT is a research prototype only
PentestGPT is a research prototype that pioneered the use of GenAI in cybersecurity. Please be aware of third-party services claiming to offer paid PentestGPT products - the original project is free and open-source.
Demo
Installation
PentestGPT in Action
What’s New in v1.0 (Agentic Upgrade)
- Autonomous Agent - Agentic pipeline for intelligent, autonomous penetration testing
- Session Persistence - Save and resume penetration testing sessions
- Docker-First - Isolated, reproducible environment with security tools pre-installed
In Progress: Multi-model support for OpenAI, Gemini, and other LLM providers
Features
- AI-Powered Challenge Solver - Leverages LLM advanced reasoning to perform penetration testing and CTFs
- Live Walkthrough - Tracks steps in real-time as the agent works through challenges
- Multi-Category Support - Web, Crypto, Reversing, Forensics, PWN, Privilege Escalation
- Real-Time Feedback - Watch the AI work with live activity updates
- Extensible Architecture - Clean, modular design ready for future enhancements
Quick Start
Prerequisites
- Docker (required) - Install Docker
- LLM Provider (choose one):
- Anthropic API Key from console.anthropic.com
- Claude OAuth Login (requires Claude subscription)
- OpenRouter for alternative models at openrouter.ai
- Tutorial: Using Local Models with Claude Code
Installation
|
|
Note: The
--recurse-submodulesflag downloads the benchmark suite. If you already cloned without it, run:git submodule update --init --recursive
Try a Benchmark
|
|
Then connect into the container and run:
|
|
Commands Reference
| Command | Description |
|---|---|
make install |
Build the Docker image |
make config |
Configure API key (first-time setup) |
make connect |
Connect to container (main entry point) |
make stop |
Stop container (config persists) |
make clean-docker |
Remove everything including config |
Usage
|
|
Keyboard Shortcuts: F1 Help | Ctrl+P Pause/Resume | Ctrl+Q Quit
Using Local LLMs
PentestGPT supports routing requests to local LLM servers (LM Studio, Ollama, text-generation-webui, etc.) running on your host machine.
Prerequisites
- Local LLM server with an OpenAI-compatible API endpoint
- LM Studio: Enable server mode (default port 1234)
- Ollama: Run
ollama serve(default port 11434)
Setup
|
|
Customizing Models
Edit scripts/ccr-config-template.json to customize:
localLLM.api_base_url: Your LLM server URL (default:host.docker.internal:1234)localLLM.models: Available model names on your server- Router section: Which models handle which operations
| Route | Purpose | Default Model |
|---|---|---|
default |
General tasks | openai/gpt-oss-20b |
background |
Background operations | openai/gpt-oss-20b |
think |
Reasoning-heavy tasks | qwen/qwen3-coder-30b |
longContext |
Large context handling | qwen/qwen3-coder-30b |
webSearch |
Web search operations | openai/gpt-oss-20b |
Troubleshooting
- Connection refused: Ensure your LLM server is running and listening on the configured port
- Docker networking: Use
host.docker.internal(notlocalhost) to access host services from Docker - Check CCR logs: Inside the container, run
cat /tmp/ccr.log
Telemetry
PentestGPT collects anonymous usage data to help improve the tool. This data is sent to our Langfuse project and includes:
- Session metadata (target type, duration, completion status)
- Tool execution patterns (which tools are used, not the actual commands)
- Flag detection events (that a flag was found, not the flag content)
No sensitive data is collected - command outputs, credentials, or actual flag values are never transmitted.
Opting Out
|
|
Benchmarks
PentestGPT includes 100+ vulnerability challenges for testing and development.
|
|
Available Tags: sqli, xss, idor, ssti, ssrf, lfi, rce
Development
Prerequisites
- uv (required) - Python package manager:
curl -LsSf https://astral.sh/uv/install.sh | sh - Claude Code CLI - Configure with
claude loginorexport ANTHROPIC_API_KEY='your-key'
Local Development
|
|
Project Commands
|
|
Legacy Version
The previous multi-LLM version (v0.15) supporting OpenAI, Gemini, Deepseek, and Ollama is archived in legacy/:
|
|
Citation
If you use PentestGPT in your research, please cite our paper:
|
|
License
Distributed under the MIT License. See LICENSE.md for more information.
Disclaimer: This tool is for educational purposes and authorized security testing only. The authors do not condone any illegal use. Use at your own risk.
Contact
- Gelei Deng -
- gelei.deng@ntu.edu.sg
- Yi Liu - yi009@e.ntu.edu.sg
- Yuekang Li - yuekang.li@unsw.edu.au
- Víctor Mayoral Vilches -
- v.mayoralv@gmail.com
- Peng Liu - liu_peng@i2r.a-star.edu.sg
Acknowledgments
- Research supported by Quantstamp and NTU Singapore