Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)10k · #11977

offensive-graphql

Skill này làm gì

Skill này là phương pháp kiểm thử bảo mật API GraphQL. Nó bao quát việc tìm endpoint, đọc hoặc dựng lại schema, kiểm tra quy tắc truy cập và kiểm thử batching cùng độ sâu truy vấn. Nó dành cho chuyên gia bảo mật và nhà nghiên cứu bug bounty có sự cho phép.

Khi nào nên dùng

  • ✓Khi bạn kiểm thử một API GraphQL trong một đánh giá được ủy quyền.
  • ✓Khi introspection bị tắt và bạn cần dựng lại schema để kiểm thử.
  • ✓Khi bạn muốn kiểm tra xem một API GraphQL có giới hạn batching, độ sâu hoặc tốc độ yêu cầu không.

Liên kết skill

https://github.com/SnailSploit/Claude-Red/blob/main/Skills/web/offensive-graphql/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/SnailSploit/Claude-Red/blob/main/Skills/web/offensive-graphql/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

“Chúng tôi được ủy quyền kiểm thử API GraphQL của mình. Kiểm tra xem introspection có đang bật không và các quy tắc truy cập có đúng không.”

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

Cách hoạt động

Skill tìm endpoint GraphQL và nhận diện engine. Sau đó nó lấy schema, qua introspection hoặc bằng cách dựng lại, rồi kiểm tra truy cập, các điểm chèn, batching và độ sâu truy vấn.

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.

Offensive GraphQL

GraphQL consolidates an entire API surface behind a single endpoint, making it a high-value target during web application assessments. Unlike REST, where each route maps to a discrete resource, a GraphQL schema exposes every type, field, mutation, and subscription in one queryable structure. Attackers who obtain or reconstruct that schema gain a complete map of the application's data model before writing a single exploit. This skill walks you through each phase of a GraphQL engagement with concrete queries, tool invocations, and chaining patterns.

Quick Workflow

  1. Discover the endpoint -- probe common paths, inspect client-side JS bundles, check WebSocket upgrade headers.
  2. Fingerprint the implementation -- use graphw00f to identify the engine and tailor payloads.
  3. Dump or reconstruct the schema -- full introspection query; if blocked, field suggestion probing or clairvoyance.
  4. Map the attack surface -- feed the schema into GraphQL Voyager or InQL.
  5. Test authentication and authorization -- every query and mutation with no token, low-privilege, and cross-user tokens.
  6. Inject through resolvers -- SQL, NoSQL, and OS command payloads through arguments and variables.
  7. Abuse batching -- arrayed operations for brute force, OTP bypass, and rate limit evasion.
  8. Stress depth and complexity -- nested queries, alias fans, and circular fragments.
  9. Probe subscriptions -- WebSocket with expired or missing tokens, subscribe to sensitive streams.
  10. Exfiltrate via errors -- verbose stack traces, type mismatches, field suggestions.
  11. Test file upload -- multipart GraphQL specification for oversized or malicious files.
  12. Chain and escalate -- combine findings into multi-step attack paths with proof-of-concept queries.

1 -- Endpoint Discovery and Fingerprinting

Probe common paths with a minimal query body. A __typename response confirms a live GraphQL endpoint.

curl -s -X POST https://target.com/graphql \
  -H "Content-Type: application/json" \
  -d '{"query":"{__typename}"}' | jq .

Paths to probe: /graphql, /graphiql, /v1/graphql, /v2/graphql, /api/graphql, /graphql/console, /playground, /explorer, /query. Some servers accept GET requests:

curl -s "https://target.com/graphql?query=\{__typename\}"

Fingerprint the implementation to determine default behaviors (introspection state, error format, batching syntax):

python3 graphw00f.py -t https://target.com/graphql

Run graphql-cop for a one-pass configuration audit -- it reports introspection status, field suggestion leaks, GET-based query acceptance (CSRF risk), and unrestricted batching:

python3 graphql-cop.py -t https://target.com/graphql

2 -- Introspection and Blind Schema Reconstruction

Full Introspection Dump

When introspection is enabled, pull the entire schema in one request. This is the single most valuable recon step.

query FullIntrospection {
  __schema {
    queryType { name }
    mutationType { name }
    subscriptionType { name }
    types {
      kind name description
      fields(includeDeprecated: true) {
        name args { name type { ...T } defaultValue } type { ...T }
      }
      inputFields { name type { ...T } defaultValue }
      interfaces { ...T }
      enumValues(includeDeprecated: true) { name description }
      possibleTypes { ...T }
    }
    directives { name description locations args { name type { ...T } } }
  }
}
fragment T on __Type {
  kind name ofType { kind name ofType { kind name ofType { kind name } } }
}

Pipe the result into GraphQL Voyager for visual exploration, or load InQL in Burp Suite -- it parses the schema and generates individual queries for every field and mutation.

Targeted __type Queries

When full introspection is disabled but __type lookups still work (a common misconfiguration where the server blocks __schema but forgets __type):

query { __type(name: "User") { name fields { name type { name kind } } } }

Bypassing Disabled Introspection

Field suggestion oracle. Most engines return "Did you mean..." when you query a non-existent field. Submit plausible names and harvest suggestions:

query { __typename aaa }
{
  "errors": [{
    "message": "Cannot query field \"aaa\" on type \"Query\". Did you mean \"user\", \"users\", \"admin\"?"
  }]
}

Automate this with clairvoyance, which iterates a wordlist, collects sug

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

Introspection là gì?

Đó là tính năng GraphQL liệt kê các kiểu và trường của API, và skill kiểm tra xem nó có bị lộ không.

Nếu introspection bị tắt thì sao?

Skill mô tả các cách dựng lại schema, chẳng hạn thăm dò các gợi ý trường.

Đây có chỉ dành cho kiểm thử được ủy quyền không?

Có. Skill được viết cho việc kiểm thử có văn bản cho phép.

Chi tiết

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

Offensive methodology for attacking GraphQL APIs during penetration tests and bug bounty engagements. Covers the full attack lifecycle: endpoint discovery, introspection abuse and blind schema reconstruction when introspection is disabled, authentication and authorization bypass through Relay node IDs and nested object traversal, injection via variables and directives, query batching for brute force and OTP bypass, denial of service through depth bombs and alias amplification, WebSocket subscription hijacking, information disclosure through verbose errors and field suggestion oracles, and file

repo: SnailSploit/Claude-Red

Độ phổ biến

Sao GitHub
10k
Vị trí xếp hạng
#11977
Giấy phép
MIT
Cập nhật
12/10/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ự