Giter Club home page Giter Club logo

mtkpi's Introduction

MTKPI

License: MIT Github Stars PRs Welcome Docker Pulls MTKPI

Logo

MTKPI โ€“ Multi Tool Kubernetes Pentest Image. This docker image contains all the most popular and necessary tools for Kubernetes penetration testing. Everything you need at your fingertips.

Image was generated by Kandinsky 2.2

Disclaimer

Warning

This is a tool for testing purpose only, do not use it for malicious acts. Some tools inside MTKPI can adversely affect the entire cluster, which in turn can lead to data corruption. Test environments with multiple nodes can be deployed with KIND

Motivation

When you're pentesting a Kubernetes cluster, you'll certainly use automated tools to perform the checks. But what if your cluster is network-limited and you can't download the tools you need inside the Pod? Or a read-only container file system? In this case, the only solution is to use a ready-to-use image, inside of which there are all the tools you need. This image includes all possible popular tools for pentesting a Kubernetes cluster, including those with automatic checks.

Threat Matrix for Kubernetes

Logo MTKPI covers most of the techniques described in Microsoft Threat Matrix for Kubernetes. This in turn provides a wide range of pentesting possibilities. If necessary, you can add the necessary tools to the image and increase the coverage of the matrix.

What's inside?

Shell via web

Often, when pentesting Kubernetes Cluster, you have a developer Service Account with limited permissions. In other words, you don't have sufficient permissions to run pods/exec, which means you just can't get inside the container. However, it's more common for developers to have rights to create port-forward. This is why I used ttyd as the base image โ€• it is a simple command-line tool for sharing terminals over the web.

Tools

For convenience, I also have made a list of all possible tools that can be useful when pentesting Kubernetes and packed it in an image:

Bypass signature engine

Sometimes, runtime security tools are found in Kubernetes clusters that work on a signature-based approach. Security tools like Falco and Tracee are quite easy to bypass, as their behavior is predefined by rules and signatures. There are quite a few ways to do this, one of the simplest being to rename executables. This is the method used in MTKPI.

For example:

  • kubectl โ†’ k
  • python3 โ†’ pton3
  • curl โ†’ kurl
  • wget โ†’ vget

You can read more about the ways to bypass Falco here.

Usage

For fast deployment, run the following command:

kubectl apply -f https://raw.githubusercontent.com/r0binak/MTKPI/main/deploy/mtkpi.yaml

Pod:

apiVersion: v1
kind: Pod
metadata:
  name: mtkpi-pod
  labels:
    app: mtkpi
spec:
  containers:
  - name: mtkpi-pod
    image: r0binak/mtkpi:v1
    ports:
    - containerPort: 7681
    securityContext:
      readOnlyRootFilesystem: true

Service:

apiVersion: v1
kind: Service
metadata:
  name: mtkpi-svc
  labels:
    app: mtkpi
spec:
  type: ClusterIP
  ports:
  - port: 7681
    protocol: TCP
  selector:
    app: mtkpi

To access the container, just run the command:

kubectl port-forward mtkpi-pod 7681:7681

Open in your browser:

localhost:7681

In action

Contributing

If you liked this, I'd appreciate some PR ๐Ÿ™‚

References

mtkpi's People

Contributors

n0nvme avatar r0binak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mtkpi's Issues

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.