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

# Introspecção GraphQL

{% hint style="info" %}
**A introspecção em GraphQL** é um mecanismo que permite aos clientes obter informações sobre o esquema GraphQL de uma API. Isso significa que os clientes podem explorar e descobrir os tipos de dados, os campos e as relações que existem na API, o que pode ser muito útil para os desenvolvedores que precisam criar clientes GraphQL. No entanto, a introspecção também pode ser usada por atacantes para obter informações sensíveis sobre a estrutura e os dados que existem na API, que podem ser usados para realizar ataques mais sofisticados.
{% endhint %}

Nós \*\*encontramos\*\* o conteúdo abaixo:

<figure><img src="/files/5164dde723e5e069d0f01807ce967515f40aac99" alt=""><figcaption></figcaption></figure>

Nós **interceptar** a requisição com o Burp Suite:

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

Na URL, nós **inserimos** um desses diretórios (no meu caso, era /graphql):

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

Uma vez que encontramos o diretório, nós **atribuímos a ele o conteúdo** abaixo:

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

```

Encontramos muito provavelmente **este erro**, e para resolvê-lo, basta colocar dois **sublinhados** antes da variável:

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

Uma vez resolvido, copiamos todo o **conteúdo da resposta**:

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

Nós os colamos na página da web do [graphql-kit](https://graphql-kit.com/graphql-seeager/) na seção de introspecção:

<figure><img src="/files/2130a4b413382b1714e68ed2caba7ba874a12cc4" alt=""><figcaption></figcaption></figure>

Agora, temos uma **visão gráfica** da estrutura do GraphQL:

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

No **query**, como já sabemos os campos, nós os inserimos na requisição e o servidor retorna seus valores:

<figure><img src="/files/dd8346c5f71557876a9052876fbc547d41f8a2da" 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/pt-br/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.
