实验:访问私有 GraphQL 帖子

发布: (2026年1月14日 GMT+8 11:36)
2 分钟阅读
原文: Dev.to

Source: Dev.to

描述

此实验的博客页面包含一篇隐藏的博客文章,里面有一个秘密密码。要完成实验,找到隐藏的博客文章并输入密码。

链接:

问题分析

Recon

  • 访问博客页面 → 文章通过 POST 请求加载到 /graphql/v1

  • 在响应中,文章的 ID 是顺序的:1、2、4、5… → 缺少 ID 3 → 怀疑有一篇 ID 为 3 的隐藏文章

    Recon 1

  • 第 3 篇文章被隐藏

    Recon 2

利用

步骤 1:插入特殊查询

  1. 在 Repeater 中右键 → GraphQL > Set introspection query → 发送请求 → 响应返回完整 schema。

    Introspection schema

  2. 找到 BlogPost 类型 → 发现字段 postPassword 存在。

    BlogPost type

步骤 2:查询 ID 为 3 的隐藏文章并获取 postPassword

  1. 在 Repeater 中切换到 GraphQL 选项卡。
  2. Variables 面板:"id": 1 改为 "id": 3
  3. Query 面板:getBlogPost(id: $id) 内部添加字段 postPassword
query {
  getBlogPost(id: 3) {
    id
    title
    isPrivate
    postPassword
    summary
  }
}

返回结果中包含 id = 3 的文章密码。

提交

Submit step 1

Submit step 2

Back to Blog

相关文章

阅读更多 »