/offensive-claude:container-k8s-escapefrom offensive-claude
Guides container breakout and Kubernetes privilege escalation: runc/BuildKit CVEs, privileged/capability/cgroup misconfigs, NVIDIA GPU escape, RBAC abuse, kubelet RCE, and node-to-cluster pivot.
Ships in offensive-claude. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
| 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 |
# 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 tooling: deepce / cdk / amicontained (in-container recon), peirates (K8s pivot),
kube-hunter (cluster scan), kubeletctl (kubelet API), crictl (post-escape node control),
falco (defensive validation of every technique below).
| Technique | Telemetry / IOC | Detection (Sigma/EDR/Falco) | OPSEC note |
|---|---|---|---|
| runc cwd-fd escape (CVE-2024-21626) | container process cwd under /proc/self/fd/N; getcwd ENOENT errors; host-path access from pid1 | Falco Container Drift/unexpected host-fs read; alert on runtime < runc 1.1.12 | No new files needed; works via -w/cwd only — very quiet, but lands on real host fs |
| runc 2025 trio (masked-path/console) | symlink swap of /dev/null or /dev/pts/N; RW open of /proc/sysrq-trigger/core_pattern | Falco "Write below /proc/sys"/sysrq; mount race anomalies | Symlink swap is a timing race; on failure may crash host (sysrq) — loud |
| release_agent / core_pattern | mount of cgroup/cgroup2; write to */release_agent or /proc/sys/kernel/core_pattern | Falco Detect release_agent File Container Escapes; Sigma on write to core_pattern | Requires CAP_SYS_ADMIN+mount; release_agent is cgroup-v1 only |
| nsenter / hostPID | nsenter --target 1; process entering host mount/pid ns | Falco "nsenter" / proc.name=nsenter in container; ATT&CK T1611 | hostPID is visible in pod spec; nsenter is a strong IOC |
| docker.sock abuse | /var/run/docker.sock mounted; curl --unix-socket create privileged container | Falco "Docker socket access by unexpected proc"; new privileged container event | Spawns a new privileged container — visible to docker/containerd events |
| NVIDIAScape (CVE-2025-23266) | image ENV LD_PRELOAD=/proc/self/cwd/*.so; nvidia hook loads .so from container fs | Falco shared-lib load by nvidia-ctk/hook from container path | Needs only image push + run; no kernel bug — image scan catches the ENV |
| nodes/proxy → kubelet exec | WebSocket GET to kubelet /exec//run on :10250; no API-server audit entry | Runtime/L7 only — invisible to API audit & GuardDuty; monitor kubelet access log | Bypasses API-server audit & admission entirely — extremely stealthy |
| K8s RBAC privesc / SA-token theft | read of /var/run/secrets/.../token; can-i probes; bind to cluster-admin | API audit create rolebindings/escalate; Falco Read SA token | kubectl auth can-i probing is logged at API server |
| IngressNightmare (CVE-2025-1974) | AdmissionReview with injected NGINX directive; .so loaded from /proc/<pid>/fd | Sysdig/Falco "IngressNightmare"; shared-lib load from /proc in nginx | Code runs during nginx -t validation; controller SA grabs all-namespace secrets |
/dev/console), and the BuildKit Leaky Vessels CVEs, with full PoCs and version matrices.--privileged/capability escapes: cgroup-v1 release_agent, core_pattern, hostPID+nsenter, mounted docker/containerd sockets, and hostPath// mounts, with complete scripts.LD_PRELOAD OCI-hook) and the CVE-2024-0132 / CVE-2025-23359 TOCTOU mount escapes in the NVIDIA Container Toolkit; build-and-run PoCs.escalate/bind, pods/exec, impersonation), SA-token harvest, the nodes/proxy GET → kubelet WebSocket exec RCE, and open kubelet :10250.references/ingress-admission-attacks.md (opens in a new tab)references/k8s-rbac-escalation.md (opens in a new tab)references/node-host-pivot.md (opens in a new tab)references/nvidia-gpu-escape.md (opens in a new tab)references/privileged-misconfig-escape.md (opens in a new tab)references/runtime-cve-escapes.md (opens in a new tab)scripts/escape_enum.sh (opens in a new tab)scripts/k8s_rbac_audit.py (opens in a new tab)scripts/kubelet_exec.py (opens in a new tab)scripts/nvidiascape_build.sh (opens in a new tab)scripts/release_agent_escape.sh (opens in a new tab)scripts/runc_cwd_escape.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub hypnguyen1209/offensive-claude --plugin offensive-claude38 skills in this plugin
/active-directory-attackUse when attacking a Windows Active Directory domain — Kerberos roasting/delegation, coercion + NTLM/Kerberos relay (CVE-2025-33073), ADCS ESC1-16 (EKUwu), ticket forgery & DCSync, dMSA BadSuccessor (CVE-2025-53779), BloodHound attack-path enumeration, domain dominance/advanced-redteam-opsUse when designing C2 infrastructure or OPSEC for a long-haul red-team op — redirectors, malleable profiles, tiered/segregated infra, living-off-the-land, data exfiltration/ai-agent-redteamUse when red-teaming an agentic AI / LLM application — indirect & zero-click prompt injection, MCP tool poisoning, persistent memory poisoning, excessive-agency tool abuse, multi-turn jailbreaks, PyRIT/Garak/Promptfoo harnesses/ai-securityUse when attacking an AI/ML system or model — prompt injection & jailbreaks (Crescendo, Skeleton Key, Best-of-N), RAG/vector poisoning, agentic/MCP exploitation (CVE-2025-54136), ML supply-chain RCE (pickle CVE-2025-32434), model extraction / membership inference / adversarial suffixes (GCG)/browser-exploitationUse when building a client-side browser exploit — V8/JSC JIT type confusion to renderer R/W, V8 heap-sandbox escape, renderer-to-browser sandbox escape (Mojo IPC, GPU/Dawn/ANGLE), Electron/webview IPC abuse, 1-click RCE chains/cicd-supply-chainUse when attacking or auditing a CI/CD pipeline or software supply chain — pwn requests, poisoned pipeline execution, compromised/mutable-tag actions, dependency confusion, registry worms, runner backdoors, OIDC trust abuse, SLSA/provenanceOther plugins' skills for the same job