A GPT-empowered penetration testing tool.
resources where we use it to solve HackTheBox challenge TEMPLATED (web challenge).Before installation, we recommend you to take a look at this installation video if you want to use cookie setup.
requirements.txt with pip install -r requirements.txt
config. You may follow a sample by cp config/chatgpt_config_sample.py config/chatgpt_config.py. Inspect - Network, find the connections to the ChatGPT session page.https://chat.openai.com/api/auth/session and paste it into the cookie field of config/chatgpt_config.py. (You may use Inspect->Network, find session and copy the cookie field in request_headers to https://chat.openai.com/api/auth/session)userAgent with your user agent.chatgpt_config.py.python3 test_connection.py. You should see some sample conversation with ChatGPT. 1. You're connected with ChatGPT Plus cookie.
To start PentestGPT, please use <python3 main.py --reasoning_model=gpt-4>
## Test connection for OpenAI api (GPT-4)
2. You're connected with OpenAI API. You have GPT-4 access. To start PentestGPT, please use <python3 main.py --reasoning_model=gpt-4 --useAPI>
## Test connection for OpenAI api (GPT-3.5)
3. You're connected with OpenAI API. You have GPT-3.5 access. To start PentestGPT, please use <python3 main.py --reasoning_model=gpt-3.5-turbo --useAPI>
https://chat.openai.com/backend-api/conversations. Please submit an issue if you encounter any problem.python3 main.py --args. --reasoning_model is the reasoning model you want to use.--useAPI is whether you want to use OpenAI API.test_connection.py, which are: python3 main.py --reasoning_model=gpt-4python3 main.py --reasoning_model=gpt-4 --useAPIpython3 main.py --reasoning_model=gpt-3.5-turbo --useAPIhelp: 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. Also, a new sub-task solver will be created to guide the tester.todo: show the todo list.discuss: discuss with the PentestGPT.google: search on Google. This function is still under development.quit: exit the tool and save the output as log file (see the reporting section below).TAB to autocomplete the commands.ENTER to select the item. Similarly, use <SHIFT + right arrow> to confirm selection.more, users can execute more commands to investigate into a specific problem: help: show the help message.brainstorm: let PentestGPT brainstorm on the local task for all the possible solutions.discuss: discuss with PentestGPT about this local task.google: search on Google. This function is still under development.continue: exit the subtask and continue the main testing session.logs folder (if you quit with quit command).python3 utils/report_generator.py <log file>. A sample report sample_pentestGPT_log.txt is also uploaded.Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)Distributed under the MIT License. See LICENSE.txt for more information.
Gelei Deng - gelei.deng@ntu.edu.sg