explaingit

greydgl/pentestgpt

13,079PythonAudience · ops devopsComplexity · 4/5LicenseSetup · moderate

TLDR

PentestGPT is an AI-powered penetration testing tool that uses a large language model to plan and execute authorized security tests automatically, achieving 86.5% success on standardized benchmarks.

Mindmap

mindmap
  root((PentestGPT))
    What It Does
      AI-guided pen testing
      Security automation
    Targets
      Web applications
      CTF challenges
      Network targets
    AI Backends
      Claude Anthropic
      OpenRouter
      Local Ollama
    Setup
      Docker container
      LLM API key needed
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run automated penetration tests against an authorized target IP or hostname with AI-guided attack planning.

USE CASE 2

Practice CTF security challenges across web, cryptography, binary, and forensics categories with AI assistance.

USE CASE 3

Benchmark AI-driven security testing against the 104-test XBOW dataset to compare model performance.

Tech stack

PythonDocker

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Docker and an API key for an LLM provider such as Anthropic, OpenRouter, or a locally running Ollama server.

Free to use and modify for any purpose, including commercial security engagements, as long as you keep the MIT license notice.

In plain English

PentestGPT is a Python-based tool that automates penetration testing, which is the practice of testing computer systems and networks for security vulnerabilities in an authorized way. It uses a large language model as the reasoning engine, giving it the ability to plan attacks, execute security testing tools, and work through challenges step by step without requiring a human to direct every action. The research behind the project was published at USENIX Security 2024, one of the main academic conferences on computer security. The tool runs inside a Docker container, which provides a pre-built environment with common security testing tools already installed. You point it at a target (an IP address or hostname), and it launches an interactive interface that shows its progress in real time. It supports web application testing, cryptography challenges, binary reversing, forensics, privilege escalation, and categories that appear in security competitions called CTFs (Capture The Flag events). Sessions can be saved and resumed later. For the AI component, PentestGPT connects to an LLM provider such as Anthropic (Claude) or OpenRouter, or can route requests to a locally running model server like Ollama or LM Studio. Different tasks route to different models: standard operations go to a lighter model while complex reasoning tasks go to a larger one. The project includes a benchmark suite of 104 standardized tests from the XBOW dataset. PentestGPT achieved an 86.5 percent success rate on these benchmarks, with an average cost of about $1.11 and an average time of just over six minutes per completed test. Success rates vary by difficulty: 91 percent on level 1, 74.5 percent on level 2, and 62.5 percent on level 3. It is open source under the MIT License. Anonymous usage telemetry is collected by default (excluding any command output or credentials) and can be disabled with a command-line flag.

Copy-paste prompts

Prompt 1
How do I run PentestGPT with Claude as the AI backend against a local vulnerable VM, and what Docker setup do I need?
Prompt 2
Walk me through connecting PentestGPT to a local Ollama model instead of a cloud API to keep all testing data on my machine.
Prompt 3
How do I save a PentestGPT session mid-test and resume it later without losing the AI's progress and context?
Prompt 4
Show me how to interpret PentestGPT's real-time progress interface and understand which tools it is choosing to run.
Open on GitHub → Explain another repo

← greydgl on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.