A collection of simple scripts written through the OffSec's PEN300 course for public consumption.
This script performs the basic situational awareness checks for Windows machines:
- Print to console the current domain
- Print to console the current domain logon servers
- Print to console the system information
- Check if Defender is installed, and any other installed antivirus products
- Check who you are, with
whoami /all - Check if you are a local administrator on the box
- Print to console the local administrator group
- Print to console the attached network adapters, to find if you are dual homed
- Print to console network configuration
- Prints to console open ports and services
- Print to console any PowerShell history
- Print to console contents of C:\ drive
- Check for any connected shared drives
- Check for AppLocker Policies
- Print to console installed software (32 bit and 64 bit, categorized)
- Print to console "Program Files" and "Program Files (x86)" to check for anything interesting within those directories.
- PrivEsc - Check for any unquoted service paths
- PrivEsc - Check for AlwaysInstalledElevated
- Check for interesting files in
C:\Users - Check for any .ssh directories in
C:\Users\<USERNAME>\.ssha. If the directory exists, print to console SSH Keys, RSA Leys, Public Keys, authorized_keys - Check for flags (local.txt, proof.txt, ssecret.txt)
a. If found, prints to console, with a reminder for commands:
whoami
hostname
ipconfig
TypeC:\Users\Path\To\Flag.txt - Checks for other intersting files on disk
a. Excludes
C:\Users,C:\Windows,C:\PerfLogs - Prints to console Domain Groups
- Prints to console Domain Users
- Prints to console Domain Group Members (All the domain groups, noisy!)
This script performs (you guessed it) basic enumeration tasks on a Linux machine:
- Checks for ansible
- Checks for ansible hosts
- Locates ansible playbooks
- Checks for passwords in various log file locations
- Checks if jfrog is installed
- Checks for jfrog artifactory and console logs
- Checks for access.backup
- Checks for ssh key files
- Checks for ssh_config files that contain ControlMaster or ControlPath
- Checks for any socket files
- Checks for running processes with SSH_AUTH_SOCK
- Checks for .ssh files in
/homedirectories
[!] These are not going to bypass defender as is! This just jumpstarts your exam, with vanilla shellcode you must take and encode/encrypt/whatever to bypass defender.
This script will create all your payloads that you used in the course.
[!] Warning!
These were all tested in a homelab, and not inside the course labs! If you're not getting a callback, not my fault.
- 32-bit reverse_https and reverse_tcp vbapplication, csharp payloads
- 64 bit reverse_https and reverse_https raw, csharp, powershell, vbapplication, exe, dll, elf (no reverse_https, as that payload doesn't exist for ELF) and msi payloads
- A lonely, single reverse_tcp_ssl python payload (That I can't recall where it was used in the course, but it's in my notes, so it's in the script)
├── csharp
│ ├── reverse_https-x32-csharp.txt - TESTED, passed (in homelab)
│ ├── reverse_https-x64-csharp.txt - TESTED, passed (in homelab)
│ ├── reverse_tcp-x32-csharp.txt - TESTED, passed (in homelab)
│ └── reverse_tcp-x64-csharp.txt - TESTED, passed (in homelab)
├── dll
│ ├── reverse_https-x64-dll.dll - TESTED, passed (in homelab)
│ └── reverse_tcp-x64-dll.dll - TESTED, passed (in homelab)
├── elf
│ └── reverse_tcp-x64-elf - TESTED, passed (in homelab)
├── exe
│ ├── reverse_https-x64-exe.exe - TESTED, passed (in homelab)
│ └── reverse_tcp-x64.exe - TESTED, passed (in homelab)
├── msi
│ ├── reverse_https-x64-msi.msi - TESTED, passed (in homelab)
│ └── reverse_tcp-x64-msi.msi - TESTED, passed (in homelab)
├── powershell
│ ├── reverse_https-x64-ps1.ps1 - TESTED, passed (in homelab)
│ └── reverse_tcp-x64-ps1.ps1 - TESTED, passed (in homelab)
├── raw
│ ├── reverse_https-x64-raw.bin - TESTED, passed (in homelab)
│ └── reverse_tcp-x64-raw.bin - TESTED, passed (in homelab)
├── vbapplication
├── reverse_https-x32-vpapplication.txt - TESTED, passed (in homelab)
├── reverse_https-x64-vbapplication.txt - TESTED, passed (in homelab)
├── reverse_tcp-x32-vpapplication.txt - TESTED, passed (in homelab)
└── reverse_tcp-x64-vbapplication.txt - TESTED, passed (in homelab)