> 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/dirty-cow-kernel-exploit-linux-privilege-escalation.md).

# Explotación del kernel (Dirty COW) - 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 (Dirty COW)** 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

## Ejemplo de kernel Dirty COW

Utilice **lsb\_release -a** para identificar la versión del sistema operativo.

<figure><img src="/files/2e4cb37b1fc05a281215824ae02e261bdf474890" alt=""><figcaption></figcaption></figure>

Si usas el **buscar exploit** comando, verás muchas vulnerabilidades del kernel asociadas con esta versión de Ubuntu.

<figure><img src="/files/6888c8135ad2b7ee3695cd31eccb452a5eb3f710" alt=""><figcaption></figcaption></figure>

En este caso, nos interesa:

<figure><img src="/files/779d1c8193ae5888f4b9a2b4fa496397c13a942d" alt=""><figcaption></figcaption></figure>

Ejecuta **script** y escribe una contraseña para el usuario dirty:

<figure><img src="/files/6b1deaac87c5ddc2dfba44683a89f2b0b6fca6f1" alt=""><figcaption></figcaption></figure>

Hemos logrado **cambiar la contraseña** en /etc/passwd del usuario firefart:

<figure><img src="/files/23c8b8cf910bf3fed27578b057a43203d6f99b88" alt=""><figcaption></figcaption></figure>

Pertenecemos al **root** grupo:

<figure><img src="/files/b5051e8f1e5523971a974c7990ec97c6b476c793" alt=""><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/dirty-cow-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.
