escaping-containers-to-host
Skill này làm gì
Công cụ này giúp bạn thoát khỏi một container được cô lập để truy cập hệ thống chính (host) nơi container đang chạy. Công cụ được dùng để kiểm thử bảo mật container.
Khi nào nên dùng
- ✓Khi kiểm thử bảo mật container với sự cho phép.
- ✓Để chứng minh rủi ro của các cấu hình container không an toàn.
- ✓Để kiểm tra xem các biện pháp chống thoát container có hiệu quả không.
Liên kết skill
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/escaping-containers-to-host/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm thế nào để thoát khỏi container này sang hệ thống máy chủ?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ khai thác các cấu hình sai hoặc lỗ hổng trong phần mềm quản lý container. Khi tìm được lỗi như vậy, nó cho phép thực thi lệnh trực tiếp trên hệ thống máy chủ.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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:
- Misconfiguration escapes — privileged containers,
CAP_SYS_ADMIN, host PID/IPC/Network namespaces, andhostPathmounts. - 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. - The "Leaky Vessels" runC fd leak, CVE-2024-21626 — runC leaks an internal file descriptor (
/proc/self/fd/7/8) referencing the host filesystem beforepivot_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). - 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 appliesmaskedPaths/readonlyPaths, allowing read-write access to/procentries (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/shadowaccess, 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.
…
Câu hỏi thường gặp
“Container” là gì?
Container giống như một hộp cô lập chứa chương trình và mọi thứ cần thiết để nó chạy. Nhờ đó chương trình hoạt động giống nhau trên mọi máy tính.
“Thoát container ra host” nghĩa là gì?
Nghĩa là phá vỡ được hộp cô lập (container) và truy cập vào máy tính chính (host) nơi hộp đó đang chạy.
Điều này có nguy hiểm không?
Có, đây là kỹ thuật bảo mật nâng cao. Chỉ nên dùng trong các bài kiểm thử được phép trên hệ thống bạn có quyền kiểm tra, vì nó có thể cho phép kiểm soát toàn bộ máy chủ.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 35k
- Vị trí xếp hạng
- #7890
- Giấy phép
- Apache-2.0
- Cập nhật
- 31/8/2026
Bình luận
- …
Thêm skill từ kho mã này
abusing-dpapi-for-credential-access
35kCung cấp cho agent AI của bạn hướng dẫn có sẵn cho một tác vụ cụ thể, giúp nó làm việc tốt hơn và nhanh hơn.
abusing-shadow-credentials-for-privesc
35kDạy agent AI của bạn viết văn bản rõ ràng và có cấu trúc tốt.
achieving-cmmc-level-2-compliance
35kGiúp agent của bạn chuẩn bị môi trường để tuân thủ CMMC Level 2. Triển khai các yêu cầu bảo mật và quản lý tài liệu cần thiết.
acquiring-disk-image-with-dd-and-dcfldd
35kGiúp agent của bạn tạo bản sao chính xác của ổ đĩa. Cách này đảm bảo không mất hay thay đổi thông tin trong quá trình điều tra.
Skill tương tự
add-model-provider
394kGiúp agent của bạn kết nối nhà cung cấp mô hình AI mới với OpenClaw bằng lệnh an toàn, giữ API key khỏi văn bản thuần và chạy thử.
acp-router
394kGiúp agent của bạn gửi một tác vụ đến trợ lý lập trình như Claude Code hoặc Cursor qua OpenClaw, để công việc chạy ngay trong công cụ đó.
browser-automation
394kHướng dẫn agent của bạn điều khiển trang web từng bước, gồm đăng nhập, tab và cách khôi phục khi trang ngừng phản hồi.