Data Exfiltration
This section covers how to correctly loot a K8S cluster after full cluster compromise.
Overview
After establishing persistence capabilities, the final phase focuses on data exfiltration. This section covers techniques for extracting sensitive data from Kubernetes environments, including secrets, application data, and cluster configuration information.
Data Discovery Strategy
High-Value Targets in Kubernetes:
Kubernetes Secrets (API keys, passwords, certificates)
ConfigMaps (configuration data, connection strings)
Service Account Tokens (authentication credentials)
Container Images (embedded secrets, source code)
Persistent Volumes (application data, databases)
etcd Database (complete cluster state)
Application Logs (sensitive information leakage)
Environment Variables (embedded credentials)
Secret Discovery and Extraction
By looting those secrets we can either keep access to the cluster until they rotate or facilitate our lateral movement.
Interesting Secrets:
cluster's TLS secrets
Docker Registry credentials
Service account tokens
Basic Secret Discovery:
ConfigMap Data Extraction
Although ConfigMaps are not intended to store sensitive information, they are frequently misused to hold secrets such as credentials, API keys, and connection strings. In practice, developers often place configuration data and secrets together for convenience, making ConfigMaps a valuable target during post‑exploitation.
Persistent Volume Data Access
Persistent Volumes are used to store long‑lived and highly sensitive data such as application state, logs, backups, and databases. Once we have sufficient permissions to enumerate or mount Persistent Volumes and Persistent Volume Claims, we can identify which workloads use shared or reusable storage and directly access the underlying data.
By attaching an existing PVC to a controlled pod, we can read, archive, and exfiltrate stored information, bypassing application‑level protections and gaining access to credentials, configuration files, or historical data that may no longer be accessible through the running application itself.
PV and PVC Analysis:
Defining the Persistent Volume Claim:
Mounting and Accessing PV Data:
etcd Data Extraction
etcd Data ExtractionLoot all data from etcd:
Last updated
Was this helpful?