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

106 lines
3.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 8086 - Pentesting InfluxDB
{{#include ../banners/hacktricks-training.md}}
## Basiese Inligting
**InfluxDB** is 'n oopbron **tydreeksdatabasis (TSDB)** ontwikkel deur InfluxData. TSDB's is geoptimaliseer vir die stoor en bedien van tydreeksdata, wat uit tydstempel-waarde pare bestaan. In vergelyking met algemene doeleindes databasis, 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
```
## Enumerasie
Van '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.
### Verifikasie
InfluxDB mag verifikasie vereis of nie
```bash
# Try unauthenticated
influx -host 'host name' -port 'port #'
> use _internal
```
As jy **'n fout soos** hierdie een 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
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
```
#### Wys tabelle/metings
Die [**InfluxDB dokumentasie**](https://docs.influxdata.com/influxdb/v1.2/introduction/getting_started/) verduidelik dat **metings** in InfluxDB parallel met SQL tabelle kan wees. 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
```
#### Wys kolomme/veld sleutels
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 Tabel
En uiteindelik kan jy **die tabel dump** 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
```
> [!WARNING]
> In sommige toetse met die outentikasie omseiling is opgemerk dat die naam van die tabel tussen dubbele aanhalings moes wees soos: `select * from "cpu"`
### Geoutomatiseerde Outentikasie
```bash
msf6 > use auxiliary/scanner/http/influxdb_enum
```
{{#include ../banners/hacktricks-training.md}}