InQL – A Burp Extension for GraphQL Security Testing

A security testing tool to facilitate GraphQL technology security auditing efforts. InQL can be used as a stand-alone script, or as a Burp Suite extension.

Running inql from Python will issue an Introspection query to the target GraphQL endpoint in order fetch metadata information for:

  • Queries, mutations, subscriptions
  • Its fields and arguments
  • Objects and custom objects types

InQL can inspect the introspection query results and generate clean documentation in different formats, such as HTML and JSON schema. InQL is also able to generate templates (with optional placeholders) for all known basic data types.

The resulting HTML documentation page will contain details for all available Queries, Mutations, and Subscriptions as shown here:

The following screenshot shows the use of templates generation:

For all supported options, check the command line help:

usage: inql [-h] [-t TARGET] [-f SCHEMA_JSON_FILE] [-k KEY] [-p PROXY]
[–header HEADERS HEADERS] [-d] [–generate-html]
[–generate-schema] [–generate-queries] [–insecure]
[-o OUTPUT_DIRECTORY]

InQL Scanner

Optional arguments:
-h, –help show this help message and exit
-t TARGET Remote GraphQL Endpoint (https:///graphql)
-f SCHEMA_JSON_FILE Schema file in JSON format
-k KEY API Authentication Key
-p PROXY IP of web proxy to go through (http://127.0.0.1:8080)
–header HEADERS HEADERS
-d Replace known GraphQL arguments types with placeholder values (useful for Burp Suite)
–generate-html Generate HTML Documentation
–generate-schema Generate JSON Schema Documentation
–generate-queries Generate Queries
–insecure Accept any SSL/TLS certificate
-o OUTPUT_DIRECTORY Output Directory

Burp Suite Extension

Since version 1.0 of the tool, InQL was extended to operate within Burp Suite. In this mode, the tool will retain all the capabilities of the stand-alone script plus a handy user interface to manipulate queries.

Using the inql extension for Burp Suite, you can:

  • Search for known GraphQL URL paths; the tool will grep and match known values to detect GraphQL endpoints within the target website
  • Search for exposed GraphQL development consoles (GraphiQL, GraphQL Playground, and other common consoles)
  • Use a custom GraphQL tab displayed on each HTTP request/response containing GraphQL
  • Leverage the templates generation by sending those requests to Burp’s Repeater tool
  • Configure the tool by using a custom settings tab

To use inql in Burp Suite, import the Python extension:

  • Download the Jython Jar
  • Start Burp Suite
  • Extender Tab > Options > Python Enviroment > Set the location of Jython standalone JAR
  • Extender Tab > Extension > Add > Extension Type > Select Python
  • Download the latest inql_burp.py release here
  • Extension File > Set the location of inql_burp.py > Next
  • The output should now show the following message: InQL Scanner Started!

In future, we might consider integrating the extension within the Burp’s BApp Store.

Burp Extension Usage

Getting started with inql Burp extension is easy:

  • Load a GraphQL endpoint or a JSON schema file location inside the top input field
  • Press the “Load” button
  • After few seconds, the left panel will refresh loading the directory structure for the selected endpoint as in the following example:
  1. url
    • query
    • timestamp 1
      • query1.query
      • query2.query
    • timestamp 2
      • query1.query
      • query2.query
    • mutation
    • subscription
  • Selecting any query/mutation/subscription will load the corresponding template in the main text area

Credit: Andrea Brancaleoni & Paolo Stagno

R K

Recent Posts

How Do I Do Reverse Image Search

Have you ever come across a picture on the internet and wondered where it came…

7 days ago

WhatsMyName App – Find Anyone Across 640+ Platforms

Overview WhatsMyName is a free, community-driven OSINT tool designed to identify where a username exists…

3 weeks ago

Analyzing Directory Size Linux Tools Explained

Managing disk usage is a crucial task for Linux users and administrators alike. Understanding which…

3 weeks ago

Understanding Disk Usage with du Command

Efficient disk space management is vital in Linux, especially for system administrators who manage servers…

3 weeks ago

How to Check Directory Size in Linux

Knowing how to check directory sizes in Linux is essential for managing disk space and…

3 weeks ago

Essential Commands for Linux User Listing

Managing user accounts is a core responsibility for any Linux administrator. Whether you’re securing a…

3 weeks ago