PentestGPT

GreyDGL/PentestGPT

Automated Penetration Testing Agentic Framework Powered by Large Language Models

14k
Stars
2.5k
Forks
68
Open issues
345
Watchers
Python MITLast pushed Jun 7, 2026

Automated Penetration Testing Agentic Framework Powered by Large Language Models

Categories

Tags

Similar tools

Install

pip install PentestGPT

README

[![Contributors][contributors-shield]][contributors-url] [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![MIT License][license-shield]][license-url] [![Discord][discord-shield]][discord-url]


PentestGPT

AI-Powered Autonomous Penetration Testing Agent
Published at USENIX Security 2024

Official Website: pentestgpt.com »

Research Paper · Report Bug · Request Feature

GreyDGL%2FPentestGPT | Trendshift


Demo

Installation

Watch on YouTube

PentestGPT in Action

Watch on YouTube


What's New in v1.0 (Agentic Upgrade)

  • Iteration Loop - The agent runs continuously, maintains a context file with progress, and restarts with prior context when hitting limits. Loop terminates on flag capture or max iterations.
  • Autonomous Agent - Agentic pipeline for intelligent, autonomous penetration testing
  • Session Persistence - Save and resume penetration testing sessions

Multi-model support is available today in the interactive modernized legacy mode (pentestgpt-legacy) — OpenAI, Anthropic, Google Gemini, DeepSeek, xAI, Qwen, Moonshot, and local Ollama. See Interactive Multi-LLM Mode.


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

  • Python 3.12+
  • uv - Python package manager
  • Claude Code CLI (claude) - installed and authenticated. See Claude Code docs

Installation

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

Commands Reference

CommandDescription
make installInstall dependencies
make testRun all tests
make checkRun lint + typecheck
make buildBuild distributable package

Usage

# Run against a target
pentestgpt --target 10.10.11.234

# With challenge context
pentestgpt --target 10.10.11.50 --instruction "WordPress site, focus on plugin vulnerabilities"

# Limit iterations
pentestgpt --target 10.10.11.234 --max-iterations 5

The agent runs in an iteration loop: it works autonomously, maintains a context file with progress, and restarts with prior context when hitting limits. The loop terminates on flag capture or max iterations (default: 10).


Interactive Multi-LLM Mode (modernized legacy)

The classic, human-in-the-loop PentestGPT from the USENIX 2024 paper is preserved and modernized as pentestgpt-legacy. It runs three cooperating LLM sessions — reasoning / generation / parsing — that maintain a Pentesting Task Tree (PTT) while you drive the session interactively (next, more, todo, `disc