Graphicator:一款功能强大的GraphQL枚举与提取工具

admin 2023年4月24日08:35:19评论33 views字数 2876阅读9分35秒阅读模式
Graphicator:一款功能强大的GraphQL枚举与提取工具

关于Graphicator

Graphicator上一款功能强大的GraphQL枚举与提取工具,该工具可以对目标GraphQL节点返回的内部文档进行迭代,然后以内部形式重新构建数据模式,以便重新创建支持的查询。创建此类查询时,将使用它们向GraphQL节点发送请求,并将返回的响应保存到文件中。
工具不会保存错误的响应数据,默认情况下,该工具会缓存正确的响应,也会缓存错误,因此当重新运行该工具时,它不会再次进入相同的查询。
该工具旨在帮助广大研究人员以自动化的形式处理自己的渗透测试流程,并为针对GraphQL的安全研究助力。

工具安装

本地安装

由于该工具基于Python 3开发,因此我们首先需要在本地设备上安装并配置好Python 3环境。接下来,广大研究人员可以使用下列命令将该项目源码克隆至本地:
git clone https://github.com/cybervelia/graphicator.git
(向右滑动,查看更多)
然后切换到项目目录中,并使用pip3命令和项目提供的requirements.txt安装该工具所需的依赖组件:
cd graphicator
python3 -m pip install -r requirements.txt

Docker使用

docker run --rm -it -p8005:80 cybervelia/graphicator --target http://the-target:port/graphql --verbose
(向右滑动,查看更多
任务执行完成后,工具会将所有结果打包压缩,并可以通过Web服务器的端口8005访问。如需终止容器运行,直接按下CTRL + C即可。容器终止运行后,对应的数据也会直接删除。

工具使用

设置目标

首先我们需要设置目标GraphQL节点,可以通过--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
(向右滑动,查看更多
目标文件列表格式如下:
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
(向右滑动,查看更多

使用Header

python3 graphicator.py --target target --header "x-api-key:60b725f10c9c85c70d97880dfe8191b3"
(向右滑动,查看更多

启用Verbose模式

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 } }
(向右滑动,查看更多

许可证协议

本项目的开发与发布遵循MIT开源许可证协议。

项目地址

Graphicator:https://github.com/cybervelia/graphicator

参考资料

https://cybervelia.com/?p=736&preview=true
精彩推荐

Graphicator:一款功能强大的GraphQL枚举与提取工具Graphicator:一款功能强大的GraphQL枚举与提取工具

Graphicator:一款功能强大的GraphQL枚举与提取工具

Graphicator:一款功能强大的GraphQL枚举与提取工具

原文始发于微信公众号(FreeBuf):Graphicator:一款功能强大的GraphQL枚举与提取工具

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年4月24日08:35:19
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Graphicator:一款功能强大的GraphQL枚举与提取工具http://cn-sec.com/archives/1682828.html

发表评论

匿名网友 填写信息