Tw1sm/spraycharles
GitHub: Tw1sm/spraycharles
一款低速率长时间运行的密码喷洒工具,支持多种企业认证协议,通过间隔喷洒规避账户锁定检测。
Stars: 218 | Forks: 37
Spraycharles
hey, yo I'm feeling like spraycharles - Chiddy Bang
  低速慢速密码喷洒工具,旨在长时间间隔内进行喷洒。 包含针对 `Office365`、`OWA`、`EWS`、`Okta`、`ADFS`、`Cisco SSL VPN`、`Citrix Netscaler`、`Sonicwall`、`NTLM over HTTP` 和 `SMB` 的喷洒插件。 [@sprocket_ed](https://twitter.com/sprocket_ed) 撰写的相关[博客文章](https://www.sprocketsecurity.com/blog/how-to-bypass-mfa-all-day),涵盖了 NTLM over HTTP、Exchange Web Services 和 Spraycharles。 ### 这个工具是什么? Spraycharles 是一个相对简单的密码喷洒器,设计于这样一个时期:当时没有太多公开可用的工具能让渗透测试过程中的密码喷洒实现非手动化。Spraycharles 最好的功能可能是能够使用 `-a/--attempts` 和 `-i/--interval` 设置长时间运行的喷洒任务,让它运行几天,同时定期检查。如果你有一个一次性的服务或独特的东西需要喷洒,创建一个新模块模板并开始喷洒也非常容易。 ### 这个工具不是什么? Spraycharles 最初并非为现代认证/云提供商设计的。如果你正在寻找更高级的功能,你可能需要查看 [CredMaster](https://github.com/knavesec/CredMaster) 或 [TeamFiltration](https://github.com/Flangvik/TeamFiltration) 等工具。Spraycharles 并非设计为_快速_工具——它是单线程的,更倾向于采用量/时间的方法。 ## 安装 可以通过 `pip3 install spraycharles` 安装 Spraycharles,或者通过克隆此仓库并运行 `pip3 install .` 来安装。 ### 使用 Docker 执行以下命令来构建 Spraycharles Docker 容器: ``` git clone https://github.com/Tw1sm/spraycharles cd spraycharles/extras docker build . -t spraycharles ``` 执行以下命令来使用 Spraycharles Docker 容器: ``` docker run -it -v ~/.spraycharles:/root/.spraycharles spraycharles -h ``` 你可能需要根据用户名和密码列表的存储位置指定额外的卷。 ### NixOS 对于 Nix 或 NixOS 用户,有一个可用的包。请记住,最新版本可能仅存在于 `unstable` 通道中。 ``` nix-env -iA nixos.spraycharles ``` ## 用法 `spray` 子命令: ``` Usage: spraycharles spray [OPTIONS] COMMAND [ARGS]... Low and slow password spraying ╭─ Options ─────────────────────────────────────────────────────────────────────────────╮ │ --debug Enable debug logging (overrides --quiet) │ │ --config TEXT Configuration file. │ │ --help -h Show this message and exit. │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─ User/Pass Config ────────────────────────────────────────────────────────────────────╮ │ * --usernames -u TEXT Filepath of the usernames list [default: None] │ │ [required] │ │ * --passwords -p TEXT Single password to spray or filepath of the passwords │ │ list │ │ [default: None] │ │ [required] │ │ --equal -e Does 1 spray for each user where password = username │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Spray Target ────────────────────────────────────────────────────────────────────────╮ │ --host -H TEXT Host to password spray (ip or │ │ hostname). Can by anything when │ │ using Office365 module - only │ │ used for logfile name │ │ [default: None] │ │ * --module -m [ADFS|CiscoSSLVPN|Citrix|NTLM Module corresponding to target │ │ |Office365|Okta|OWA|SMB|Sonic host │ │ wall] [default: None] │ │ [required] │ │ --path TEXT NTLM authentication endpoint │ │ (i.e., rpc or ews) │ │ [default: None] │ │ --port -P INTEGER Port to connect to on the │ │ specified host │ │ [default: 443] │ │ --fireprox -f TEXT URL of desired fireprox │ │ interface │ │ [default: None] │ │ --domain -d TEXT HTTP - Prepend DOMAIN\ to │ │ usernames; SMB - Supply domain │ │ for smb connection │ │ [default: None] │ │ --no-ssl Use HTTP instead of HTTPS │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Output ──────────────────────────────────────────────────────────────────────────────╮ │ --output -o TEXT Name and path of result output file [default: None] │ │ --quiet Will not log each login attempt to the console │ │ --analyze Run the results analyzer after each spray interval (Early │ │ false positives are more likely) │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Spray Behavior ──────────────────────────────────────────────────────────────────────╮ │ --attempts -a INTEGER Number of logins submissions per interval (for each │ │ user) │ │ [default: None] │ │ --interval -i INTEGER Minutes inbetween login intervals [default: None] │ │ --timeout -t INTEGER Web request timeout threshold [default: 5] │ │ --jitter INTEGER Jitter time between requests in seconds │ │ [default: None] │ │ --jitter-min INTEGER Minimum time between requests in seconds │ │ [default: None] │ │ --pause Pause the spray between intervals if a new potentially │ │ successful login was found │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Notifications ───────────────────────────────────────────────────────────────────────╮ │ --notify -n [Slack|Teams|Discord] Enable notifications for Slack, Teams or │ │ Discord │ │ [default: None] │ │ --webhook -w TEXT Webhook used for specified notification │ │ module │ │ [default: None] │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ``` ### 配置文件 由于通常使用的 CLI 标志数量较多,一种替代方法是使用 `--config` 标志从 yaml 文件填充命令行参数。此外,每次使用 Spraycharles 时,你的 CLI 选项都会写入当前目录中的一个 yaml 文件(`last-config.yaml`),以便于修改和重用。 ### 通知 Spraycharles 能够在可能成功的登录尝试后向 Discord、Slack 和 Microsoft Teams 发送通知。可以使用 utils/notify.py 脚本来扩展此通知提供者列表。对于任何潜在的通知代理,你必须指定其名称和 webhook URL。 你可以使用配置文件来指定这些内容,以保持命令简短: ``` notify: Slack webhook: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX ``` 发送给任何提供者的通知将包括与喷洒任务相关的目标主机名。这在同时喷洒多个目标时特别有用。 ### 更新用户名/密码文件 你可以在喷洒进行过程中对提供的用户名和密码文件进行更改。列表的添加或删除将在下一次密码轮换时生效。 ## 实用工具 Spraycharles 附带了一些额外的实用工具来辅助喷洒工作。Spraycharles 模块完整列表: ``` Usage: spraycharles [OPTIONS] COMMAND [ARGS]... ╭─ Options ─────────────────────────────────────────────────────────────────────────────╮ │ --help -h Show this message and exit. │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Commands ────────────────────────────────────────────────────────────────────────────╮ │ analyze Analyze Spraycharles output files for potential spray hits │ │ gen Generate custom password lists from JSON file │ │ modules List spraying modules │ │ parse Parse NTLM over HTTP and SMB endpoints to collect domain information │ │ spray Low and slow password spraying │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ ``` ### 生成自定义喷洒列表 Spraycharles 的 "gen" 子命令将根据 extras/list_elements.json 中提供的规范生成密码列表。 ``` spraycharles gen extras/list_elements.json custom_passwords.txt ``` ### 从 NTLM over HTTP 和 SMB 提取域 Spraycharles 的 parse 子命令将使用类似于下面列出的命令,从 NTLM over HTTP 和 SMB 服务中提取内部域。 ``` spraycharles parse https://example.com/ews spraycharles parse smb://host.domain.local ``` ### 分析结果文件 `analyze` 子模块可以读取你的输出 JSON 对象,并确定统计上相关的响应长度。如果有足够的数据,它应该能够从结果文件中提取成功的登录。这不是确定成功登录的唯一方法,具体取决于你的目标站点,我仍然建议你自己检查数据以确保没有遗漏任何内容。对于 SMB,它将简单地查找具有指示成功的 NTSTATUS 代码的条目。 ``` spraycharles analyze myresults.json ``` ## 免责声明 此工具旨在渗透测试期间使用;未经事先双方同意而使用此工具攻击目标是非法的。最终用户有责任遵守所有适用的地方、州和联邦法律。开发者不承担任何责任,并且不对本程序的任何滥用行为负责。 ## 开发 Spraycharles 使用 Poetry 来管理依赖。从源码安装并设置开发环境: ``` pip3 install poetry git clone https://github.com/Tw1sm/spraycharles cd spraycharles poetry install ``` ## 致谢 - [@sprocket_ed](https://twitter.com/sprocket_ed) 贡献了:几个喷洒模块、许多让 spraycharles 出色的功能,以及相关的博客文章 - [@b17zr](https://twitter.com/b17zr) 提供了 `ntlm_challenger.py` 脚本,该脚本包含在 `utils` 文件夹中标签:ADFS, Cisco VPN, NTLM, Office365, Okta, PoC, Python, Red Team, SMB, Spraycharles, 低速攻击, 凭证获取, 密码喷射, 密码审计, 数据展示, 无后门, 暴力破解, 红队, 自动化攻击, 请求拦截, 逆向工具, 错误配置检测