escaping-containers-to-host
यह क्या करती है
यह टूल आपको एक अलग-थलग (isolated) कंटेनर से बाहर निकलकर उस मुख्य सिस्टम (host) तक पहुंचने में मदद करता है, जिस पर कंटेनर चल रहा है। इसका इस्तेमाल कंटेनर की सुरक्षा टेस्ट करने के लिए होता है।
कब इस्तेमाल करें
- ✓इजाज़त लेकर कंटेनर की सुरक्षा टेस्ट करते समय।
- ✓गलत तरीके से की गई कंटेनर सेटिंग्स से होने वाला खतरा दिखाने के लिए।
- ✓यह जांचने के लिए कि कंटेनर से बाहर निकलने के खिलाफ सुरक्षा कितनी असरदार है।
Skill का लिंक
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/escaping-containers-to-host/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं इस कंटेनर से बाहर निकलकर होस्ट सिस्टम तक कैसे पहुंच सकता हूं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह कंटेनर चलाने वाले सॉफ्टवेयर की गलत सेटिंग्स या कमज़ोरियों का फायदा उठाता है। ऐसी कमी मिल जाने पर यह होस्ट सिस्टम पर सीधे कमांड चलाने देता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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:
- 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.
…
अक्सर पूछे जाने वाले सवाल
'कंटेनर' क्या होता है?
कंटेनर एक अलग-थलग डिब्बे जैसा होता है, जिसमें कोई प्रोग्राम और उसके चलने के लिए ज़रूरी सब कुछ रखा होता है। इससे प्रोग्राम हर कंप्यूटर पर एक जैसा चलता है।
'कंटेनर से होस्ट तक निकलना' (escaping) का क्या मतलब है?
इसका मतलब है उस अलग-थलग डिब्बे (कंटेनर) से बाहर निकल पाना और उस मुख्य कंप्यूटर (होस्ट) तक पहुंच पाना जहां वह डिब्बा चल रहा है।
क्या यह खतरनाक है?
हां, यह एक एडवांस सिक्योरिटी तकनीक है। इसे सिर्फ उन्हीं सिस्टम पर अधिकृत टेस्ट में इस्तेमाल करें जिनकी जांच की आपको इजाज़त है, क्योंकि इससे होस्ट सिस्टम पर पूरा कंट्रोल मिल सकता है।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 35k
- रैंकिंग में स्थान
- #7890
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 31/8/2026
कमेंट
- …
इस repository की और skills
abusing-dpapi-for-credential-access
35kआपके AI एजेंट को किसी खास काम के लिए तैयार instructions देता है, ताकि वह उसे बेहतर और तेज़ी से कर सके।
abusing-shadow-credentials-for-privesc
35kआपके AI एजेंट को साफ़ और अच्छी तरह से व्यवस्थित लिखना सिखाता है।
achieving-cmmc-level-2-compliance
35kयह आपके एजेंट को CMMC Level 2 compliance के लिए environment तैयार करने में मदद करता है। यह security requirements लागू करता है और ज़रूरी documentation संभालता है।
acquiring-disk-image-with-dd-and-dcfldd
35kआपके एजेंट को hard drives की exact copies बनाने में मदद करता है। जाँच के दौरान किसी भी जानकारी के खोने या बदलने से बचाने के लिए यह उपयोगी है।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।