> 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-toolbox-default-credentials-linux-privilege-escalation.md).

# Escape de Docker (credenciais padrão do Docker Toolbox) - Escalação de privilégios no Linux

Anotações sobre escape de Docker (credenciais padrão do Docker Toolbox) para escalação de privilégios no Linux, com etapas de enumeração, exemplos de exploração e validação voltada a relatórios.

## O que é

Os caminhos de escape do Docker exploram configurações incorretas de contêiner, recursos do host montados, credenciais padrão, senhas reutilizadas ou privilégios excessivos do contêiner. O objetivo é sair do contexto do contêiner para obter acesso em nível de host. Esta página específica foca em **Escape do Docker (Credenciais padrão do Docker Toolbox)** e mantém o fluxo de exploração prático: identifique a condição, valide-a com segurança e depois execute a menor carga útil necessária para provar 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

{% hint style="info" %}
Durante o reconhecimento, identificamos que nossa máquina Windows não estava acessível diretamente. No entanto, conseguimos nos conectar a uma máquina Windows contida em um contêiner Docker, com o endereço IP `172.17.0.2` e o `172.17.0.1` gateway. Agora tentaremos fazer pivot por meio desse contêiner e escalar nossos privilégios.
{% endhint %}

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4c13597f6d389972474e5c331a84314b604470a6%2F%7B3258557B-B4F2-4243-A48E-27558C95013C%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4c116a18718773902912edfa5840b85cc0adbfb2%2Fimage%20(1039).png?alt=media" alt=""><figcaption></figcaption></figure>

### **Verificação da porta SSH**

Primeiro, precisamos verificar se a porta SSH (22) está aberta no gateway do Docker (172.17.0.1). Use um comando simples para isso:

```bash
echo ' ' > /dev/tcp/172.17.0.1/22 && echo "[+] SSH Open" || echo "[-] SSH Closed"
```

A porta 22 está aberta, o que significa que podemos tentar uma conexão SSH com a máquina no contêiner.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-fa8c5e81828eec484c93464c56b38630e6afc268%2F%7BEAD9A15E-3058-4E82-9767-81350E98F8C8%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

#### **Faça login com as credenciais padrão do Docker Toolbox**

As IDs padrão do Docker Toolbox são:

* **Usuário**: `docker`
* **Senha** : `tcuser`

Agora tentamos nos conectar ao contêiner via SSH usando essas informações. Uma vez conectados à máquina, percebemos que temos acesso ao root do contêiner com o usuário `docker`.

<figure><img src="https://783634792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-784e89bfe8ef2386d00d5d9c5d6b7d66ce77a11e%2Fimage%20(1040).png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/pt-br/privesc/docker-escape/docker-toolbox-default-credentials-linux-privilege-escalation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
