Skip to content
Misconfiguration Write-up Intermediate

Kubernetes Exploit | What is Kubernetes ? how to exploit exploit K8

An exposed Kubelet API on its default port allowed listing pods and running commands inside a pod, which returned root access. The author notes that a service account token found in a container could be used to move laterally or escalate to the whole cluster.

FreakyDodo Follow

Published on systemweakness.com

In this blog we will discuss about Kubernetes, What is Kubernetes ? how to exploit kubernetes and many more.

FreakyDodo, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the Kubelet API was exposed without authentication or authorisation, allowing anonymous pod listing and command execution.

Impact

An attacker could run commands in a pod as root and, if the service account token is privileged, could move laterally and compromise the entire cluster.

What the attacker needed

Network access to Kubelet port 10250; Kubelet allows anonymous access

The fix

The Kubelet API should require authentication and authorisation and should not be reachable from untrusted networks.

How it was found

  1. Scan the target to find open Kubernetes-related ports.
  2. Query the Kubelet API on port 10250 to list pods.
  3. Use kubeletctl to scan which pods allow command execution.
  4. Execute a command inside the nginx pod and obtain root access.
  5. Read the service account token from the container filesystem.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Kubernetes is software that runs and manages many containers (small packaged apps) across machines. Each machine runs an agent called Kubelet that the cluster uses to control containers. Here that agent was reachable from the network without proper protection, so anyone could ask it to list pods and run commands inside them.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by FreakyDodo

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.