作者:Cory Duplantis(@ctfhacker)/ 博客
Gladius 提供了一种自动化的方法,用于在渗透测试过程中从各种来源破解凭证。目前,我们支持破解来自 Responder、secretsdump.py 和 smart_hashdump 的哈希值。
pip install watchdog
git clone https://www.github.com/praetorian-inc/gladius
cd gladius
git clone https://www.github.com/praetorian-inc/Hob0Rules
cp Hob0Rules/* .
rm -rf Hob0Rules/
python gladius.py --hashcat ../hashcat/hashcat-cli64.bin -r d3adhob0.rule -w rockyou.txt
现在按正常方式启动 Responder 会话
cd /usr/share/responder
python Responder.py -i YOUR_IP -I YOUR_INTERFACE
将 secretsdump 的结果发送给 Gladius 进行解析和破解。
for ip in $(cat ips); do secretsdump.py DOMAIN/username:password@$ip > /usr/share/responder/secretsdump_$ip; done
$ python gladius.py -h
usage: gladius.py [-h] [-v] [--responder-dir RESPONDER_DIR]
[--hashcat HASHCAT] [-r RULESET] [-w WORDLIST] [--no-art]
optional arguments:
-h, --help show this help message and exit
-v, --verbose Increased output verbosity
--responder-dir RESPONDER_DIR
Directory to watch for Responder output
--hashcat HASHCAT Path to hashcat binary
-r RULESET, --ruleset RULESET
Ruleset to use with hashcat
-w WORDLIST, --wordlist WORDLIST
Wordlist to use with hashcat
--no-art Disable the sword ascii art for displaying credentials
and default to only text.
默认规则集是来自 Praetorian 的 Julian Dunning(@hob0man)优化过的 best64 规则集。他在该主题上的演讲可参见下方视频:
监控 Responder 日志目录中带有 *NTLM*txt 的文件。对于每个找到的文件,解析输出,创建一个包含新哈希值的临时文件,并以正确的哈希类型将其传递给 hashcat。
要监控来自 hashdump 的 NTLM 哈希,只需创建一个包含 hashdump NTLM 哈希的文件,并在文件名中包含 `hashdump`,然后将其放入 Responder 目录即可。
注意:需要手动检查 `./engagement/responderhander_out/*` 目录下的输出,以获取 `hashdump` 破解的结果。
监控 hashcat 的输出,并导出格式如下的文件:
域名 用户名 密码
要扩展 Gladius:
GladiusHandler。'*')添加一个正则匹配列表。process(self, event) 函数,对匹配模式的所有文件执行操作。class YourHandler(GladiusHandler):
patterns = ['*']
def process(self, event):
data = self.get_lines(event)
# 对数据进行处理
将自身添加到处理器列表:
handlers = [
(ResponderHandler, args.responder,
(CredsHandler, ResponderHandler().outpath),
(YourHandler, CredsHandler().outpath),
(YourHandler, '/tmp'),
]