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

# Introspección de GraphQL

{% hint style="info" %}
**La introspección en GraphQL** es un mecanismo que permite a los clientes obtener información sobre el esquema GraphQL de una API. Esto significa que los clientes pueden explorar y descubrir los tipos de datos, los campos y las relaciones que existen en la API, lo que puede ser muy útil para los desarrolladores que necesitan construir clientes GraphQL. Sin embargo, la introspección también puede ser utilizada por atacantes para obtener información sensible sobre la estructura y los datos que existen en la API, lo que puede usarse para realizar ataques más sofisticados.
{% endhint %}

Encontramos el contenido a continuación:

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

Nosotros **interceptar** la solicitud con Burp Suite:

<figure><img src="/files/81e19505184540536cf6d0b45e4a0df7f6103c99" alt=""><figcaption></figcaption></figure>

En la URL, nosotros **insertamos** la de estos directorios (en mi caso, era /graphql):

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

Una vez que encontramos el directorio, nosotros **le asignamos el contenido** a continuación:

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

```

Nos encontramos muy probablemente **este error**, y para resolverlo, solo hay que poner dos **guiones bajos** antes de la variable:

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

Una vez resuelto, copiamos todo el **contenido de la respuesta**:

<figure><img src="/files/1d933a0f28b648ed6b341213cfe1a0f7255665a3" alt=""><figcaption></figcaption></figure>

lo pegamos en la página web de [graphql-kit](https://graphql-kit.com/graphql-seeager/) en la sección de introspección:

<figure><img src="/files/5b1db1f25fdc1cbff270f2aea34d87f45445e342" alt=""><figcaption></figcaption></figure>

Ahora, tenemos una **vista gráfica** de la estructura de GraphQL:

<figure><img src="/files/5aaa4522b2a1c0fb2b8a1cb35067b0b3d156d7a2" alt=""><figcaption></figcaption></figure>

En el **query**, como conocemos los campos, los insertamos en la solicitud y el servidor devuelve sus valores:

<figure><img src="/files/0d0bfaf89d7191452c91c7b3aff93b9eb8bb4ecc" 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/es/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.
