offensive-k8s-attacks
Fail
Audited by Gen Agent Trust Hub on Aug 27, 2026
Risk Level: CRITICALCREDENTIALS_UNSAFEDATA_EXFILTRATIONPRIVILEGE_ESCALATIONPERSISTENCECOMMAND_EXECUTIONDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
- [CREDENTIALS_UNSAFE]: The skill instructs the agent to read highly sensitive files including service account tokens at
/var/run/secrets/kubernetes.io/serviceaccount/token, host system secrets in/etc/shadow, and Kubernetes API secrets. It also targets cloud-specific metadata services (AWS IMDS, GCP Metadata Server, and Azure IMDS) to extract IAM security credentials and OAuth2 access tokens. - [DATA_EXFILTRATION]: Contains patterns for exfiltrating stolen service account tokens to an external domain (
attacker.com) by embedding them in DNS queries usingnslookup. - [PRIVILEGE_ESCALATION]: Provides specific techniques for container escape and host compromise. This includes using
nsenterto enter host namespaces from a privileged container, and deploying new pods withhostPID,hostNetwork, andhostPathconfigurations that mount the host's root filesystem (/). It also includes instructions for abusing RBAC permissions to createcluster-adminbindings. - [PERSISTENCE]: Includes methods for maintaining long-term access to a cluster by deploying a
DaemonSetthat runs on every node to maintain a command-and-control (C2) beacon or reverse shell. Additionally, it provides instructions for modifying the host'sauthorized_keysfile to grant SSH access. - [COMMAND_EXECUTION]: Orchestrates lateral movement and remote command execution by using
kubectl execand abusing the Kubelet API (port 10250) to run commands in containers, effectively bypassing standard API server authorization. - [DYNAMIC_EXECUTION]: Frequently utilizes
python3 -cto execute inline scripts that dynamically parse and manipulate JSON data retrieved from Kubernetes APIs and external services. - [INDIRECT_PROMPT_INJECTION]: The skill represents a significant attack surface as it ingests untrusted data from Kubernetes API responses, Kubelet metrics, and cloud metadata services. This data is subsequently used to build and execute further shell commands and Python scripts without validation or sanitization, which could allow a malicious cluster environment to influence the agent's actions.
- Ingestion points: Kubernetes API endpoints (via
curlandkubectl), Kubelet API responses, and Cloud Metadata Service responses (AWS/GCP/Azure). - Boundary markers: None identified in the instructional content.
- Capability inventory: Full subprocess control via
kubectl,curl,nsenter, and file-writing capabilities on the host filesystem. - Sanitization: Minimal; the skill relies on standard JSON parsing without specific validation of the values returned from the cluster environment.
Recommendations
- HIGH: Downloads and executes remote code from: http://NODE_IP:10255/pods - DO NOT USE without thorough review
- AI detected serious security threats
- Contains 2 malicious URL(s) - DO NOT USE
Audit Metadata