Graphicator 是一个 GraphQL "抓取器" / 提取器。该工具会遍历目标 GraphQL 端点返回的内省文档,然后重新构建内部形式的 schema,以便重新创建支持的查询。当这些查询创建完成后,工具会使用它们向端点发送请求,并将返回的响应保存到文件中。
错误的响应不会被保存。默认情况下,工具会缓存正确的响应以及错误信息,因此重新运行工具时不会重复执行相同的查询。
请明智地使用它,并且仅在你拥有权限的目标上进行操作。
我们希望该工具能帮助你作为渗透测试人员自动化自己的测试,同时也能推动那些尚未进行 GraphQL 测试的人开始行动。
了解如何对 GraphQL 端点进行评估:https://cybervelia.com/?p=736&preview=true
python3 -m pip install -r requirements.txt
docker run --rm -it -p8005:80 cybervelia/graphicator --target http://the-target:port/graphql --verbose
任务完成后,它会将结果压缩,并通过运行在 8005 端口上的 Web 服务器提供该压缩包。要终止容器,请按 CTRL+C。容器停止后,数据也会被删除。你也可以根据需要更改主机端口。
python3 graphicator.py [args...]
第一步是配置目标。为此,你需要提供 --target 选项或使用 --file 参数指定文件。
通过参数设置单个目标
python3 graphicator.py --target https://subdomain.domain:port/graphql
设置多个目标
python3 graphicator.py --target https://subdomain.domain:port/graphql --target https://target2.tld/graphql
通过文件设置目标
python3 graphicator.py --file file.txt
文件内容应为每行一个 URL,格式如下:
http://target1.tld/graphql
http://sub.target2.tld/graphql
http://subxyz.target3.tld:8080/graphql
你可以将工具与任何代理连接。
连接到默认的 Burp 设置(端口 8080)
python3 graphicator.py --target target --default-burp-proxy
连接到自定义代理
python3 graphicator.py --target target --use-proxy
通过 Tor 连接
python3 graphicator.py --target target --use-tor
python3 graphicator.py --target target --header "x-api-key:60b725f10c9c85c70d97880dfe8191b3"
python3 graphicator.py --target target --verbose
python3 graphicator.py --target target --multi
python3 graphicator.py --target target --insecure
python3 graphicator.py --target target --no-cache
python3 graphicator.py --target http://localhost:8000/graphql --verbose --multi
_____ __ _ __
/ ___/____ ___ _ ___ / / (_)____ ___ _ / /_ ___ ____
/ (_ // __// _ `// _ \ / _ \ / // __// _ `// __// _ \ / __/
\___//_/ \_,_// .__//_//_//_/ \__/ \_,_/ \__/ \___//_/
/_/
By @fand0mas
[-] Targets: 1
[-] Headers: 'Content-Type', 'User-Agent'
[-] Verbose
[-] Using cache: True
************************************************************
0%| | 0/1 [00:00<?, ?it/s][*] Enumerating... http://localhost:8000/graphql
[*] Retrieving... => query {getArticles { id,title,views } }
[*] Retrieving... => query {getUsers { id,username,email,password,level } }
100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 35.78it/s]
$ cat reqcache/9652f1e7c02639d8f78d1c5263093072fb4fd06c.json
{
"data": {
"getUsers": [
{
"id": 1,
"username": "theo",
"email": "[email protected]",
"password": "1234",
"level": 1
},
{
"id": 2,
"username": "john",
"email": "[email protected]",
"password": "5678",
"level": 1
}
]
}
}
$ cat reqcache-queries/9652f1e7c02639d8f78d1c5263093072fb4fd06c.query
query {getUsers { id,username,email,password,level } }
会创建三个文件夹:
reqcache 目录中对应响应文件的文件名一致。文件名是基于查询内容和 URL 生成的哈希值。
版权所有 2023 Cybervelia Ltd
特此免费授予任何获得本软件及关联文档文件(以下简称"软件")副本的人,不受限制地处理本软件的权利,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或销售本软件的副本,并允许向提供本软件的人员做出上述行为,但须满足以下条件:
上述版权声明和本许可声明应包含在本软件的所有副本或重要部分中。
本软件按"现状"提供,不提供任何明示或暗示的担保,包括但不限于适销性、特定用途适用性和非侵权性的担保。在任何情况下,作者或版权持有人均不对因本软件或本软件的使用或其他交易而引起的任何索赔、损害赔偿或其他责任承担责任,无论该等责任是基于合同、侵权或其他原因。
本工具由 (@fand0mas) 创建并维护。
欢迎贡献。