Giter Site home page Giter Site logo

grafanassrfscan's Introduction

Grafana SSRF Scan

This simple python script acts as the proof-of-concept of the SSRF vulnerability found in Grafana 9.0.2.

In case of Grafana, this SSRF is not exactly a vulnerability, but a feauture. Because of the essential Grafana function to check availability of a host before asking for data, we can abuse it to check any host and any port we want.

Mechanism

When administrator is trying to add new data source to get metrics from and visualize them after, he can set any data source URL and execute the availability test. By doing that, exactly 5 requests are sent to the Grafana API on the Grafana server. Last 2 requests are transmitted from the server's identity to the URL that administrator has set.

So, by specifying the data source URL and executing Save&Test function on the administrator panel, we induce the server-side application to make requests to any location. Judging by error message after the test, we can conclude that the certain port is open or closed.

Usage

First, we need to get Grafana administrator credentials. Secondly, create two text files with IPs and ports. Then execute the following command in the directory with the script:

python scanNet.py -H http://grafana_server.com:3000 -U admin -P admin --ip-file ipList.txt --port-file portList.txt
  • -H is the URL of Grafana server with default port 3000
  • -U is administrator's login
  • -P is administrator's password
  • --ip-file is path to the file with IP-addresses (one address on one line)
  • --port-file is path to the file with ports (one port on one line)

Using proxy is available with -p flag:

python scanNet.py -H http://grafana_server.com:3000 -U admin -P admin -p http://localhost:8080 --ip-file ipList.txt --port-file portList.txt
  • -p is URL of the proxy server

The script is checking each port from the ports file on every IP address from the ip file. In the result you can see If port is open or not.


This project was developed as a part of Digital Security internship in the department of web security audit "Summer of Hack 2022".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.