Saltar al contenido
Skillpedia
Agentes35 mil · #7890

escaping-containers-to-host

Qué hace

Esta herramienta te ayuda a salir de un contenedor aislado para acceder al sistema principal (host) donde se está ejecutando el contenedor. Se usa para probar la seguridad de los contenedores.

Cuándo usarla

  • ✓Al probar la seguridad de contenedores con permiso.
  • ✓Para demostrar el riesgo de las configuraciones inseguras en contenedores.
  • ✓Para comprobar si las protecciones contra la salida de contenedores son eficaces.

Link de la skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/escaping-containers-to-host/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/escaping-containers-to-host/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“¿Cómo puedo salir de este contenedor hacia el sistema host?”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Aprovecha configuraciones de seguridad incorrectas o vulnerabilidades en el software que gestiona los contenedores. Al encontrar un fallo de este tipo, permite ejecutar comandos directamente en el sistema host.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Escaping Containers to Host

Legal Notice: This skill is for authorized security testing and educational purposes only. Container breakout grants full host compromise. Only run these techniques against systems you own or have explicit written authorization to test. Unauthorized use is illegal and may violate computer fraud laws.

Overview

Container escape (MITRE ATT&CK T1611, Escape to Host) is the act of breaking the isolation boundary between a container and the host operating system, giving an attacker code execution in the host namespace — and, on Kubernetes, frequently a route to the entire node and then the cluster. Containers share the host kernel and rely on namespaces, cgroups, capabilities, seccomp, and LSMs (AppArmor/SELinux) for isolation. When any of these controls are weakened (a --privileged container, a mounted Docker socket, a hostPath mount of /, excess Linux capabilities such as CAP_SYS_ADMIN) or when a runtime contains a vulnerability, that boundary collapses.

This skill covers the four highest-impact, real-world escape primitives observed by Sysdig, Unit 42, and the runC maintainers:

  1. Misconfiguration escapes — privileged containers, CAP_SYS_ADMIN, host PID/IPC/Network namespaces, and hostPath mounts.
  2. Exposed Docker socket (/var/run/docker.sock) — mounting the daemon socket into a container hands an attacker root on the host via a new privileged container.
  3. The "Leaky Vessels" runC fd leak, CVE-2024-21626 — runC leaks an internal file descriptor (/proc/self/fd/7/8) referencing the host filesystem before pivot_root; setting the container working directory to that fd lands the process on the host. Patched in runC 1.1.12 (containerd 1.6.28/1.7.13, Docker 25.0.2).
  4. The November 2025 runC procfs write-redirect family — CVE-2025-31133, CVE-2025-52565, CVE-2025-52881 — race/symlink abuse of the /dev/null, /dev/console, and other bind mounts performed before runC applies maskedPaths/readonlyPaths, allowing read-write access to /proc entries (e.g. /proc/sysrq-trigger, core_pattern) and arbitrary write redirection. Patched in runC 1.2.8, 1.3.3, and 1.4.0-rc.3.

Sources: Palo Alto Networks "Leaky Vessels" advisory; Sysdig "New runc vulnerabilities allow container escape" (2025); opencontainers/runc security advisories GHSA-cgrx-mc8f-2prm and GHSA-9493-h29p-rfm2; Unit 42 container-escape research.

When to Use

  • During an authorized container or Kubernetes penetration test after obtaining initial code execution inside a container or pod
  • When validating that runtime defenses (Falco, seccomp, AppArmor) detect or block breakout attempts
  • When assessing the blast radius of a compromised microservice
  • When verifying patch levels of runC/containerd/Docker against the CVEs above

Prerequisites

  • Authorization (signed rules of engagement) covering host/node compromise
  • A foothold: a shell inside a target container
  • Reconnaissance utilities inside the container or staged in:
    # deepce - Docker enumeration and escape
    git clone https://github.com/stealthcopter/deepce.git
    # amicontained - container introspection (capabilities, seccomp, namespaces)
    curl -L https://github.com/genuinetools/amicontained/releases/download/v0.4.9/amicontained-linux-amd64 -o amicontained
    chmod +x amicontained
    # CDK - zero-dependency K8s/container pentest toolkit
    curl -L https://github.com/cdk-team/CDK/releases/latest/download/cdk_linux_amd64 -o cdk
    chmod +x cdk
    
  • A lab cluster/host you are permitted to break out of (e.g., kind, minikube, or a dedicated VM)

Objectives

  • Enumerate the container's privilege posture (capabilities, namespaces, mounts, seccomp)
  • Identify which escape primitive is available
  • Execute a host breakout and prove host-level code execution
  • Capture evidence (host hostname, host /etc/shadow access, or a host file write)
  • Document the root-cause misconfiguration or vulnerable runtime version for remediation

MITRE ATT&CK Mapping

Technique ID Name Tactic
T1611 Escape to Host Privilege Escalation
T1610 Deploy Container Defense Evasion / Execution
T1613 Container and Resource Discovery Discovery
T1068 Exploitation for Privilege Escalation Privilege Escalation

Workflow

Step 1: Enumerate the Container Environment

Determine privilege level, capabilities, namespaces, and mounted host paths.


…
Preguntas frecuentes

¿Qué es un 'contenedor'?

Un contenedor es como una caja aislada que contiene un programa y todo lo que necesita para funcionar. Garantiza que el programa funcione igual en cualquier equipo.

¿Qué significa 'escapar del contenedor al host'?

Significa lograr salir de la caja aislada (el contenedor) y acceder al equipo principal (el host) donde está funcionando esa caja.

¿Es peligroso?

Sí, es una técnica de seguridad avanzada. Solo debe usarse en pruebas autorizadas, en sistemas que tienes permiso para probar, ya que puede dar control total sobre el sistema host.

Detalles

Descripción original del autor

Exploits privileged pods, host mounts, runC CVEs, and exposed Docker sockets to break out of a container and reach the underlying host during an authorized container-security assessment. Use when executing an approved breakout test, demonstrating the real impact of a privileged or hostPath workload, or validating that escape mitigations actually hold. Keywords: container breakout, privileged, host

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularidad

Estrellas en GitHub
35 mil
Posición en el ranking
#7890
Licencia
Apache-2.0
Actualizada
31/8/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas