To access material, start machines and answer questions login.
What is GraphQL?
GraphQL is a modern query language that changes how clients interact with servers. Unlike APIs, which often rely on fixed endpoints and return large amounts of unnecessary data, GraphQL allows clients to specify exactly what they need—and nothing more. This efficiency has made GraphQL incredibly popular, but it also introduces new attack surfaces.
Key Components of GraphQL
- Schemas: The blueprint of the . It defines all the data types, fields, and their relationships. Think of it as the contract between the client and the server.
- Queries: Used to fetch data. Clients request specific fields, making it more efficient than traditional calls.
- Mutations: Used to change data. These handle actions like creating, updating, or deleting records.
Objectives
By the end of this room, you'll:
- Understand how GraphQL works and how it differs from traditional APIs.
- Learn how to map out a GraphQL 's structure and find hidden fields.
- Identify and exploit common vulnerabilities like excessive data exposure and injection.
- Discover practical ways to secure GraphQL APIs against these issues.
Prerequisites
Before getting started, make sure you're familiar with:
- How APIs work, including basic requests and responses.
- Interacting with APIs using tools like Burp.
- Basic scripting skills (Python is a good choice for automating tests).
- Common web application security issues, like unauthorised access or data leaks.
Starting the Machine
Deploy the target attached to this task by pressing the green Start Machine button. After obtaining the machine's generated IP address, you can either use the AttackBox or your own connected to TryHackMe's .
Add MACHINE_IP to your /etc/hosts file. For example:
MACHINE_IP graphql.thm
Or use the command:
sudo bash -c "echo MACHINE_IP graphql.thm >> /etc/hosts"
We will be using the web application running on this machine in the upcoming tasks.
I have started the target machine and I'm ready to learn about GraphQL Hacking!
Ready to learn Cyber Security?
The Intro to GraphQL Hacking room is only available for premium users. Signup now to access more than 500 free rooms and learn cyber security through a fun, interactive learning environment.
Already have an account? Log in