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

# Reutilización de contraseña de Docker - Escalada de privilegios en Linux

## Qué es

Las vías de escape de Docker abusan de una mala configuración del contenedor, recursos del host montados, credenciales predeterminadas, contraseñas reutilizadas o privilegios excesivos del contenedor. El objetivo es pasar del contexto del contenedor al acceso a nivel de host. Esta página específica se centra en **Escape de Docker (reutilización de contraseñas)** y mantiene práctico el flujo de explotación: identificar la condición, validarla de forma segura y luego ejecutar la carga útil mínima necesaria para demostrar el impacto.

## Enumeración

Comienza confirmando el contexto local y la configuración incorrecta exacta antes de ejecutar la ruta de explotación.

```bash
id
cat /proc/1/cgroup
mount
ls -la /var/run/docker.sock 2>/dev/null
```

## Ejemplos

Escape de Docker:

Observamos que la dirección IP no es la de la máquina (IP de la máquina: 10.10.11.130; IP del contenedor Docker: 172.19.0.2).

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

Escanearemos los puertos manualmente, ya que `nmap` no está instalado en la puerta de enlace (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 "el puerto $PORT está abierto"; done
```

Observamos que el puerto 22 está abierto (interno), por lo que podemos conectarnos mediante 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 "el puerto $PORT está abierto"; done
```

<figure><img src="/files/424e0e99dd6f9cb052708c5398441e67919a36df" alt=""><figcaption></figcaption></figure>

Si intentamos iniciar sesión con la cuenta root usando la `superadministrador` contraseña, no podemos iniciar sesión, pero con `augustus`, logramos obtener una shell.

<figure><img src="/files/5bb74961bc358e95708a4cfa87789b13e75d77db" 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/es/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.
