> 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/de/web-vulnerabilities/graphql-attack/graphql-introspection-pentesting-web.md).

# GraphQL-Introspektion

{% hint style="info" %}
**Die Introspektion in GraphQL** ist ein Mechanismus, der es Clients ermöglicht, Informationen über das GraphQL-Schema einer API zu erhalten. Das bedeutet, dass die Clients die Datentypen, die Felder und die Beziehungen erkunden und entdecken können, die in der API existieren, was für Entwickler sehr nützlich sein kann, die GraphQL-Clients erstellen müssen. Allerdings kann die Introspektion auch von Angreifern genutzt werden, um sensible Informationen über die Struktur und die in der API vorhandenen Daten zu erhalten, die für die Durchführung ausgefeilterer Angriffe verwendet werden können.
{% endhint %}

Wir \*\*finden\*\* den folgenden Inhalt:

<figure><img src="/files/72154ef7381696dcfeb498afba938f776acae791" alt=""><figcaption></figcaption></figure>

Wir **abfangen** die Anfrage mit Burp Suite:

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

In der URL **fügen wir** eines dieser Verzeichnisse ein (in meinem Fall war es /graphql):

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

Sobald wir das Verzeichnis gefunden haben, **weisen wir ihm den Inhalt** unten zu:

```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}+}

```

Wir stoßen sehr wahrscheinlich **auf diesen Fehler**und um ihn zu beheben, setze einfach zwei **Unterstriche** vor die Variable:

<figure><img src="/files/6daaa499ae02349ea6206c2ae38ad8182ca5c027" alt=""><figcaption></figcaption></figure>

Sobald er behoben ist, kopieren wir den gesamten **Inhalt der Antwort**:

<figure><img src="/files/86073a427c36e494a6945734f56d3220071fe323" alt=""><figcaption></figcaption></figure>

Wir fügen sie dann auf der Webseite von [graphql-kit](https://graphql-kit.com/graphql-seeager/) im Abschnitt Introspection ein:

<figure><img src="/files/91045c25a440bce62c28fd216f93212308be7410" alt=""><figcaption></figcaption></figure>

Jetzt haben wir eine **grafische Ansicht** der Struktur von GraphQL:

<figure><img src="/files/564d3bad2770fe079b63bf3469845fc5aad97ab5" alt=""><figcaption></figcaption></figure>

In dem **query**da wir die Felder kennen, fügen wir sie in die Anfrage ein und der Server gibt ihre Werte zurück:

<figure><img src="/files/faeef9e46eead192c8473a7d73c3b4dc3e08144c" 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/de/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.
