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:

  1. Kubernetes Secrets (API keys, passwords, certificates)

  2. ConfigMaps (configuration data, connection strings)

  3. Service Account Tokens (authentication credentials)

  4. Container Images (embedded secrets, source code)

  5. Persistent Volumes (application data, databases)

  6. etcd Database (complete cluster state)

  7. Application Logs (sensitive information leakage)

  8. 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

Loot all data from etcd:

Last updated

Was this helpful?