> 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/docker-escape/docker-password-reuse-linux-privilege-escalation.md).

# Reutilização de senha do Docker - Escalada de privilégios no Linux

## O que é

Os caminhos de escape do Docker abusam de configurações incorretas do contêiner, recursos do host montados, credenciais padrão, senhas reutilizadas ou privilégios excessivos do contêiner. O objetivo é passar do contexto do contêiner para acesso no nível do host. Esta página específica se concentra em **Escape do Docker (Reutilização de Senha)** 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
id
cat /proc/1/cgroup
mount
ls -la /var/run/docker.sock 2>/dev/null
```

## Exemplos

Escape do Docker:

Observamos que o endereço IP não é o da máquina (IP da máquina: 10.10.11.130; IP do contêiner Docker: 172.19.0.2).

<div data-full-width="true"><figure><img src="/files/7407af1f49b7a897aa7eedb57052a5bc90114fe5" alt=""><figcaption></figcaption></figure></div>

Vamos escanear as portas manualmente, já que `nmap` não está instalado no gateway (172.19.0.1) :

```bash
for PORT in {0..1000}; do timeout 1 bash -c "</dev/tcp/172.19.0.1/$PORT
&>/dev/null" 2>/dev/null && echo "port $PORT is open"; done
```

Observamos que a porta 22 está aberta (interna), então podemos nos conectar via SSH.

```bash
for PORT in {0..1000}; do timeout 1 bash -c "</dev/tcp/172.19.0.1/$PORT&>/dev/null" 2>/dev/null && echo "port $PORT is open"; done
```

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

Se tentarmos fazer login com a conta root usando a `superadministrador` , não conseguimos fazer login, mas com `augustus`, conseguimos obter um shell.

<figure><img src="/files/169f9763b9a52526c6ba28534837d55e46d2c4bf" 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/docker-escape/docker-password-reuse-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.
