agentleFS
NoorQureshiNoorQureshi/SploitAgent/skills/cloud/cloud-kubernetes/SKILL.md

cloud-kubernetes

Skill26 starsChanged 31 days agoMITView on GitHub

Attack exposed Kubernetes: API server, kubelet, etcd, dashboards, and RBAC. Load on k8s signals — ports 6443/10250/2379/8443, /api/v1, kube-dns, a pod foothold, or "kubernetes/k8s". Signals: kubectl, service-account tokens, exposed dashboard, container in a cluster.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    From a pod: read the mounted token /var/run/secrets/kubernetes.io/serviceaccount/.

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Kubernetes attacks

When it applies

A Kubernetes control-plane or node component is reachable (externally or from a pod foothold), or you landed in a container inside a cluster and want to escalate to cluster admin / other tenants.

Why it works

k8s exposes powerful HTTP APIs that are frequently unauthenticated or over-permissioned: anonymous API access, kubelet read/exec on 10250, unauth etcd (all secrets), and mounted service-account tokens with broad RBAC. One over-scoped token = cluster takeover.

Method

  1. From outside: kube-hunter; probe API server 6443 (/api/v1 anonymous), kubelet 10250 (/pods, /run exec), etcd 2379 (keys→secrets), and exposed dashboards (8443/anonymous).
  2. From a pod: read the mounted token /var/run/secrets/kubernetes.io/serviceaccount/; kubectl auth can-i --list to see what it grants.
  3. Escalate via RBAC: over-permissioned SA → create/exec pods, read secrets across namespaces, or create pods with a hostPath/privileged spec to mount the node (→ node/cluster takeover).
  4. Container→node breakout: privileged pod, hostPID/hostNetwork, or a hostPath mount to the host filesystem (→ cloud-container-escape).
  5. Loot: kubectl get secrets -A, cloud IAM via node metadata (→ cloud-imds-ssrf).

Gotchas

  • kubectl auth can-i --list first — it tells you exactly what the token can do; don't guess.
  • Anonymous API/kubelet is common in labs and misconfigured clusters — always test unauth.
  • On bug bounty, prove access read-only where possible; creating privileged pods is high-impact — mind RoE.

Verify success

Cluster-level access proven: reading secrets across namespaces, exec into others' pods, or node filesystem/cloud-creds access from an over-scoped token.

References

kube-hunter/peirates; NCC "Kubernetes security"; MITRE ATT&CK Containers.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.