Skip to content

star5o/PentestGPT-Auto-Executor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PentestGPT Auto-Executor Version

一个自动执行的 PentestGPT 魔改版本

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 的简化自动执行版本,可以自动执行命令并处理结果。原始版本需要手动输入命令执行结果。

Features

特性

  • 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 支持

  • 全面的日志系统

How It Works

工作原理

The tool follows the original PentestGPT workflow but automates the execution: 该工具遵循原始 PentestGPT 的工作流程,但实现了自动化执行:

  1. Initializes with target information

  2. Generates Penetration Testing Tree (PTT)

  3. Automatically selects and executes commands

  4. Processes results and updates PTT

  5. Repeats until completion or error

  6. 初始化目标信息

  7. 生成渗透测试树 (PTT)

  8. 自动选择并执行命令

  9. 处理结果并更新 PTT

  10. 重复执行直至完成或出错

Project Structure

项目结构

├── 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 / 项目依赖

Prerequisites

前提条件

  • 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 环境

Quick Start

快速开始

  1. Clone the repository:
  2. 克隆仓库:
git clone https://github.com/star5o/PentestGPT-Auto-Executor.git
cd PentestGPT-Auto-Executor
  1. Set up environment variables:
  2. 设置环境变量:
cp .env.template .env

Edit .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 或其他目标
  1. Install dependencies:
  2. 安装依赖:
pip install -r requirements.txt
  1. Run the tool:
  2. 运行工具:
python main.py

Command Line Arguments

命令行参数

python main.py [--log_dir DIRECTORY] [--reasoning_model MODEL] [--parsing_model MODEL]

Warning

警告

  • For educational and authorized testing purposes only

  • Use in controlled testing environments

  • Author assumes no responsibility for misuse

  • Automatic execution may have unexpected results

  • 仅用于教育和授权测试目的

  • 在受控测试环境中使用

  • 作者对滥用不承担任何责任

  • 自动执行可能会产生意外结果

Acknowledgments

致谢

Based on the original PentestGPT project by GreyDGL. 基于 GreyDGL 的原始 PentestGPT 项目。

Contact

联系方式

For issues and contributions, please use the GitHub issue tracker. 如有问题和贡献,请使用 GitHub issue tracker。

About

A simplified auto-executing version of PentestGPT that automatically executes commands and processes results.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages