acl-abuse
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Container escape, Docker breakout, and Kubernetes exploitation.
$ npx -y skills add blacklanternsecurity/red-run --skill container-escapes --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/container-escapesContext preview
The summary Claude sees to decide when to auto-load this skill.
Container escape, Docker breakout, and Kubernetes exploitation.
name: container-escapes description: > Container escape, Docker breakout, and Kubernetes exploitation. keywords: - container escape - docker breakout - escape this container - I'm in a container - kubernetes exploitation - pod escape - privileged container - docker socket - docker desktop - WSL2 container - k8s pentest - service account token - kubelet - etcd - container enumeration - am I in a container - cgroup escape - nsenter - hostPID - hostNetwork - cap_sys_admin container tools: - kubectl - crictl - ctr - CDK - deepce - amicontained - linpeas - curl (for API interaction) - nsenter opsec: medium
You are helping a penetration tester escape from a containerized environment or exploit a Kubernetes cluster. All testing is under explicit written authorization.
Check for `./engagement/` directory. If absent, proceed without logging.
When an engagement directory exists:
descriptive filenames (e.g., `sqli-users-dump.txt`, `ssrf-aws-creds.json`).
Call `get_state_summary()` from the state MCP server to read current engagement state. Use it to:
Your return summary must include:
kubelet (10250/10255), or etcd (2379)
First, confirm you're in a container and identify the type and security posture.
# Quick checks ls -la /.dockerenv 2>/dev/null && echo "DOCKER CONTAINER" ls -la /run/.containerenv 2>/dev/null && echo "PODMAN CONTAINER" cat /proc/1/cgroup 2>/dev/null | grep -qiE "docker|containerd|kubepods|lxc|podman" && echo "CONTAINERIZED" # Kubernetes pod detection ls /var/run/secrets/kubernetes.io/serviceaccount/ 2>/dev/null && echo "KUBERNETES POD" env | grep -q KUBERNETES && echo "KUBERNETES POD" # Docker Desktop / WSL2 detection — narrows escape vectors significantly uname -r | grep -q "microsoft-standard-WSL2" && echo "DOCKER DESKTOP (WSL2 backend)" # Container runtime detection cat /proc/1/cgroup 2>/dev/null | head -5 cat /proc/self/mountinfo 2>/dev/null | head -20
Capabilities determine which escape techniques are available.
# Current capabilities capsh --print 2>/dev/null cat /proc/self/status | grep -i cap 2>/dev/null # Decode capability bitmask # CapEff: 0000003fffffffff = ALL capabilities (privileged) # CapEff: 00000000a80425fb = Default Docker capabilities # Quick privileged check — these only exist in privileged containers test -e /dev/kmsg && echo "LIKELY PRIVILEGED" test -w /proc/sys/kernel/core_pattern && echo "PRIVILEGED — /proc writable" fdisk -l 2>/dev/null | head -5 && echo "DEVICE ACCESS — PRIVILEGED" mount | grep -q "sysfs.*rw" && echo "SYSFS WRITABLE — PRIVILEGED"
**Key capabilities for escape:**
| Capability | Escape Technique | |-----------|-----------------| | `cap_sys_admin` | Mount host fs, cgroup release_agent, BPF | | `cap_sys_ptrace` | Process injection, /proc/[pid]/mem write | | `cap_sys_module` | Load kernel module (rootkit/reverse shell) | | `cap_dac_override` | Read/write any file | | `cap_dac_read_search` | Read any file (Shocker exploit) | | `cap_sys_rawio` | Raw I/O (/dev/mem, /dev/kmem) | | `cap_net_admin` | Network manipulation, ARP spoof | | `cap_net_raw` | Packet sniffing, raw sockets |
# Current user and permissions
id
whoami
# Container ID
hostname # Often the container ID
cat /proc/self/cgroup | grep -oP '[a-f0-9]{64}' | head -1
# Mounted filesystems (look for host mounts)
mount | grep -vE "^(proc|tmpfs|devpts|sysfs|cgroup)"
cat /proc/self/mountinfo | grep -vE "proc|tmpfs|devpts|sysfs|cgroup"
# Look for Docker socket
ls -la /var/run/docker.sock 2>/dev/null
ls -la /run/docker.sock 2>/dev/null
ls -la /var/run/containerd/containerd.sock 2>/dev/null
ls -la /run/containerd/containerd.sock 2>/dev/null
ls -la /var/run/crio/crio.sock 2>/dev/null
# Environment variables (credentials, configs)
env | sort
# Kubernetes-specific
cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null
cat /var/run/secrets/kubernetes.io/serviceaccount/namespace 2>/dev/null
echo "K8S API: $KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT"
# Network info
ip addr 2>/dev/null || ifconfig 2>/dev/null
ip route 2>/dev/null || route -n 2>/dev/null
cat /etc/resolv.conf
cat /etc/hosts
# Secrets and credentials on disk
find / -name "*.key" -o -name "*.pem" -o -name "*.cert" -o -name "*token*" \
-o -name "*secret*" -o -name "*.env" -o -name "config.json" 2>/dev/null | \
grep -v proc | grep -v sys | head -20# deepce — Docker Enumeration, Escalation, Container Escapes ./deepce.sh # Or from memory: curl -sL https://github.com/stealthcopter/deepce/raw/main/deepce.sh | bash # CDK — Container penetration toolkit ./cdk evaluate # amicontained — Container introspection ./amicontained # LinPEAS (container-aware) ./linpeas.sh
Present all findings and ask which escape vector to pursue.
**Prerequisite:** Docker socket mounted inside the container (`/var/run/doc
Security assessment toolkit for Claude Code. red-run combines skills, MCP servers, and Claude Code agent teams with routing logic that guides Claude and the operator through the phases of a security assessment — recon, initial access, lateral movement,
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted…
Enumerates Active Directory domains and maps attack surface for penetration testing.
Establishes persistent access in Active Directory environments after domain compromise. Covers DCShadow (rogue DC attribute modification), Skeleton Key (LSASS…
Exploits ADCS through ACL abuse on templates/CA objects and NTLM relay to enrollment endpoints. Covers ESC4 (template ACL → modify to ESC1), ESC5 (PKI object…
Establishes persistence and exploits weak certificate mapping in AD CS. Covers ESC9 (no security extension), ESC10 (weak certificate mapping), ESC12-15…
Exploits misconfigured AD CS certificate templates to impersonate any domain user via SAN manipulation or enrollment agent abuse. Covers ESC1 (enrollee…