> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/fr/web-vulnerabilities/graphql-attack/graphql-introspection-pentesting-web.md).

# Introspection GraphQL

{% hint style="info" %}
**L'introspection en GraphQL** est un mécanisme qui permet aux clients d'obtenir des informations sur le schéma GraphQL d'une API. Cela signifie que les clients peuvent explorer et découvrir les types de données, les champs et les relations qui existent dans l'API, ce qui peut être très utile aux développeurs qui doivent créer des clients GraphQL. Cependant, l'introspection peut également être utilisée par des attaquants pour obtenir des informations sensibles sur la structure et les données qui existent dans l'API, et cela peut être utilisé pour mener des attaques plus sophistiquées.
{% endhint %}

Nous \*\*trouvons\*\* le contenu ci-dessous :

<figure><img src="/files/7c0ea1943e6da7411d91bb8a04ffdcc92b86b7cb" alt=""><figcaption></figcaption></figure>

Nous **intercepter** la requête avec Burp Suite :

<figure><img src="/files/bf87cdfc2482e8ffb5dc5b404761c306d07b212c" alt=""><figcaption></figcaption></figure>

Dans l'URL, nous **insérons** l'un de ces répertoires (dans mon cas, c'était /graphql) :

<figure><img src="/files/f9dadbfcfdd36ef2f55a4f119578a8fdf8831f41" alt=""><figcaption></figcaption></figure>

Une fois le répertoire trouvé, nous **lui avons assigné le contenu** ci-dessous :

```bash
?query=fragment%20FullType%20on%20Type%20{+%20%20kind+%20%20name+%20%20description+%20%20fields%20{+%20%20%20%20name+%20%20%20%20description+%20%20%20%20args%20{+%20%20%20%20%20%20...InputValue+%20%20%20%20}+%20%20%20%20type%20{+%20%20%20%20%20%20...TypeRef+%20%20%20%20}+%20%20}+%20%20inputFields%20{+%20%20%20%20...InputValue+%20%20}+%20%20interfaces%20{+%20%20%20%20...TypeRef+%20%20}+%20%20enumValues%20{+%20%20%20%20name+%20%20%20%20description+%20%20}+%20%20possibleTypes%20{+%20%20%20%20...TypeRef+%20%20}+}++fragment%20InputValue%20on%20InputValue%20{+%20%20name+%20%20description+%20%20type%20{+%20%20%20%20...TypeRef+%20%20}+%20%20defaultValue+}++fragment%20TypeRef%20on%20Type%20{+%20%20kind+%20%20name+%20%20ofType%20{+%20%20%20%20kind+%20%20%20%20name+%20%20%20%20ofType%20{+%20%20%20%20%20%20kind+%20%20%20%20%20%20name+%20%20%20%20%20%20ofType%20{+%20%20%20%20%20%20%20%20kind+%20%20%20%20%20%20%20%20name+%20%20%20%20%20%20%20%20ofType%20{+%20%20%20%20%20%20%20%20%20%20kind+%20%20%20%20%20%20%20%20%20%20name+%20%20%20%20%20%20%20%20%20%20ofType%20{+%20%20%20%20%20%20%20%20%20%20%20%20kind+%20%20%20%20%20%20%20%20%20%20%20%20name+%20%20%20%20%20%20%20%20%20%20%20%20ofType%20{+%20%20%20%20%20%20%20%20%20%20%20%20%20%20kind+%20%20%20%20%20%20%20%20%20%20%20%20%20%20name+%20%20%20%20%20%20%20%20%20%20%20%20%20%20ofType%20{+%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kind+%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20name+%20%20%20%20%20%20%20%20%20%20%20%20%20%20}+%20%20%20%20%20%20%20%20%20%20%20%20}+%20%20%20%20%20%20%20%20%20%20}+%20%20%20%20%20%20%20%20}+%20%20%20%20%20%20}+%20%20%20%20}+%20%20}+}++query%20IntrospectionQuery%20{+%20%20schema%20{+%20%20%20%20queryType%20{+%20%20%20%20%20%20name+%20%20%20%20}+%20%20%20%20mutationType%20{+%20%20%20%20%20%20name+%20%20%20%20}+%20%20%20%20types%20{+%20%20%20%20%20%20...FullType+%20%20%20%20}+%20%20%20%20directives%20{+%20%20%20%20%20%20name+%20%20%20%20%20%20description+%20%20%20%20%20%20locations+%20%20%20%20%20%20args%20{+%20%20%20%20%20%20%20%20...InputValue+%20%20%20%20%20%20}+%20%20%20%20}+%20%20}+}

```

Nous rencontrons très probablement **cette erreur**, et pour la résoudre, il suffit de placer deux **tirets bas** avant la variable :

<figure><img src="/files/a8f8ee3c0e27d00b47e3931d1c1b0b396ae050ae" alt=""><figcaption></figcaption></figure>

Une fois résolu, nous copions tout le **contenu de la réponse**:

<figure><img src="/files/2f72857e9746a27cb95424a57a557feb0b7e3b3b" alt=""><figcaption></figcaption></figure>

Nous les collons dans la page web de [graphql-kit](https://graphql-kit.com/graphql-seeager/) dans la section introspection :

<figure><img src="/files/7a1f9dd855351fc4b21fa737f69799be8786f598" alt=""><figcaption></figcaption></figure>

Maintenant, nous avons une **vue graphique** de la structure du GraphQL :

<figure><img src="/files/d68693a0890e59908bc2bce3bb083b23a961b8b4" alt=""><figcaption></figcaption></figure>

Dans le **paramètre query**, comme nous connaissons les champs, nous les insérons dans la requête et le serveur renvoie leurs valeurs :

<figure><img src="/files/322f1cb9b890544cf6abaaaef5ad18b775266e64" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/fr/web-vulnerabilities/graphql-attack/graphql-introspection-pentesting-web.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
