graphql-audit
它能做什么
这项技能教智能体如何审查 GraphQL API,这种接口允许客户端在一次调用中请求大量字段。内容涵盖结构暴露、单个字段的访问控制,以及对批处理和嵌套查询的滥用。
适用场景
- ✓当目标暴露了 /graphql 或类似的 GraphQL 接口的时候。
- ✓当测试人员想检查结构内省是否开放的时候。
- ✓当测试人员需要检查一个用户能否通过 GraphQL 读取另一个用户的记录的时候。
技能链接
https://github.com/awarexone/Agentic-Bug-Hunter/blob/main/skills/graphql-audit/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请审查这个 GraphQL 接口是否开放了内省,以及单个对象是否缺少访问检查。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会识别 GraphQL 引擎,检查结构是否开放,并测试字段建议和访问控制。它还会尝试批处理和别名模式,然后报告确认的结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
GRAPHQL SECURITY AUDIT
GraphQL flips the threat model — clients drive queries. One endpoint, infinite attack surface. Introspection hands you the schema; even without it, field suggestions give you 80% back.
0. QUICK KILL CHECKLIST
[ ] Run graphql_audit.sh <endpoint> — full automated sweep
[ ] Check if introspection is enabled (__schema query)
[ ] If introspection off — run clairvoyance for field discovery
[ ] Fingerprint engine (graphw00f) — different engines, different CVEs
[ ] Test query batching — send 100 identical queries in one POST
[ ] Test alias bombing — 1000 aliases in one query
[ ] Check field suggestions on typos — leaks schema even when introspection off
[ ] Try IDOR: query another user's object by ID, no auth check
[ ] Test field-level auth: query privileged fields (admin, role, internalNote)
[ ] Inject SQLi/NoSQLi via string arguments — id, filter, search args
[ ] Check subscriptions: can you subscribe to other users' events?
[ ] Try introspection bypass: __schema\nquery, query batching, fragment tricks
[ ] Look for mutation rate limiting — account takeover / self-XSS via mutations
1. TOOL — graphql_audit.sh
# Basic audit
bash bughunter/tools/graphql_audit.sh https://target.com/graphql
# With auth cookie
bash bughunter/tools/graphql_audit.sh https://target.com/api/graphql --cookie "session=abc123"
# With Authorization header
bash bughunter/tools/graphql_audit.sh https://target.com/graphql --header "Authorization: Bearer TOKEN"
# Through Burp proxy
bash bughunter/tools/graphql_audit.sh https://target.com/graphql --proxy http://127.0.0.1:8080
# Custom output directory
bash bughunter/tools/graphql_audit.sh https://target.com/graphql --output-dir ./findings/target/graphql
Output: findings/<target>/graphql/<timestamp>/
introspection.json— full schema dump (if enabled)fingerprint.txt— engine type (graphw00f)field_suggestions.txt— discovered fields via clairvoyancebatching_dos.txt— response time delta for 1 vs 100 queriesalias_bomb.txt— alias depth test resultsinjection.txt— injection scan results (built-in SQLi probe)cop_report.txt— graphql-cop attack checklist resultssummary.txt— hit/miss per phase
2. INTROSPECTION — Schema Leak (Most Common First Step)
Check If Enabled
curl -s -X POST https://target.com/graphql \
-H 'Content-Type: application/json' \
-d '{"query":"{ __schema { queryType { name } } }"}' | jq .
Full Schema Dump
# Pull complete introspection schema (pipe to InQL or graphql-voyager)
curl -s -X POST https://target.com/graphql \
-H 'Content-Type: application/json' \
-d '{
"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 ofType { kind name ofType { kind name ofType { kind name } } } } } } } }"
}' | jq . > schema.json
What To Look For In The Schema
- Mutations involving user data: updateUser, deleteAccount, changeEmail, changePassword
- Queries returning other users' objects: user(id: X), order(id: X)
- Fields: internalNote, adminOnly, role, isAdmin, rawPassword, apiKey
- Types: AdminUser, InternalConfig, DebugInfo
- Deprecated fields — often bypassed auth or forgotten
- Subscription types — real-time data leaks
Introspection Bypass Techniques
When __schema is blocked, try:
# Newline injection (bypasses naive keyword filters)
{"query": "query {\n __schema\n { queryType { name } } }"}
# Fragment trick
{"query": "fragment f on __Schema { queryType { name } } { ...f }"}
# __type instead of __schema (often overlooked in blocklists)
{"query": "{ __type(name: \"User\") { fields { name type { name } } } }"}
# Via GET request (some servers allow GET, filter only POST)
GET /graphql?query={__schema{queryType{na
常见问题
什么是内省?
这是 GraphQL 的一项功能,可能会暴露完整的结构。这项技能会检查它是否开启。
如果内省已关闭怎么办?
这项技能建议进行字段发现,并检查拼写建议,这些仍可能暴露部分结构。
它提到了哪些工具?
它提到了 graphw00f、clairvoyance、GraphQLmap、graphql-cop 和 inql。
详情
作者的原始描述
GraphQL security hunting — introspection abuse, field suggestion enumeration (clairvoyance), batching DoS, IDOR via aliasing, auth bypass, injection via arguments, subscription abuse, depth/complexity bombs, and WAF bypass. Covers graphw00f fingerprinting, GraphQLmap, graphql-cop, and inql. Use when a target exposes a /graphql, /api/graphql, or GQL-over-HTTP endpoint.
热度
- GitHub 星标
- 5.5k
- 排名
- #14789
- 许可证
- MIT
- 更新时间
- 2026/10/28
评论
- …
同一仓库的更多技能
bug-bounty
5.5k帮你的智能体分阶段规划漏洞赏金审查,从检查项目范围、梳理资产,到测试线索、验证影响并撰写报告。
agentic-app-audit
5.5k帮你的智能体从外部审查正在运行的 AI 助手,检查其是否存在工具调用被劫持、记忆被投毒,以及以超出用户权限的方式执行操作等风险。
argus
5.5k帮你的智能体运行六种自动化扫描器,检查常见的 Web 和 AI 应用缺陷,例如开放的跨域访问、JWT 弱点,以及通过带外确认的盲注漏洞。
bb-methodology
5.5k帮你的智能体规划一次漏洞赏金测试会话,分阶段选择下一步和合适的检查,并舍弃无法造成真正危害的想法。