githubEdit

SeImpersonate and SeAssignPrimaryToken privilege

Token: every process has a token that has information about the account that is running it and it’s store in memory

we ask token from WinLogon process

Exploit JuicyPotato

Debug programs right

PS C:\Users\Public> whoami /priv

PRIVILEGES INFORMATION
----------------------

Privilege Name                Description                               State   
============================= ========================================= ========
SeAssignPrimaryTokenPrivilege Replace a process level token             Disabled
SeIncreaseQuotaPrivilege      Adjust memory quotas for a process        Disabled
SeAuditPrivilege              Generate security audits                  Disabled
SeChangeNotifyPrivilege       Bypass traverse checking                  Enabled 
**SeImpersonatePrivilege**        Impersonate a client after authentication Enabled 
SeCreateGlobalPrivilege       Create global objects                     Enabled 
SeIncreaseWorkingSetPrivilege Increase a process working set            Disabled

Connecting with MSSQLClient.py

Enabling xp_cmdshell

Confirming Access

Checking Account Privileges

The command whoami /priv confirms that SeImpersonatePrivilege is listed. This privilege can be used to impersonate a privileged account such as NT AUTHORITY\SYSTEM. JuicyPotato can be used to exploit the SeImpersonate or SeAssignPrimaryToken privileges via DCOM/NTLM reflection abuse

Escalating Privileges Using JuicyPotato

Catching SYSTEM Shell


PrintSpoofer and RoguePotato

JuicyPotato doesn't work on Windows Server 2019 and Windows 10 build 1809 onwards. However, PrintSpoofer and RoguePotato can be used to leverage the same privileges and gain NT AUTHORITY\SYSTEM level access

Escalating Privileges using PrintSpoofer

Catching Reverse Shell as SYSTEM


JuicyPotato

we will try to take a reverse shell with System privilege

Create a reverse shell

execute shell on windows machine

Last updated