There is a ton of great resources of privilege escalation techniques on Windows. However, I still want to create my own cheat sheet of this difficult topic along my OSCP journey as I didn’t know anything about Windows Internal :(. I recently bought 2 Udemy courses focusing on Windows PrivEsc: Windows Privilege Escalation for OSCP & Beyond! and Windows Privilege Escalation for Beginners. Both courses are awesome for OSCP students like me. Here I take notes and add more useful stuff I’ve collected based on their outlines and existing cheat sheets on that topic as well.

A - Initial Enumeration

1. System Enumeration

System information

> systeminfo
# Only ouputs important information
> systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type"
> hostname

wmic: Windows Management Instrumentation Command-line

> wmic /?
# Quick Fix Engineering
> wmic qfe 
> wmic qfe get Caption,Description,HotFixID,InstalledOn
> wmic logicaldisk get Caption,Description,ProviderName

2. User Enumeration

> whoami
> whoami /priv
> whoami /groups
> net user
> net user administrator

> net localgroup
> net localgroup administrators

3. Network Enumeration

> ipconfig /all
> arp -a
> route print
> netstat -ano 

4. Password Hunting

> findstr /si password *.txt *.ini *.config

5. A/V and Firewall Enumeration

# Service Control
> sc query windefend
> sc queryex type= service
> netsh advfirewall firewall dump
> netsh firewall show state
> netsh firewall show config

B - Automated Tools

meterpreter> run post/multi/recon/local_exploit_suggester

C - Escalation Paths

1. Kernel Exploits

Writeups

2. Passwords and Port Forwarding

3. Windows Subsystem for Linux

4. Impersonation and Potato Attacks

Hot Potato

MS16-075 Rotten Potato

Juicy Potato

Rogue Potato

  • https://github.com/antonioCoco/RoguePotato

Writeups

5. getsystem

6. RunAs

7. Registry

8. Executable Files

9. Startup Applications

10. DLL Hijacking

https://pentestlab.blog/2017/03/27/dll-hijacking/

11. Service Permissions (Paths)

Binary Paths

Unquoted Service Paths

12. CVE-2019-1388

Extra Resources

accesschk.exe -uwcqv "Authenticated Users" * /accepteula

Bypassing UAC

https://enigma0x3.net/2016/07/22/bypassing-uac-on-windows-10-using-disk-cleanup/ https://github.com/hfiref0x/UACME

3. Abusing Token Privileges

https://github.com/hatRiot/token-priv –>

Bonus: Linux Privilege Escalation

  • First try history,cat .bash_history or some stupid passwords for a quick win

Resources