phor3nsic/authorizgrapher
GitHub: phor3nsic/authorizgrapher
一款通过 introspection 模式文件批量检测不同用户角色对 GraphQL 各 query/mutation 访问权限的授权安全测试工具。
Stars: 6 | Forks: 1
AuthorizGrapher
通过 introspection 检查哪些用户可以与 query 或 mutation 进行交互。
由 phor3nsic 用 💙 编写
## 安装说明 📡 ### 安装 #### 安全模式 ``` git clone https://github.com/phor3nsic/authorizgrapher.git cd authorizgrapher python3 -m venv venv source ./venv/bin/activate pip install requests ``` #### 普通模式 ``` git clone https://github.com/phor3nsic/authorizgrapher.git cd authorizgrapher pip install requests ``` ## 示例 💡 ### 帮助 ``` ➜ python3 authorizgrapher.py -h usage: authorizgrapher.py [-h] -u URL [-H HEADERS] -i INTROSPECTION_FILE options: -h, --help show this help message and exit -u URL, --url URL URL to make tests. Ex: https://test.com/graphql -H HEADERS, --headers HEADERS Headers for the request in JSON format or "Key: Value, Key2: Value2" -i INTROSPECTION_FILE, --introspection_file INTROSPECTION_FILE Introspection file to get query/mutation ``` #### 创建凭证文件 你需要像这样创建一个 `creds.json` 文件: ``` {"Admin":{"user":"admin@example.com","token":"eyJhbGciOiJ..."}} {"Editor":{"user":"editor@example.com","token":"eyJhbGciOiJ..."}} {"Normal":{"user":"normal@example.com","token":"eyJhbGciOiJ..."}} ``` #### 用法 使用一个 introspection 文件和 `creds.json`,像这样发起请求: ``` python3 authorizgrapher.py --headers "Authorization: Bearer %AUTH%, Content-Type: application/json" -u https://example.com/graphql -i introspection.json ``` 你将得到如下结果: ``` [status: Work] [query: getUsers] Admin [status: Work] [query: getLogins] Admin [status: Work] [query: testString] Admin [status: Work] [query: getFailedTransactions] Admin [status: Work] [query: forgotPassword] Admin [status: Work] [query: testString] Editor [status: Work] [query: forgotPassword] Editor [status: Work] [query: getLogins] Normal [status: Work] [query: testString] Normal [status: Work] [query: forgotPassword] Normal ``` ## 贡献 🛠 只需提交一个 [issue](https://github.com/phor3nsic/authorizgrapher/issues) 或 [pull request](https://github.com/phor3nsic/authorizgrapher/pulls) 即可。 ## 许可证 📝 本仓库遵循 [MIT License](https://github.com/phor3nsic/authorizgrapher/blob/master/LICENSE)。 通过 [ph0r3nsic@wearehackerone.com](mailto:ph0r3nsic@wearehackerone.com) 联系我。标签:CISA项目, GraphQL, Python, 安全测试, 应用安全, 攻击性安全, 无后门, 权限测试, 越权检测, 逆向工具