Hacker Container for Kubernetes Security Assessments
Tags: kubernetes, security, pentesting, hacking
Published: 2020-06-24 21:19:25

---
title: Hacker Container for Kubernetes Security Assessments
published: true
date: 2020-06-06 21:42:54 UTC
tags: kubernetes,security,pentesting,hacking
canonical_url: https://blog.madhuakula.com/hacker-container-for-kubernetes-security-assessments-7d1522e96073
---

![](https://cdn-images-1.medium.com/max/1024/1*VCveDv7bjGIxdX1lPzR9qA.png)<figcaption><a href="https://worditout.com/word-cloud/4251548/private/752ede061babc4da45ef0d8ea0599924">https://worditout.com/word-cloud/4251548/private/752ede061babc4da45ef0d8ea0599924</a></figcaption>

#### Your go to container for hacking Kubernetes Clusters

Hacker Container is a simple alpine based docker container with commonly used tools and utilities while performing security assessments for containerised and Kuberentes cluster environments.

The repository and project information can be found here [https://github.com/madhuakula/hacker-container](https://github.com/madhuakula/hacker-container)

[madhuakula/hacker-container](https://github.com/madhuakula/hacker-container)

### Why Hacker Container?

While performing and testing container or Kubernetes infrastructure, I always have to install some common tools inside a container to perform further exploitation and later movement with in the cluster.

To give an example, I have found redis service within the cluster without any authentication and network security policies. So I had to install and setup redis-cli to communicate and see what more data I can get from the server.

In another case, I wanted to understand what all privileges and capabilities I had for the container. So I end up running amicontained or capsh --print

![](https://cdn-images-1.medium.com/max/1024/1*qajv7-YNeSuRLjl6JO3TlA.png)<figcaption>Hacker Container in Action running amicontained</figcaption>

#### Some use cases why we need all tools in one container?

Having multiple tools and processes running in a single container is not a good approach in real-world. This container is not for running production workloads or real-world applications.

- Consider that we want to perform a white box security assessment of Kubernetes cluster, and we got one pod access with limited privileges in the cluster. In this scenario we can use this container as an attacker, with all the utilities to perform assessment and understand cluster environment. Similarly in black box assessments as well, it helps you with all the utilities in a single place to perform further exploitation
- Also, there could be an usecase where your cluster doesn’t have internet access and wanted to perform specific assessment. You end up downloading required tools and build it from scratch with all the requirements. Hence using this container helps you to gain more time in identifying and exploiting vulnerabilities in the infrastructure instead of investing time in setup

### What tools are available in this container

There are almost nearly 50 commonly used tools and utilities for hackers, security researchers and penetration testers. The detailed list of tools can be found at [https://github.com/madhuakula/hacker-container/blob/master/list.todo](https://github.com/madhuakula/hacker-container/blob/master/list.todo)

The idea behind these tools is not to add all of them and making a big fat container. But just adding useful utilities or commonly highly required tools while performing containerised security assessments.

### How to use Hacker Container?

The simplest way to get started with Hacker container is trying out the container in [Play With Docker](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/madhuakula/hacker-container/master/docker-stack.yml)

[![](https://cdn-images-1.medium.com/max/132/1*CEpGvJgqKoXToqMv8bl-8g.png)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/madhuakula/hacker-container/master/docker-stack.yml)

- Just run the following command to explore in the docker container environments

```
docker run --rm -it madhuakula/hacker-container
```

- To deploy as a Pod in Kubernetes cluster run the following command

```
kubectl run -it hacker-container --image=madhuakula/hacker-container
```

> _This container can be used in different ways in different environments, it aids your penetration testing or security assessments of container and Kubernetes cluster environments._

Hope this helpful for fellow researchers, security engineers/testers and I would love to hear your feedback/suggestions. Feel free to tweet to me [**@madhuakula**](https://twitter.com/madhuakula) or create an issue at [**Github**](https://github.com/madhuakula/hacker-container)

#### Thanks for reading this article. If you enjoyed it please let me know by clicking that clap below :)

* * *