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

# Exploração do kernel (Dirty COW) - Escalada de privilégios no Linux

## O que é

A escalada de privilégios no kernel tem como alvo vulnerabilidades locais no kernel do Linux ou em patches específicos da distribuição. Esses exploits podem ser instáveis, então a validação da versão e os testes em laboratório são importantes antes da execução. Esta página específica foca em **Exploração do Kernel (Dirty COW)** e mantém o fluxo de exploração prático: identifique a condição, valide-a com segurança e então execute o payload menor necessário para comprovar o impacto.

## Enumeração

Comece confirmando o contexto local e a configuração incorreta exata antes de executar o caminho de exploração.

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

## Exemplos

## Exemplo de Kernel Dirty COW

Use **lsb\_release -a** para identificar a versão do sistema operacional.

<figure><img src="/files/45902f8ab2a412614677a6046b213f0fc40c6538" alt=""><figcaption></figcaption></figure>

Se você usar o **search exploit** comando, você verá muitas vulnerabilidades do kernel associadas a esta versão do Ubuntu.

<figure><img src="/files/583721dde73450f28f62b3c0f27286535c47aac6" alt=""><figcaption></figcaption></figure>

Neste caso, estamos interessados em:

<figure><img src="/files/5ef3bc82a7bf41c9d2d23920091c2896add9fb49" alt=""><figcaption></figcaption></figure>

Execute **script** e digite uma senha para o usuário dirty:

<figure><img src="/files/53534985b29d4f8d1c59083dd5ed285f6a1103dd" alt=""><figcaption></figcaption></figure>

Conseguimos **alterar a senha** no /etc/passwd do usuário firefart:

<figure><img src="/files/aea1fcda548f49238258140af79b2099a542a01a" alt=""><figcaption></figcaption></figure>

Pertencemos ao **root** grupo:

<figure><img src="/files/10fc018979061f28f77221efc75253968b7fd7f0" 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/pt-br/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.
