[CVE-2020-35476] OpenTSDB <=2.4.0 RCE

220 篇文章 7 订阅
213 篇文章 3 订阅

安装

条件:
  • Zookeeper
  • HBase
Zookeeper
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.6.2/apache-zookeeper-3.6.2.tar.gz
cd conf
cp zoo_sample.cfg zoo.cfg
vi zoo.cfg
# 修改dataDir=data,然后启动
bin/zkServer.sh start
HBase

opentsdb的后端数据存储依赖于HBase,所以需要先安装HBase。

wget https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/1.4.13/hbase-1.4.13-bin.tar.gz
# 网络不行换下面的
wget https://mirrors.bfsu.edu.cn/apache/hbase/1.4.13/hbase-1.4.13-bin.tar.gz

wget https://github.com/OpenTSDB/opentsdb/releases/download/v2.4.0/opentsdb-2.4.0_all.deb
sudo dpkg -i opentsdb-2.4.0_all.deb

# 启动
systemctl start opentsdb

安装之后,设置systemctl启动:

[Unit]

Description=OpenTSDB Service

[Service]

Type=forking

PrivateTmp=yes

ExecStart=/usr/share/opentsdb/etc/init.d/opentsdb start

ExecStop=/usr/share/opentsdb/etc/init.d/opentsdb stop

Restart=on-abort

配置hbase:

vi conf/hbase-env.sh
# export JAVA_HOME=/usr/lib/jvm/java-8-oracle/
vi conf/hbase-site.xml

<configuration>
  <property>

<name>hbase.rootdir</name>

    <value>file:///home/77/hbase</value>

  </property>

  <property>

    <name>hbase.zookeeper.property.dataDir</name>

    <value>/home/77/hbase/zookeeper</value>

  </property>
</configuration>

启动qbase:

bin/start-hbase.sh

创建表:

bin/hbase shell

create 'tsdb',{NAME => 't', VERSIONS => 1, BLOOMFILTER => 'ROW'}
create 'tsdb-uid',{NAME => 'id', BLOOMFILTER => 'ROW'},{NAME => 'name', BLOOMFILTER => 'ROW'}
create 'tsdb-tree',{NAME => 't', VERSIONS => 1, BLOOMFILTER => 'ROW'}
create 'tsdb-meta',{NAME => 'name', BLOOMFILTER => 'ROW'}

最后list一下,确认表创建成功:
在这里插入图片描述

hbase-1.4.13这个版本的WEB端口是32809和40139:

http://192.168.85.129:32809/master-status
http://192.168.85.129:40139/rs-status?filter=all

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

openTSDB

安装参考:
https://www.unixmen.com/how-to-install-and-configure-opentsdb-on-centos-ubuntu-linux-for-hbase-cluster/

git clone git://github.com/OpenTSDB/opentsdb.git
 cd opentsdb
 ./build.sh
cd opentsdb/build
  make install
  whereis tsdb
tsdb: /usr/local/bin/tsdb

配置这个文件:

vi src/opentsdb.conf

内容为:

tsd.http.staticroot = /home/77/repos/opentsdb-master/build/staticroot    # the path to the OpenTSDB static GUI filestsd.network.port = 4242

# The IPv4 network address to bind to, defaults to all addresses
tsd.network.bind = 0.0.0.0
tsd.http.cachedir = /tmp       # the path where it should store the temporary cache files
tsd.storage.hbase.zk_quorum = localhost:2181 

最后创建4张表:

env COMPRESSION=NONE HBASE_HOME=/home/77/repos/hbase-1.4.13 ./src/create_table.sh

最后启动:

./build/tsdb tsd

在这里插入图片描述

然后就启动在4242端口了。
在这里插入图片描述

参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值