Saltar al contenido
Skillpedia
Pruebas35 mil · #8237

performing-graphql-introspection-attack

Qué hace

Esta herramienta te ayuda a probar la seguridad de APIs que usan GraphQL. Intenta descubrir toda la estructura de la API (cómo están organizados los datos y qué acciones se pueden realizar) y busca fallos que podrían aprovecharse.

Cuándo usarla

  • ✓Cuando tienes permiso para probar la seguridad de una API de GraphQL.
  • ✓Para entender todos los tipos de datos y operaciones que ofrece una API de GraphQL.
  • ✓Para comprobar si la API es vulnerable a ataques que sobrecargan el sistema o exponen información.

Link de la skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-graphql-introspection-attack/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-graphql-introspection-attack/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Descubre el esquema completo de la API de GraphQL en 'https://api.example.com/graphql' y busca campos sensibles.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La herramienta envía peticiones especiales a la API de GraphQL. Si la API lo permite, revela toda su estructura. Después analiza esa estructura en busca de debilidades conocidas.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de GitHub.

Performing GraphQL Introspection Attack

When to Use

  • Testing GraphQL endpoints for exposed introspection that reveals the complete API schema
  • Mapping the attack surface of a GraphQL API to identify sensitive queries, mutations, and types
  • Testing for GraphQL-specific vulnerabilities including query depth abuse, batching attacks, and field-level authorization
  • Assessing GraphQL implementations where introspection is disabled but schema can be reconstructed through error messages
  • Evaluating defenses against resource exhaustion through deeply nested or complex GraphQL queries

Do not use without written authorization. Schema extraction and query abuse testing can impact service availability.

Prerequisites

  • Written authorization specifying the GraphQL endpoint and testing scope
  • Burp Suite Professional with InQL extension (v6.1+) for automated schema analysis
  • Python 3.10+ with requests and gql libraries
  • GraphQL Voyager or GraphQL Playground for schema visualization
  • Clairvoyance tool for schema reconstruction when introspection is disabled
  • Wordlists for GraphQL field and type name brute-forcing

Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.

Workflow

Step 1: GraphQL Endpoint Discovery

import requests
import json

TARGET = "https://target-api.example.com"
headers = {"Content-Type": "application/json"}

# Common GraphQL endpoint paths
GRAPHQL_PATHS = [
    "/graphql", "/graphql/", "/gql", "/query",
    "/api/graphql", "/api/gql", "/api/v1/graphql",
    "/v1/graphql", "/v2/graphql",
    "/graphql/console", "/graphql/playground",
    "/graphiql", "/altair", "/explorer",
    "/graph", "/api/graph",
]

# Probe for GraphQL endpoints
for path in GRAPHQL_PATHS:
    # Test with a simple introspection query
    query = {"query": "{ __typename }"}
    try:
        resp = requests.post(f"{TARGET}{path}", headers=headers, json=query, timeout=5)
        if resp.status_code == 200 and ("data" in resp.text or "__typename" in resp.text):
            print(f"[FOUND] GraphQL endpoint: {TARGET}{path}")
            print(f"  Response: {resp.text[:200]}")
    except requests.exceptions.RequestException:
        pass

    # Also test GET method
    try:
        resp = requests.get(f"{TARGET}{path}?query={{__typename}}", timeout=5)
        if resp.status_code == 200 and ("data" in resp.text or "__typename" in resp.text):
            print(f"[FOUND] GraphQL endpoint (GET): {TARGET}{path}")
    except requests.exceptions.RequestException:
        pass

Step 2: Full Introspection Query

GRAPHQL_URL = f"{TARGET}/graphql"
auth_headers = {**headers, "Authorization": "Bearer <token>"}

# Full introspection query to extract complete schema
FULL_INTROSPECTION = {
    "query": """
    query IntrospectionQuery {
      __schema {
        queryType { name }
        mutationType { name }
        subscriptionType { name }
        types {
          ...FullType
        }
        directives {
          name
          description
          locations
          args {
            ...InputValue
          }
        }
      }
    }

    fragment FullType on __Type {
      kind
      name
      description
      fields(includeDeprecated: true) {
        name
        description
        args {
          ...InputValue
        }
        type {
          ...TypeRef
        }
        isDeprecated
        deprecationReason
      }
      inputFields {
        ...InputValue
      }
      interfaces {
        ...TypeRef
      }
      enumValues(includeDeprecated: true) {
        name
        description
        isDeprecated
        deprecationReason
      }
      possibleTypes {
        ...TypeRef
      }
    }

    fragment InputValue on __InputValue {
      name
      description
      type { ...TypeRef }
      defaultValue
    }

    fragment TypeRef on __Type {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
            }
          }
        }
      }
    }
    """
}

resp = requests.post(GRAPHQL_URL, headers=auth_headers, json=FULL_INTROSPECTION)

if resp.status_code == 200:
    schema = resp.json()

…
Preguntas frecuentes

¿Qué es GraphQL?

GraphQL es una forma de construir APIs (interfaces que permiten que los programas se comuniquen entre sí) más flexible y eficiente que los métodos antiguos. Permite que quien consulta la API pida exactamente los datos que necesita.

¿Qué es la 'introspección'?

La introspección en GraphQL es una función que permite a un programa preguntarle a la API por su propia estructura. Es como si la API pudiera describirse a quien la consulta.

¿Por qué necesito autorización?

Probar la seguridad de un sistema sin permiso es ilegal. Esta herramienta puede causar inestabilidad o falta de disponibilidad si se usa en sistemas no autorizados, por eso es obligatorio contar con un permiso por escrito.

Detalles

Descripción original del autor

Performs GraphQL introspection attacks that extract the full API schema (types, queries, mutations, subscriptions, field definitions), map the attack surface, test query depth/complexity limits, and exploit GraphQL-specific weaknesses such as batching attacks, alias-based brute force, and nested query DoS. Use for GraphQL security testing, schema enumeration, or GraphQL API penetration testing. '

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularidad

Estrellas en GitHub
35 mil
Posición en el ranking
#8237
Licencia
Apache-2.0
Actualizada
31/8/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas