Cloud container escape

From NoorQureshi/security-skills · View interactive version

Cloud container escape is an AI agent skill from the GitHub repository NoorQureshi/security-skills. Break out of a container to the host. Load when you have a shell in a container/pod and want the node: privileged container, mounted docker.sock, dangerous capabilities, hostPath, or "escape the container". Signals: /.dockerenv, cgroup shows docker/k8s, CAP_SYS_ADMIN, mounted socket.

How to use this skill

Skill file

Container escape → host

When it applies

You have code execution inside a container and want the underlying host (and from there, other

containers / the cluster / cloud creds).

Why it works

Containers are isolation by configuration, not a hard boundary. Privileged mode, extra

capabilities, mounted host resources, or an exposed Docker socket give processes inside the

container direct control over the host kernel/daemon.

Method

  1. Confirm & enumerate: /.dockerenv, /proc/1/cgroup; run amicontained/deepce to list

capabilities, seccomp, and mounts.

  1. Exploit the misconfig:

→ mount host FS as root → escape.

cgroup notify_on_release trick to run a command on the host.

  1. From the host: grab cloud metadata creds (→ cloud-imds-ssrf), pivot to other

containers/nodes (→ cloud-kubernetes).

Gotchas

Verify success

Command execution or file read/write on the host (outside the container namespace) — e.g. host

/etc/shadow, other containers, or the kubelet/cloud creds.

References

deepce/amicontained; "Understanding Docker container escapes" (Trail of Bits); HackTricks.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.