GraphQL

ko-fi

Found a target using GraphQL?

  1. Run the introspection query to map out all methods

  2. Use GraphQL Voyager to display all methods

  3. Use BatchQL or the InQL extension to test all methods for IDORs, SQLi, SSRF, etc

Definition

  • Query is an operation to retrieve data (read).

  • Mutation is an operation used to submit and write data (create, update, and delete).

  • Subscription is an operation used to send data (read) when an event occurs. Subscription is a way for GraphQL clients to listen to live updates from the server.

Detection

Basics

Fingerprinting

Scan

Introspection enabled

Introspection disabled

Error Messages

JS Files

  1. Download all js files to directory js_files

  2. Run this command:

Scan endpoints

Wordlists

IDOR

IDOR

Change the internalId field

Add extra field

Initial query

Modified query

Path Traversal

File Inclusion LFI / RFI

Mass Asignement - mutation

Mass Assignment

Initial query

Modified query - role added

CSRF

Bypassing rate limits

Batching attack

Tool: batchql

SQL injection

Get all informations about the API schema:

Ex:

SQL injection - Time based

Automated - Graphqlmap

NoSQL Injection

NoSQL injection

Use $regex, $ne frominside a search parameter.

LDAP Injection

LDAP Injection

Command injection

Command Injection

XSS

XSS

HTML Injection

DoS throught batched queries

Wordlists

GraphQL Raider - Burp Extension

InQL

Burp Extension

CLI

Tools

Interesting Book

Disclaimer: As an Amazon Associate, I earn from qualifying purchases. This helps support this GitBook project at no extra cost to you.

  • Black Hat GraphQL: Attacking Next Generation APIs This hands-on book teaches penetration testers how to identify vulnerabilities in apps that use GraphQL, a data query and manipulation language for APIs adopted by major companies like Facebook and GitHub.

Support this Gitbook

I hope it helps you as much as it has helped me. If you can support me in any way, I would deeply appreciate it.

ko-fi

buymeacoffee

Interesting Reports

1. https://hackerone.com/reports/2048725

2. https://hackerone.com/reports/2524939

3. https://hackerone.com/reports/2357012

4. https://hackerone.com/reports/2122671

5. https://hackerone.com/reports/2207248

6. https://hackerone.com/reports/1864188

7. https://hackerone.com/reports/1085332

8. https://hackerone.com/reports/1084904

9. https://hackerone.com/reports/1293377

10. https://hackerone.com/reports/1192460

Resources

Last updated