본문으로 건너뛰기
Skillpedia
테스트35k · #8237

performing-graphql-introspection-attack

하는 일

이 도구는 GraphQL을 사용하는 API의 보안을 테스트하는 데 도움을 줍니다. API의 전체 구조(데이터가 어떻게 구성되어 있고 어떤 작업을 할 수 있는지)를 알아내려고 시도하고, 악용될 수 있는 결함을 찾습니다.

사용하는 경우

  • ✓GraphQL API의 보안을 테스트할 권한이 있을 때.
  • ✓GraphQL API가 제공하는 모든 데이터 타입과 작업을 이해하고 싶을 때.
  • ✓API가 시스템에 과부하를 주거나 정보를 노출하는 공격에 취약한지 확인하는 경우.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-graphql-introspection-attack/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“'https://api.example.com/graphql'의 전체 GraphQL API 스키마를 알아내고 민감한 필드가 있는지 찾아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 GraphQL API에 특별한 요청을 보냅니다. API가 이를 허용하면 전체 구조가 드러납니다. 그다음 이 구조를 알려진 약점과 비교해 분석합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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()

…
자주 묻는 질문

GraphQL이란 무엇인가요?

API(프로그램끼리 서로 통신하게 해 주는 인터페이스)를 만드는 방식으로, 기존 방식보다 유연하고 효율적입니다. API 사용자가 필요한 데이터를 정확히 요청할 수 있습니다.

‘인트로스펙션(introspection)’이란 무엇인가요?

프로그램이 API에 자신의 구조를 물어볼 수 있게 해 주는 GraphQL 기능입니다. API가 요청하는 쪽에 스스로를 설명하는 것과 같습니다.

왜 허가가 필요한가요?

허가 없이 시스템의 보안을 테스트하는 것은 불법입니다. 이 도구는 허가되지 않은 시스템에 사용하면 불안정하거나 서비스가 중단될 수 있으므로 서면 허가가 꼭 필요합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
35k
순위
#8237
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬