Langsung ke konten
Skillpedia
Agen35k Β· #7890

escaping-containers-to-host

Fungsinya

Alat ini membantu Anda keluar dari container yang terisolasi untuk mengakses sistem utama (host) tempat container tersebut berjalan. Alat ini digunakan untuk menguji keamanan container.

Kapan dipakai

  • βœ“Saat menguji keamanan container dengan izin resmi.
  • βœ“Untuk mendemonstrasikan risiko konfigurasi container yang tidak aman.
  • βœ“Untuk memverifikasi apakah proteksi container escape sudah efektif.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/escaping-containers-to-host/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBagaimana cara keluar dari container ini ke sistem host?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Alat ini memanfaatkan kesalahan konfigurasi keamanan atau celah pada perangkat lunak yang mengelola container. Setelah menemukan celah tersebut, alat ini memungkinkan perintah dijalankan langsung di sistem host.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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.


…
Pertanyaan umum

Apa itu 'container'?

Container seperti kotak terisolasi yang berisi program beserta semua yang dibutuhkannya untuk berjalan. Container memastikan program bekerja dengan cara yang sama di komputer mana pun.

Apa arti 'escaping the container to the host'?

Artinya berhasil keluar dari kotak terisolasi (container) dan mendapatkan akses ke komputer utama (host) tempat kotak tersebut berjalan.

Apakah ini berbahaya?

Ya, ini adalah teknik keamanan tingkat lanjut. Teknik ini hanya boleh digunakan dalam pengujian resmi pada sistem yang Anda miliki izin untuk diuji, karena dapat memberikan kendali penuh atas sistem host.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
35k
Peringkat
#7890
Lisensi
Apache-2.0
Diperbarui
31/8/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa