PentestGPT

Security & Safety 💻 Python ⚖️ MIT 🟡 Quiet lately
15.2k stars

PentestGPT is an AI-powered autonomous penetration testing agent that uses large language models to perform penetration testing and capture-the-flag (CTF) challenges. It solves the problem of manual, time-consuming security assessments by automating multi-stage pipelines. It is for security professionals, ethical hackers, and CTF enthusiasts.

PentestGPT Installation - AI-Powered Penetration Testing Agent Setup

🎬 PentestGPT Installation - AI-Powered Penetration Testing Agent Setup · Gelei Deng

✨ Key features

  • AI-powered challenge solver for pentesting and CTFs
  • Multi-stage pipeline: recon, exploit, walkthrough for CTF
  • Autonomous agent drives Claude Code or Codex
  • Session persistence to save and resume tests
  • Interactive legacy mode supports multiple LLM providers
  • Live walkthrough with real-time activity updates

🎯 Use cases

  • Automate penetration testing of web applications and networks
  • Solve CTF challenges across web, crypto, reversing, forensics, PWN
  • Perform asset discovery and vulnerability identification for pentests
  • Generate penetration testing reports automatically
  • Practice and learn penetration testing with AI guidance

📦 Installation

🧰 Requirements: Python 3.12+, uv package manager, and either Claude Code CLI or Codex CLI installed and authenticated for autonomous mode; for legacy mode, API keys for desired LLM providers.

git clone https://github.com/GreyDGL/PentestGPT.git
cd PentestGPT
make install    # runs uv sync

🚀 Usage

Run against a target (CTF mode by default)
pentestgpt --target 10.10.11.234
With challenge context
pentestgpt --target 10.10.11.50 --instruction "WordPress site, focus on plugin vulnerabilities"
Penetration-test mode (asset discovery → vulnerabilities → report)
pentestgpt --target 10.10.11.234 --mode pentest
List previously saved sessions
pentestgpt --list-sessions

⚠️ Good to know

The tool is for educational and authorized testing only; the 86.5% success rate is a historical research result and not a current regression guarantee.

❓ FAQ

What are the prerequisites for using PentestGPT?

You need Python 3.12+, uv, and either Claude Code CLI or Codex CLI installed and authenticated for autonomous mode. For legacy mode, you need API keys for the LLM providers you want to use.

Can I use PentestGPT with local LLMs?

Yes, the legacy mode supports local Ollama models via an OpenAI-compatible endpoint, e.g., using --reasoning-model ollama:qwen3 --base-url http://localhost:11434/v1.

Does PentestGPT collect any sensitive data?

No, it collects anonymous usage data like session metadata and tool execution patterns, but never command outputs, credentials, or actual flag values. You can opt out with --no-telemetry or setting LANGFUSE_ENABLED=false.

How do I run PentestGPT in Docker?

Build the image with make docker-build, log in once with make docker-login, then run with make docker-run TARGET=... BACKEND=... MODEL=... MODE=... . Logins persist across container recreation.

📊 Repository

Stars★ 15,235
Forks🍴 2,649
Open issues🐛 73
Last commit🕒 Jul 14, 2026
Created📅 Feb 2023
Language💻 Python
License⚖️ MIT

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.