<!-- Impro of back to top link: See: -->
<a name="readme-top"></a>
<!-- PROJECT SHIELDS -->
[![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]
<!-- PROJECT LOGO -->
<br />
<di="center">
<h3 align="center">PentestGPT</h3>
<p align="center">
AI-Powered Autonomous Penetration Testing Agent
<br />
<strong>Published at USENIX Security 2024</strong>
<br />
<br />
<a href=" Website: pentestgpt.com »</strong></a>
<br />
<br />
<a href=" Paper</a>
·
<a href=" Bug</a>
·
<a href=" Feature</a>
</p>
</div>
<!-- ABOUT THE PROJECT -->
<a href=" target="_blank"><img src=" alt="GreyDGL%2FPentestGPT | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
---
Watch on YouTube
Watch on YouTube
---
> The autonomous CTF pipeline is backend-pluggable for Claude 代码 and Codex. The interactive
> modernized legacy mode (pentestgpt-legacy) supports a wider provider set: OpenAI, Anthropic,
> Google Gemini, DeepSeek, xAI, Qwen, Moonshot, and local Ollama. See
> Interacti Mode.
---
---
claude) - installed and authenticated for local Claude runs. See Claude 代码 docscodex) - installed and authenticated for local Codex runs. The Docker flow below bundles both CLIs.| Command | Description |
|---------|-------------|
| make install | Install dependencies |
| make test | Run all tests |
| make check | Run lint + typecheck |
| make build | Build distributable package |
---
The agent works through a multi-stage pipeline, feeding each stage's findings into the next — recon → exploit → walkthrough for CTF, asset discovery → identification → report for pentest.
A self-contained image bundles the 工具 + the Claude 代码 and Codex CLIs. You log in once and
the sessions persist in named — no re-login on later runs.
make docker-login logs in Claude (setup-token → token stored in the ) and Codex (its
own in-container codex login, OAuth callback forwarded — *not* seeded, since ChatGPT refresh
tokens are single-use). It is idempotent: re-running skips whatever is still valid. Logins persist across
container recreation; make docker-down keeps them, make docker-nuke removes the login (to
force a fresh login / rotate a token). Design + details: docs/docker-de.md.
---
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, discuss). The autonomous fixed-stage
pipeline supports Claude and Codex backends; this legacy mode talks natively to many pro
official SDKs.
Set an API key for any provider you want to use (in your en or .env — see.en). Only the pro you configure are enabled.
pentestgpt-legacy --list-models always renders the li. Re-run --smoke-test
after model IDs change. Current snapshot:
| Provider | Current models | Legacy (kept) | Env key |
|----------|----------------|---------------|---------|
| OpenAI | gpt-5.5, gpt-5.5-pro, gpt-5.4-mini, gpt-5.4-nano, gpt-5.2, gpt-5.3-codex | gpt-4o, gpt-4o-mini, o3, o4-mini | OPENAI_API_KEY |
| Anthropic | claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5-20251001 | — | ANTHROPIC_API_KEY |
| Google Gemini | gemini-3.1-pro, gemini-3.5-flash, gemini-3-pro, gemini-3.1-flash-lite | gemini-2.5-pro, gemini-2.5-flash | GEMINI_API_KEY / GOOGLE_API_KEY |
| DeepSeek | deepseek-, deepseek- | deepseek-chat, deepseek-reasoner | DEEPSEEK_API_KEY |
| xAI Grok | grok-4.3 | — | GROK_API_KEY / XAI_API_KEY |
| Alibaba Qwen | qwen3.7-max, qwen3.5-flash | qwen3-max | QWEN_API_KEY / DASHSCOPE_API_KEY |
| Moonshot Kimi | kimi-k2.6 | — | KIMI_API_KEY (.cn default; set MOONSHOT_BASE_URL for .ai) |
| Local (Ollama) | ollama:<model> (e.g. ollama:qwen3) | — | none (OLLAMA_BASE_URL) |
> The registry lives in pentestgpt_legacy/llm/registry.py (the single source of truth).
> Adding a model is one ModelSpec entry; OpenAI-compatible pro reuse one connector.
---
PentestGPT collects anonymous usage data to help improve the 工具. This data is sent to our Langfuse project and includes:
No sensitive data is collected - command outputs, credentials, or actual flag are ne.
---
PentestGPT achieved an 86.5% success rate (90/104 benchmarks) on an XBOW
experiment in December 2025. That number is a historical research result, not a currentpentestgpt-agent regression guarantee.
XBOW harnesses and result archives are maintained outside this product repository as reference-only
research artifacts. The supported PentestGPT CLI, Makefile, CI, and Docker runtime do not expose an
XBOW runner. A future e may reuse that corpus through a separately owned adapter without
making it a product dependency.
---
If you use PentestGPT in your research, please cite our paper:
---
Distributed under the MIT License. See LICENSE.md for more information.
Disclaimer: This 工具 is for educational purposes and authorized security testing only. The authors do not condone any illegal use. Use at your own risk.
---
<p align="right">(<a href="#readme-top">back to top</a>)</p>
<!-- MARKDOWN LINKS & IMAGES -->
[contributors-shield]:
[contributors-url]:
[forks-shield]:
[forks-url]:
[stars-shield]:
[stars-url]:
[issues-shield]:
[issues-url]:
[license-shield]:
[license-url]:
[linkedin-shield]:
[linkedin-url]:
[linkedin-url2]:
[discord-shield]:
[discord-url]:
开发语言:Python
Star 数:15743
该项目属于黑客技术方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕Automated Penetration Testing Agentic 框架 Powered by Large Language Models展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | PentestGPT - 自动渗透测试代理框架Po |
| 所属分类 | 黑客技术 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 22:01:43 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 321 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |