mirror of
https://github.com/weyne85/PentestGPT.git
synced 2025-10-29 16:58:59 +00:00
PentestGPT
We're testing PentestGPT on HackTheBox. Follow
Introduction
PentestGPT is a penetration testing tool empowered by ChatGPT. It is designed to automate the penetration testing process. It is built on top of ChatGPT and operate in an interactive mode to guide penetration testers in both overall progress and specific operations. A sample testing process of PentestGPT on a target VulnHub machine (Hackable II) is available at here. A sample usage video is below: (or available here: Demo)
- Comparison to Auto-GPT.
- Using Auto-GPT in security testing is good, but it is not optimized for security-related tasks.
- PentestGPT is designed for penetration testing with a customized session interaction (see here for the detailed design).
- Currently, PentestGPT does not rely on search engine. The "Google-enhanced" version of PentestGPT is under development.
Contribute
- The project is still in its early stage. Feel free to raise any issues when using the tool.
- Please help to contribute by submitting the vulnerabilities you identified or challenges you solved with PentestGPT.
- This project is for research purpose. Please contact me if you're interested in collaboration.
Installation
- Install
requirements.txtwithpip install -r requirements.txt - (Deprecated: Will update support for non-plus member later.)
Installchatgpt-wrapperif you're non-plus members:pip install git+https://github.com/mmabrouk/chatgpt-wrapper. More details at: https://github.com/mmabrouk/chatgpt-wrapper. Note that the support for non-plus members are not optimized. - Configure the keys in
config. You may follow a sample bycp config/chatgpt_config_sample.py. config/chatgpt_config.py.
Usage
- To start, run
python3 main.py. - The tool works similar to msfconsole. Follow the guidance to perform penetration testing.
- In general, PentestGPT intakes commands similar to chatGPT. There are several basic commands.
- The commands are:
help: show the help message.next: key in the test execution result and get the next step.more: let PentestGPT to explain more details of the current step.todo: show the todo list.discuss: discuss with the PentestGPT.exit: exit the tool.
- You can use <SHIFT + right arrow> to end your input (and is for next line).
- You may always use
TABto autocomplete the commands. - When you're given a drop-down selection list, you can use cursor or arrow key to navigate the list. Press
ENTERto select the item. Similarly, use <SHIFT + right arrow> to confirm selection.
- The commands are:
Design Documentation
The current design is mainly for web penetration testing
General Design
PentestGPT provides a unified terminal input handler, and backed by three main components:
- A test generation module which generates the exact penetration testing commands or operations for the users to execute.
- A test reasoning module which conducts the reasoning of the test, guiding the penetration testers on what to do next.
- A parsing module which parses the output of the penetration tools and the contents on the webUI.
Function Design
The handler is the main entry point of the penetration testing tool. It allows pentesters to perform the following operations:
- (initialize itself with some pre-designed prompts.)
- Start a new penetration testing session by providing the target information.
- Ask for todo-list, and acquire the next step to perform.
- After completing the operation, pass the information to PentestGPT.
- Pass a tool output.
- Pass a webpage content.
- Pass a human description.
Update history
v0.3
- Prompt usage optimization.
- Documentation improvements.
v0.2
- A major update to improve the terminal usage
- Prompt optimization.
Description
Languages
Python
52.3%
HTML
47.7%