nikitastupin/clairvoyance
GitHub: nikitastupin/clairvoyance
一款能够绕过 GraphQL 内省禁用限制,通过模糊测试自动重建 API Schema 的安全工具。
Stars: 1396 | Forks: 123
# Clairvoyance
即使禁用了 introspection,也能获取 GraphQL API schema。
[](https://pypi.org/project/clairvoyance/)
[](https://pypi.org/project/clairvoyance/)
[](https://pypi.org/project/clairvoyance/)
[](https://github.com/nikitastupin/clairvoyance/blob/main/LICENSE)
## 简介
一些 GraphQL API 禁用了 introspection。例如,[Apollo Server 在 `NODE_ENV` 环境变量设置为 `production` 时会自动禁用 introspection](https://www.apollographql.com/docs/tutorial/schema/#explore-your-schema)。
Clairvoyance 有助于即使禁用了 introspection 也能获取 GraphQL API schema。它会生成适合 [GraphQL Voyager](https://github.com/APIs-guru/graphql-voyager)、[InQL](https://github.com/doyensec/inql) 或 [graphql-path-enum](https://gitlab.com/dee-see/graphql-path-enum) 等其他工具使用的 JSON 格式 schema。
## 入门指南
### pip
```
pip install clairvoyance
clairvoyance https://rickandmortyapi.com/graphql -o schema.json
# 大约需要 2 分钟
```
### docker
```
docker run --rm nikitastupin/clairvoyance --help
```
## 高级用法
### 我应该使用哪个字典?
至少有三种方法:
- 使用 Escape Technologies 收集的[字典](https://github.com/Escape-Technologies/graphql-wordlist)之一
- 使用通用英语单词(例如 [google-10000-english](https://github.com/first20hours/google-10000-english))。
- 通过从应用程序 HTTP 流量、移动应用程序静态文件等中提取所有有效的 GraphQL 名称,来创建针对特定目标的字典。GraphQL 名称的正则表达式为 [`[_A-Za-z][_0-9A-Za-z]*`](http://spec.graphql.org/June2018/#sec-Names)。
### 环境变量
```
LOG_FMT=`%(asctime)s \t%(levelname)s\t| %(message)s` # A string format for logging.
LOG_DATEFMT=`%Y-%m-%d %H:%M:%S` # A string format for logging date.
LOG_LEVEL=`INFO` # A string level for logging.
```
## 支持
如果有关于 Clairvoyance 的问题或疑问,请参阅 [wiki](https://github.com/nikitastupin/clairvoyance/wiki) 或 [issues](https://github.com/nikitastupin/clairvoyance/issues)。如果这不能解决您的问题,请随时打开一个 [新 issue](https://github.com/nikitastupin/clairvoyance/issues/new)。
## 文档
您可以在 [GraphQL APIs from bug hunter's perspective by Nikita Stupin](https://youtu.be/nPB8o0cSnvM) 演讲的下半部分找到关于该工具工作原理的更多详细信息。
## 贡献者
感谢贡献者的工作。
- [nikitastupin](https://github.com/nikitastupin)
- [Escape](https://escape.tech) 团队
- [iCarossio](https://github.com/iCarossio)
- [Swan](https://github.com/c3b5aw)
- [QuentinN42](https://github.com/QuentinN42)
- [Nohehf](https://github.com/Nohehf)
- [i-tsaturov](https://github.com/i-tsaturov)
- [EONRaider](https://github.com/EONRaider)
- [noraj](https://github.com/noraj)
- [belane](https://github.com/belane)
标签:API 安全, Apollo Server, Docker, GraphQL, GraphQL Voyager, InQL, Python, Rick and Morty API, VEH, Web 安全, 内省禁用绕过, 字典攻击, 安全防御评估, 密码管理, 接口探测, 无后门, 模式提取, 漏洞分析, 白盒测试, 请求拦截, 路径探测, 逆向工具