Docker group membership is often seen as "not quite root" - but that's wrong. Being in the docker group is effectively root access because you can mount the entire host filesystem into a container you control.
Think of it like having the keys to a warehouse of forklifts. You might not have the manager's office key, but you can drive a forklift through the wall. Docker lets you run containers that access the host as root - game over.
Docker = Root
If you're in the docker group, you have root. Always. There's no "safe" way to be in the docker group as a non-root user without having root-equivalent access to the host.
Checking Docker Access
Host Filesystem Mount
The classic docker privilege escalation: mount the host's root filesystem into a container, then access it as root inside the container.
Alternative Images
Docker Socket Mount
Docker-in-Docker
Mounting docker.sock into containers is common for CI/CD but creates a direct privilege escalation path. Any code in that container can fully compromise the host.
Privileged Container Escape
Capability-Based Escapes
Exploitation Without Internet
Docker Persistence
Detecting Container Environment
Docker Escalation Methodology
Docker Privilege Escalation Flow
1
Check Accessid, groups - look for docker group
2
Test Dockerdocker ps to verify access
3
List Imagesdocker images for available images
4
Mount Hostdocker run -v /:/mnt alpine...
5
Access Rootchroot into mounted host filesystem
6
PersistAdd SSH key, SUID binary, or user
Knowledge Check
Challenges
Key Takeaways
- Docker group = root equivalent access
- Mount host filesystem: docker run -v /:/mnt
- Use chroot to operate on host as root
- Check for /.dockerenv to detect containers
- Privileged containers have additional escape vectors
- Always establish persistence after docker escalation