dolevf/graphw00f
GitHub: dolevf/graphw00f
graphw00f 是用于检测和指纹识别 GraphQL 服务器实现的工具,帮助安全人员快速了解后端技术及其安全特性。
Stars: 813 | Forks: 91
感谢 Nick Aleks 提供的徽标!
graphw00f - GraphQL 服务器指纹识别
# 目录 * [How does it work?](#how-does-it-work) * [Detections](#detections) * [GraphQL Threat Matrix](#graphql-threat-matrix) * [Prerequisites](#prerequisites) * [Installation](#installation) * [Configuration](#configuration) * [Example Usage](#example) * [Fingerprinting GraphQL](#fingerprinting-graphql) * [Detecting & Fingerprinting GraphQL](#detecting-and-fingerprinting-graphql) * [Support & Issues](#support-and-issues) * [Resources](#resources) # 它是如何工作的? graphw00f(受 [wafw00f](https://github.com/EnableSecurity/wafw00f) 启发)是用于 GQL 端点的 GraphQL 指纹识别工具,它发送混合的良性和异常查询,以确定后台运行的 GraphQL 引擎。 graphw00f 将利用 GraphQL Threat Matrix 项目提供关于每种技术默认提供的安全防御以及它们是否默认开启的信息。 精心构造的查询会使不同的 GraphQL 服务器实现对查询、变更和订阅产生独特的响应,这使得指纹识别后端引擎并区分不同的 GraphQL 实现变得非常容易。(CWE: [CWE-200](https://cwe.mitre.org/data/definitions/200.html)) graphw00f 支持检测和指纹识别使用 GET 或 POST 查询的 GraphQL 服务器。 # 检测 graphw00f 目前尝试发现以下 GraphQL 引擎: * Graphene - Python * Ariadne - Python * Apollo - TypeScript * graphql-go - Go * gqlgen - Go * WPGraphQL - PHP * GraphQL API for Wordpress - PHP * Gato GraphQL - PHP * graphql-ruby - Ruby * graphql-php - PHP * Hasura - Haskell * HyperGraphQL - Java * graphql-java - Java * Juniper - Rust * Sangria - Scala * Flutter - Dart * Diana.jl - Julia * Strawberry - Python * Tartiflette - Python * Dgraph - JavaScript * Directus - TypeScript * AWS AppSync * GraphQL Yoga - TypeScript * Lighthouse - PHP * Agoo - Ruby * Mercurius - JavaScript * morpheus-graphql - Haskell * Lacinia - Clojure * Caliban - Scala * jaal - Golang * absinthe-graphql - Elixir * GraphQL.NET - Microsoft .NET * pg_graphql - Rust * tailcall - Rust * Hot Chocolate - Microsoft .NET * Inigo - Go * ballerina-graphql - Ballerina # GraphQL 威胁矩阵 graphw00f 项目使用 [GraphQL Threat Matrix Project](https://github.com/nicholasaleks/graphql-threat-matrix/) 作为其技术安全矩阵数据库。当 graphw00f 成功指纹识别一个 GraphQL 端点时,它会打印出威胁矩阵文档。该文档帮助安全工程师了解技术的成熟度、提供的安全特性以及是否包含任何 CVE。  # 前置条件 * python3 * requests # 安装 ## 克隆仓库 `git clone https://github.com/dolevf/graphw00f.git` ## 运行 graphw00f ``` Usage: main.py -d -f -t http://example.com Options: -h, --help show this help message and exit -r, --noredirect Do not follow redirections given by 3xx responses -t URL, --target=URL target url with the path -f, --fingerprint fingerprint mode -d, --detect detect mode -p PROXY, --proxy=PROXY HTTP(S) proxy URL in the form http://user:pass@host:port -T TIMEOUT, --timeout=TIMEOUT Request timeout in seconds -o OUTPUT_FILE, --output-file=OUTPUT_FILE Output results to a file (CSV) -l, --list List all GraphQL technologies graphw00f is able to detect -u USERAGENT, --user-agent=USERAGENT Custom user-agent to use (overrides the one from headers configuration) -H HEADER, --header=HEADER Custom headers to send (e.g. "Authorization: Bearer ey..."). -w WORDLIST, --wordlist=WORDLIST Path to a list of custom GraphQL endpoints -v, --version Print out the current version and exit. ``` # 配置 graphw00f 并不需要太多配置。但如果您需要为特定端点设置授权头或 Cookie,请使用 `conf.py` 文件。 ``` # 自定义标题 HEADERS = {'User-Agent':'graphw00f'} # 自定义 Cookie COOKIES = {"PHPSESS":"DEADBEEF"} ``` 使用 `--user-agent` 会添加 `User-Agent` 键,无论 `conf.py` 文件是否已有该键;如果文件已有,则命令行参数会覆盖它。 # 示例 ## 指纹识别 GraphQL 下面是一个示例,展示如何指纹识别(`-f`)已知位置(`/graphql`)的 GraphQL 端点 ``` python3 main.py -f -t https://demo.hypergraphql.org:8484/graphql +-------------------+ | graphw00f | +-------------------+ *** *** ** *** ** ** +--------------+ +--------------+ | Node X | | Node Y | +--------------+ +--------------+ *** *** ** ** ** ** +------------+ | Node Z | +------------+ graphw00f - v1.0.7 The fingerprinting tool for GraphQL Dolev Farhi标签:Docker, GET/POST请求分析, Go, GraphQL安全矩阵, GraphQL引擎检测, Greenbone, GVM, OpenVAS, PHP, Python, Ruby, Ruby工具, TypeScript, 合规检查, 安全专业人士, 安全分析, 安全扫描器, 安全插件, 安全测试, 安全防御评估, 安全防护, 扫描引擎, 攻击性安全, 攻击面分析, 无后门, 知识库, 网络安全, 逆向工具, 隐私保护, 风险评估