Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create PentestGPT.txt #398

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Create PentestGPT.txt #398

wants to merge 2 commits into from

Conversation

ooovenenoso
Copy link

@ooovenenoso ooovenenoso commented Oct 31, 2023

What does my payload do?

This script serves a dual purpose:

  1. It automates the collection of comprehensive system details.
  2. Utilizes OpenAI's GPT-3.5 Turbo API to generate a pentesting report based on the gathered data.

Moreover, the script demonstrates a technique for obfuscating specific code sections, which can be instrumental in safeguarding sensitive code fragments and dodging rudimentary detection mechanisms.

How can others use it?

  1. Ensure you have PowerShell installed and have access to the OpenAI API.
  2. Execute the script on Windows 10/11.
  3. Upon completion, a pentesting report will be generated and saved on the desktop of the user for review.

Requirements:

  • PowerShell
  • Access to OpenAI's GPT-3.5 Turbo API
  • Proper permissions if running on live systems (to ensure ethical practices)

Adding my PentestGPT version 1 to the recon category

This script automates the gathering of detailed system information and uses the OpenAI GPT-3.5 Turbo API to generate a pentesting report based on the collected information. Additionally, the script showcases an example of obfuscation to protect sensitive parts of the code and to evade basic detection mechanisms.
REM Create PowerShell script to gather system information
DELAY 500
STRING $system_info = @{
ENTER
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENTER```

can be replaced with `STRINGLN`

DELAY 500
STRING 'OS' = $(Get-CimInstance Win32_OperatingSystem).Caption;
ENTER
DELAY 500
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except on a very slow target system, (or from a device that isn't a real usb rubber ducky), these delays shouldn't be required.

STRING "@
ENTER
DELAY 500
STRING Set-Content -Path $env:USERPROFILE\Desktop\Pentesting_Report.html -Value $htmlContent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should likely be a DEFINE so payload user can supply their desired path

STRING $htmlContent = @"
ENTER
DELAY 500
STRING <html>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

injecting code blocks can be made more readable by using string blocks:
https://docs.hak5.org/hak5-usb-rubber-ducky/ducky-script-basics/keystroke-injection#stringln-blocks

@dallaswinger dallaswinger added the pending requested changes requires changes before merge label Jan 3, 2024
@ooovenenoso
Copy link
Author

Thank you very much for the reviews. I will be applying them all as soon as I have access to my computer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending requested changes requires changes before merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants