graphw00f(灵感来源于 wafw00f)是针对 GQL 端点的 GraphQL 指纹识别工具,它通过发送一系列良性和畸形的查询来识别后台运行的 GraphQL 引擎。 graphw00f 将利用 GraphQL 威胁矩阵项目,提供每项技术默认提供的安全防御措施以及它们是默认开启还是关闭的洞察。
精心构造的查询会导致不同的 GraphQL 服务器实现以独特的方式响应查询、变更和订阅,这使得指纹识别后端引擎并区分各种 GraphQL 实现变得轻而易举。(CWE: CWE-200)
graphw00f 支持检测和指纹识别使用 GET 或 POST 查询方式的 GraphQL 服务器。
graphw00f 目前尝试发现以下 GraphQL 引擎:
graphw00f 项目使用 GraphQL 威胁矩阵项目 作为其技术安全矩阵数据库。当 graphw00f 成功识别出 GraphQL 端点时,它会打印出威胁矩阵文档。该文档帮助安全工程师判断技术的成熟度、提供了哪些安全功能,以及是否包含任何 CVE。

git clone https://github.com/dolevf/graphw00f.git
Usage: main.py -d -f -t http://example.com
Options:
-h, --help 显示此帮助信息并退出
-r, --noredirect 不跟随 3xx 响应给出的重定向
-t URL, --target=URL 目标 URL(包含路径)
-f, --fingerprint 指纹识别模式
-d, --detect 检测模式
-p PROXY, --proxy=PROXY
HTTP(S) 代理 URL,格式为
http://user:pass@host:port
-T TIMEOUT, --timeout=TIMEOUT
请求超时时间(秒)
-o OUTPUT_FILE, --output-file=OUTPUT_FILE
将结果输出到文件(CSV)
-l, --list 列出 graphw00f 能够检测的所有 GraphQL 技术
-u USERAGENT, --user-agent=USERAGENT
自定义 User-Agent(覆盖 headers 配置中的)
-H HEADER, --header=HEADER
发送的自定义请求头(例如 "Authorization: Bearer ey...")
-w WORDLIST, --wordlist=WORDLIST
自定义 GraphQL 端点列表的路径
-v, --version 输出版本号并退出
graphw00f 不需要太多配置。但如果需要为特定端点设置 Authorization 请求头或 Cookie,请使用 conf.py 文件。
# 自定义请求头
HEADERS = {'User-Agent':'graphw00f'}
# 自定义 Cookie
COOKIES = {"PHPSESS":"DEADBEEF"}
使用 --user-agent 会添加 User-Agent 键,无论 conf.py 文件中是否有定义;如果文件中已存在,命令行参数会覆盖它。
以下示例演示如何对已知 GraphQL 位置(/graphql)的端点进行指纹识别(-f)
python3 main.py -f -t https://demo.hypergraphql.org:8484/graphql
+-------------------+
| graphw00f |
+-------------------+
*** ***
** ***
** **
+--------------+ +--------------+
| Node X | | Node Y |
+--------------+ +--------------+
*** ***
** **
** **
+------------+
| Node Z |
+------------+
graphw00f - v1.0.7
GraphQL 指纹识别工具
Dolev Farhi <[email protected]>
[*] 检查 GraphQL 是否可在 https://demo.hypergraphql.org:8484/graphql 获取...
[*] 发现 GraphQL...
[*] 尝试指纹识别...
[*] 发现 GraphQL 引擎:(HyperGraphQL)
[!] 攻击面矩阵:https://github.com/dolevf/graphw00f/blob/main/docs/hypergraphql.md
[!] 技术栈:Java
[!] 主页:https://www.hypergraphql.org
[*] 完成。
以下示例演示 graphw00f 如何检测(-d)GraphQL 所在位置,然后执行指纹识别过程(-f)。
python3 main.py -f -d -t http://localhost:5000
+-------------------+
| graphw00f |
+-------------------+
*** ***
** ***
** **
+--------------+ +--------------+
| Node X | | Node Y |
+--------------+ +--------------+
*** ***
** **
** **
+------------+
| Node Z |
+------------+
graphw00f - v1.1.2
GraphQL 指纹识别工具
Dolev Farhi <[email protected]>
[*] 检查 http://dvga.example.local:5000/graphql
[!] 在 http://dvga.example.local:5000/graphql 发现 GraphQL
[*] 尝试指纹识别...
[*] 发现 GraphQL 引擎:(Graphene)
[!] 攻击面矩阵:https://github.com/nicholasaleks/graphql-threat-matrix/blob/master/implementations/graphene.md
[!] 技术栈:Python
[!] 主页:https://graphene-python.org
[*] 完成。
如果 graphw00f 出现任何问题,例如误报、检测不准确、错误等,请创建 GitHub Issue 并提供环境详情。
想了解更多关于 GraphQL 的内容?请前往我的另一个项目,尽情攻击 GraphQL:Damn Vulnerable GraphQL Application