SeImpersonate and SeAssignPrimaryToken
SeImpersonate
Allows a process to impersonate another user's context by obtaining an impersonation token from another process, often temporarily and usually while staying within the same session.
To utilize the token, the SeImpersonate privilege is needed. This privilege is often assigned to service accounts.
This privilege is also known as ""Impersonate a client after authentication".
https://github.com/ohpe/juicy-potato/releases
SeAssignPrimaryToken
Allows a process to assign a primary token to a newly created process, effectively running it as a different user. This is typically used for creating a new session.
To assign the token, the SeAssignPrimaryToken privilege is needed.
JuicyPotato Attack
Tricks a process running as SYSTEM to connect to their process, which hands over the impersonation token to be used by either SeImpersonate or SeAssignPrimaryToken
Juicy Potato act as a rogue COM server (A COM server is any object that provides services to clients).
Launch attack
To catch a reverse shell
-lspecifies the port for the rogue COM server-pis the program to launch-aare the arguments passed to the program to launch-tis thecreateprocesscallWith this Juicy Potato will try both the
CreateProcessWithTokenWandCreateProcessAsUserfunctions, which needSeImpersonateorSeAssignPrimaryTokenprivileges respectively.
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.
Launch Attack
To catch a reverse shell with PrintSpoofer:
Last updated