A simplified auto-executing version of PentestGPT that automatically executes commands and processes results. The original version requires manual input of command execution results.
这是 PentestGPT 的简化自动执行版本,可以自动执行命令并处理结果。原始版本需要手动输入命令执行结果。
-
Automatic command execution and result analysis
-
Maintains original PentestGPT's Penetration Testing Tree (PTT) structure
-
Flexible LLM API support with customizable endpoints
-
Langfuse support
-
Comprehensive logging system
-
自动命令执行和结果分析
-
保持原始 PentestGPT 的渗透测试树 (PTT) 结构
-
灵活的 LLM API 支持,可自定义端点
-
Langfuse 支持
-
全面的日志系统
The tool follows the original PentestGPT workflow but automates the execution: 该工具遵循原始 PentestGPT 的工作流程,但实现了自动化执行:
-
Initializes with target information
-
Generates Penetration Testing Tree (PTT)
-
Automatically selects and executes commands
-
Processes results and updates PTT
-
Repeats until completion or error
-
初始化目标信息
-
生成渗透测试树 (PTT)
-
自动选择并执行命令
-
处理结果并更新 PTT
-
重复执行直至完成或出错
├── main.py # Main entry point / 主入口点
├── report_generator.py # Report generation module / 报告生成模块
├── pentestgpt/ # Core package directory / 核心包目录
│ ├── pentest_gpt.py # Main PentestGPT logic / 主要 PentestGPT 逻辑
│ ├── prompt_class.py # Prompt management / 提示管理
│ └── utils/ # Utility modules / 工具模块
│ ├── llm_api.py # LLM API handling / LLM API 处理
│ ├── module_import.py # Dynamic module importing / 动态模块导入
│ ├── prompt_select.py # Prompt selection logic / 提示选择逻辑
│ └── web_parser.py # Web content parsing / 网页内容解析
├── logs/ # Log directory / 日志目录
└── requirements.txt # Project dependencies / 项目依赖
- Python 3.10 or higher / Python 3.10 或更高版本
- Valid OpenAI API key (or compatible API endpoint) / 有效的 OpenAI API 密钥(或兼容的 API 端点)
- Linux/Unix environment recommended / 推荐 Linux/Unix 环境
- Clone the repository:
- 克隆仓库:
git clone https://github.com/star5o/PentestGPT-Auto-Executor.git
cd PentestGPT-Auto-Executor- Set up environment variables:
- 设置环境变量:
cp .env.template .envEdit .env file with your configuration:
编辑 .env 文件进行配置:
OPENAI_API_KEY=your_openai_api_key
OPENAI_BASEURL=https://api.openai.com/v1 # or your API endpoint / 或您的 API 端点
REASONING_MODEL=gpt-4o
PARSING_MODEL=gpt-4o
# PentestGPT Target Configuration / PentestGPT 目标配置
PENTESTGPT_TARGET=192.168.1.106 # Set your target IP or any other target / 设置您的目标 IP 或其他目标
- Install dependencies:
- 安装依赖:
pip install -r requirements.txt- Run the tool:
- 运行工具:
python main.pypython main.py [--log_dir DIRECTORY] [--reasoning_model MODEL] [--parsing_model MODEL]-
For educational and authorized testing purposes only
-
Use in controlled testing environments
-
Author assumes no responsibility for misuse
-
Automatic execution may have unexpected results
-
仅用于教育和授权测试目的
-
在受控测试环境中使用
-
作者对滥用不承担任何责任
-
自动执行可能会产生意外结果
Based on the original PentestGPT project by GreyDGL. 基于 GreyDGL 的原始 PentestGPT 项目。
For issues and contributions, please use the GitHub issue tracker. 如有问题和贡献,请使用 GitHub issue tracker。