> For the complete documentation index, see [llms.txt](https://securitylayer.gitbook.io/securitylayer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://securitylayer.gitbook.io/securitylayer/pentesting-tools/tools/petitpotato.md).

# PetitPotato

**Categoría y Tipo de Herramienta**&#x20;

PetitPotato es una herramienta de escalada de privilegios local (LPE) que funciona bajo el paradigma de "NTLM Relay". Es una evolución dentro de la familia de exploits "Potato" (como RottenPotato o JuicyPotato), diseñada para coaccionar la autenticación del sistema.

**Propósito Principal y Casos de Uso**&#x20;

Su propósito es permitir que un atacante que ha comprometido una cuenta de servicio (como las utilizadas por IIS o SQL Server) eleve sus privilegios a `NT AUTHORITY\SYSTEM`. Es crucial en escenarios donde el atacante posee el privilegio `SeImpersonatePrivilege`, pero las técnicas tradicionales fallan debido a parches de seguridad o configuraciones específicas del sistema operativo. PetitPotato se utiliza frecuentemente en pruebas de penetración internas y ejercicios de *Capture The Flag* (CTF) donde se requiere movimiento lateral vertical.

**Arquitectura y Modo de Funcionamiento**

La herramienta explota el protocolo MS-EFRPC (Encrypting File System Remote Protocol). El funcionamiento técnico se basa en forzar al host local a autenticarse contra un "listener" controlado por el atacante mediante una llamada RPC a la interfaz EFS. PetitPotato inicia un servidor de *Named Pipe* malicioso y, acto seguido, invoca el método `EfsRpcOpenFileRaw` de la API de EFS, indicándole que conecte al pipe del atacante. Esto provoca que el servicio LSASS inicie un handshake NTLM. La herramienta captura esta autenticación y la retransmite (relay) localmente al Service Control Manager u otro proceso privilegiado para obtener un token de acceso de SYSTEM.

**Protocolos y Tecnologías**

* Protocolos: RPC (Remote Procedure Call), MS-EFRPC, NTLM (New Technology LAN Manager).
* Mecanismos: Named Pipes, Impersonación de Tokens.

**Requisitos Técnicos**

* Sistema Operativo: Windows Server 2016, 2019 y versiones recientes de Windows 10/11.
* Privilegios: Requiere obligatoriamente que la cuenta comprometida tenga habilitado `SeImpersonatePrivilege` o `SeAssignPrimaryTokenPrivilege`.

***Ver máquinas:*** [***Relevant***](/securitylayer/maquinas-y-modulos-de-thm/machines/relevant.md) ***(THM)***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://securitylayer.gitbook.io/securitylayer/pentesting-tools/tools/petitpotato.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
