hacktricks/network-services-pentesting/8086-pentesting-influxdb.md

149 lines
6.9 KiB
Markdown
Raw Normal View History

2022-08-31 22:35:39 +00:00
# 8086 - Pentesting InfluxDB
2022-04-28 16:01:33 +00:00
<figure><img src="../.gitbook/assets/image (48).png" alt=""><figcaption></figcaption></figure>
2022-08-31 22:35:39 +00:00
\
Gebruik [**Trickest**](https://trickest.com/?utm_source=hacktricks&utm_medium=text&utm_campaign=ppc&utm_content=8086-pentesting-influxdb) om maklik **werkvloei** te bou en te **automate** wat aangedryf word deur die wêreld se **mees gevorderde** gemeenskapstools.\
Kry Toegang Vandag:
2022-08-31 22:35:39 +00:00
{% embed url="https://trickest.com/?utm_source=hacktricks&utm_medium=banner&utm_campaign=ppc&utm_content=8086-pentesting-influxdb" %}
2022-04-28 16:01:33 +00:00
{% hint style="success" %}
Leer & oefen 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">\
Leer & oefen 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)
2022-04-28 16:01:33 +00:00
<details>
2022-04-28 16:01:33 +00:00
<summary>Support HackTricks</summary>
2024-01-03 11:42:55 +01:00
* Kyk na die [**subskripsie planne**](https://github.com/sponsors/carlospolop)!
* **Sluit aan by die** 💬 [**Discord groep**](https://discord.gg/hRep4RUj7f) of die [**telegram groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Deel hacking truuks deur PRs in te dien na die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>
{% endhint %}
2022-04-28 16:01:33 +00:00
2024-02-11 02:07:06 +00:00
## Basiese Inligting
**InfluxDB** is 'n oopbron **tydreeks databasis (TSDB)** wat deur InfluxData ontwikkel is. TSDB's is geoptimaliseer vir die stoor en bedien van tydreeksdata, wat bestaan uit tydstempel-waarde pare. In vergelyking met algemene doeleindesdatabasisse, bied TSDB's beduidende verbeterings in **stoorplek** en **prestasie** vir tydreeksdatastelle. Hulle gebruik gespesialiseerde kompressie-algoritmes en kan gekonfigureer word om outomaties ou data te verwyder. Gespesialiseerde databasisindekse verbeter ook navraagprestasie.
**Standaard poort**: 8086
```
PORT STATE SERVICE VERSION
8086/tcp open http InfluxDB http admin 1.7.5
```
## Enumeration
Vanuit 'n pentester se oogpunt is dit 'n ander databasis wat sensitiewe inligting kan stoor, so dit is interessant om te weet hoe om al die inligting te dump.
### Authentication
InfluxDB mag vereis dat daar geverifieer word of nie
```bash
# Try unauthenticated
influx -host 'host name' -port 'port #'
> use _internal
```
As jy **'n fout soos** hierdie kry: `ERR: unable to parse authentication credentials` beteken dit dat dit **verwag dat daar sekere geloofsbriewe** is.
```
influx username influx password influx_pass
```
Daar was 'n kwesbaarheid in influxdb wat toegelaat het om die outentisering te omseil: [**CVE-2019-20933**](https://github.com/LorenzoTullini/InfluxDB-Exploit-CVE-2019-20933)
### Handmatige Enumerasie
2024-02-11 02:07:06 +00:00
Die inligting van hierdie voorbeeld is geneem van [**hier**](https://oznetnerd.com/2017/06/11/getting-know-influxdb/).
#### Wys databasisse
Die gevonde databasisse is `telegraf` en `internal` (jy sal hierdie een oral vind)
```bash
> show databases
name: databases
name
----
telegraf
_internal
```
#### Show tables/measurements
Die [**InfluxDB dokumentasie**](https://docs.influxdata.com/influxdb/v1.2/introduction/getting\_started/) verduidelik dat **metings** in InfluxDB parallel kan wees met SQL-tabelle. Die nomenklatuur van hierdie **metings** is aanduidend van hul onderskeie inhoud, elkeen huisves data wat relevant is vir 'n spesifieke entiteit.
```bash
> show measurements
name: measurements
name
----
cpu
disk
diskio
kernel
mem
processes
swap
system
```
2024-02-11 02:07:06 +00:00
#### Wys kolomme/veld sleutels
2024-02-11 02:07:06 +00:00
Die veld sleutels is soos die **kolomme** van die databasis
```bash
> show field keys
name: cpu
fieldKey fieldType
-------- ---------
usage_guest float
usage_guest_nice float
usage_idle float
usage_iowait float
name: disk
fieldKey fieldType
-------- ---------
free integer
inodes_free integer
inodes_total integer
inodes_used integer
[ ... more keys ...]
```
#### Dump Table
En uiteindelik kan jy **dump die tabel** deur iets soos
```bash
select * from cpu
name: cpu
time cpu host usage_guest usage_guest_nice usage_idle usage_iowait usage_irq usage_nice usage_softirq usage_steal usage_system usage_user
---- --- ---- ----------- ---------------- ---------- ------------ --------- ---------- ------------- ----------- ------------ ----------
1497018760000000000 cpu-total ubuntu 0 0 99.297893681046 0 0 0 0 0 0.35105315947842414 0.35105315947842414
1497018760000000000 cpu1 ubuntu 0 0 99.69909729188728 0 0 0 0 0 0.20060180541622202 0.10030090270811101
```
{% hint style="warning" %}
In sommige toetse met die outentikasie omseiling is opgemerk dat die naam van die tabel tussen dubbele aanhalings moet wees soos: `select * from "cpu"`
{% endhint %}
### Geoutomatiseerde Outentikasie
```bash
msf6 > use auxiliary/scanner/http/influxdb_enum
```
{% hint style="success" %}
Leer & oefen AWS Hacking:<img src="/.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Opleiding AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="/.gitbook/assets/arte.png" alt="" data-size="line">\
Leer & oefen GCP Hacking: <img src="/.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Opleiding GCP Red Team Expert (GRTE)**<img src="/.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
<details>
2022-04-28 16:01:33 +00:00
<summary>Ondersteun HackTricks</summary>
2024-01-03 11:42:55 +01:00
* Kyk na die [**subskripsie planne**](https://github.com/sponsors/carlospolop)!
* **Sluit aan by die** 💬 [**Discord groep**](https://discord.gg/hRep4RUj7f) of die [**telegram groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Deel hacking truuks deur PRs in te dien na die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>
{% endhint %}
2022-04-28 16:01:33 +00:00
<figure><img src="../.gitbook/assets/image (48).png" alt=""><figcaption></figcaption></figure>
2022-08-31 22:35:39 +00:00
\
Gebruik [**Trickest**](https://trickest.com/?utm_source=hacktricks&utm_medium=text&utm_campaign=ppc&utm_content=8086-pentesting-influxdb) om maklik te bou en **werkvloei** te **automate** wat deur die wêreld se **mees gevorderde** gemeenskap gereedskap aangedryf word.\
Kry Toegang Vandag:
2022-04-28 16:01:33 +00:00
{% embed url="https://trickest.com/?utm_source=hacktricks&utm_medium=banner&utm_campaign=ppc&utm_content=8086-pentesting-influxdb" %}