offensive-container-escape

Featured

Container escape and breakout techniques targeting Docker, containerd, and Podman runtimes. Covers privileged container breakout via host filesystem mount and nsenter, Docker socket abuse through /var/run/docker.sock, Linux capability exploitation including CAP_SYS_ADMIN, CAP_SYS_PTRACE, and CAP_NET_ADMIN, cgroup v1 notify_on_release escape, runc CVEs such as CVE-2019-5736 and CVE-2024-21626 Leaky Vessels, kernel exploits from within containers, and Dockerfile misconfigurations like --privileged and host namespace sharing. Includes enumeration with capsh, amicontained, deepce, CDK, and nsenter. Maps to MITRE ATT&CK T1611 Escape to Host. Use this skill when the engagement scope includes container breakout, Docker escape, container privilege escalation, host access from container, or when you land inside a containerized environment and need to reach the underlying host.

DevOps & Infrastructure 3,234 stars 523 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
100
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Container Escape and Breakout You have a shell inside a container. Your objective is to break out to the underlying host operating system. Container isolation relies on Linux namespaces, cgroups, seccomp profiles, AppArmor/SELinux, and dropped capabilities. Every misconfiguration in these layers is an escape vector. This skill walks you through systematic enumeration, exploitation of common misconfigurations, abuse of exposed runtime sockets, capability-based escapes, cgroup breakouts, and known CVEs against container runtimes. ## Quick Workflow 1. Confirm you are inside a container (check for `.dockerenv`, cgroup entries, PID 1 process). 2. Enumerate capabilities, mounts, namespaces, and sockets with automated tools. 3. Identify the escape vector: privileged mode, socket exposure, dangerous capabilities, cgroup misconfiguration, or vulnerable runtime. 4. Execute the breakout technique matching the vector. 5. Validate host access by reading `/etc/hostname`, checking PID namespace, or writing to host filesystem. 6. Pivot from host access to lateral movement across the cluster or infrastructure. --- ## Phase 1: Container Detection and Enumeration Before attempting escape, confirm you are containerized and map the attack surface. ### Detecting Container Environment ```bash # Check for Docker marker file ls -la /.dockerenv # Check cgroup entries for container identifiers cat /proc/1/cgroup | grep -E 'docker|containerd|kubepods|podman' # Check PID 1 process (containers...

Details

Author
SnailSploit
Repository
SnailSploit/Claude-Red
Created
6 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category