Kubernetes Pentesting
Common Ports
Port
Service
Description
Discovery
Identifying Kubernetes
# SSL cert inspection reveals K8s
curl -k https://TARGET:8443/
# Response contains: "User \"system:anonymous\" cannot get path"
# Headers: X-Kubernetes-Pf-Flowschema-Uid
# Check common endpoints
curl -k https://TARGET:8443/version
curl -k https://TARGET:8443/healthz
curl -k https://TARGET:8443/readyz
curl -k https://TARGET:8443/livez
curl -k https://TARGET:8443/api
curl -k https://TARGET:8443/api/v1SSL Certificate Indicators
Kubelet API (Port 10250)
Manual Enumeration
kubeletctl Tool
Service Account Token Extraction
kubectl with Stolen Token
Privilege Escalation via Malicious Pod
Basic Host Mount Pod
Privileged Pod with Host Access
Deploy and Access
Container Breakout Techniques
Via Host Mount
Via Privileged Container
Useful API Endpoints
Quick Reference
References
Last updated