8086 - Pentesting InfluxDB

使用 Trickest 可轻松构建并通过全球最先进的社区工具自动化工作流程。 立即获取访问权限:

从零开始学习 AWS 黑客技术,成为专家 htARTE(HackTricks AWS 红队专家)

支持 HackTricks 的其他方式:

基本信息

InfluxDB 是由 InfluxData 开发的开源时间序列数据库(TSDB)。TSDB 专为存储和提供时间序列数据而优化,这些数据由时间戳-值对组成。与通用数据库相比,TSDB 在时间序列数据集的存储空间性能方面提供了显著改进。它们采用专门的压缩算法,并可配置为自动删除旧数据。专门的数据库索引还增强了查询性能。

默认端口:8086

PORT     STATE SERVICE VERSION
8086/tcp open  http    InfluxDB http admin 1.7.5

枚举

从渗透测试人员的角度来看,这是另一个可能存储敏感信息的数据库,因此了解如何转储所有信息是很有趣的。

认证

InfluxDB可能需要认证,也可能不需要

# Try unauthenticated
influx -host 'host name' -port 'port #'
> use _internal

如果你遇到类似这样的错误:ERR: unable to parse authentication credentials,这意味着它需要一些凭据

influx –username influx –password influx_pass

存在一个漏洞,允许绕过身份验证的influxdb:CVE-2019-20933

手动枚举

这个示例的信息来自这里

显示数据库

找到的数据库是 telegrafinternal(你会在任何地方找到这个)。

> show databases
name: databases
name
----
telegraf
_internal

显示表/测量

InfluxDB文档解释说,在InfluxDB中,测量可以与SQL表并行。这些测量的命名方式表明了它们各自内容的特点,每个都包含与特定实体相关的数据。

> show measurements
name: measurements
name
----
cpu
disk
diskio
kernel
mem
processes
swap
system

显示列/字段键

字段键类似于数据库的

> 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 ...]

转储表

最后,您可以执行类似以下操作来转储表

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

在进行身份验证绕过测试时,注意到表名需要用双引号括起来,例如:select * from "cpu"

自动化身份验证

msf6 > use auxiliary/scanner/http/influxdb_enum
从零开始学习AWS黑客技术,成为专家 htARTE(HackTricks AWS红队专家)

支持HackTricks的其他方式:

使用Trickest轻松构建和自动化工作流程,由全球最先进的社区工具驱动。 立即获取访问权限:

最后更新于