mirror of
https://github.com/weyne85/PentestGPT.git
synced 2025-10-29 16:58:59 +00:00
3.0 KiB
3.0 KiB
Design Documentation for PentestGPT
version 0.1, for web penetration testing only
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.
System Design
General Structure
- Maintain three chat sessions in one class. Each session is for one component.
- User can select to pass information to one section. In particular.
- todo.
- pass information.
Logic Flow Design
- User initializes all the sessions.
- User follows the instruction to perform penetration testing in the following logic.
- Reasoning session provides a list of todo for user to choose from.
- User chooses one todo, and reasoning session passes the information to generation session.
- Generation session generates the exact command for the user to execute.
- User executes the command, and passes the output to the parsing session.
- Parsing session parses the output, and passes the information to reasoning session.
- Reasoning session updates the todo list, and provides the next todo for the user to choose from.
- User can also pass information to the reasoning session directly.
- User passes the information to parser session.
- Parser session summarizes the information, and passes the information to the reasoning section.
A flow-chart is shown below:
sequenceDiagram
participant User
participant ReasoningSession
participant GenerationSession
participant ParsingSession
User->>ReasoningSession: 1.1 Choose todo
ReasoningSession->>GenerationSession: 1.2 Pass information
GenerationSession->>User: 1.3 Generate command
User->>ParsingSession: 1.4 Execute command
ParsingSession->>User: 1.5 Parse output
User->>ReasoningSession: 1.6 Pass output
ReasoningSession->>ParsingSession: 1.7 Update todo list
ParsingSession->>ReasoningSession: 1.8 Pass information
ReasoningSession->>User: 1.9 Provide list of todo
ReasoningSession->>User: 1.10 Check if process is finished
User-->>ParsingSession: 2.1 Pass information
ParsingSession-->>User: 2.2 Summarize information
User-->>ReasoningSession: 2.3 Pass summarized information