使用增量模式破解 NTLM 哈希
在此步骤中,你将探索 John the Ripper 的增量模式,它执行暴力破解攻击。与字典攻击不同,增量模式系统地尝试字符组合,从简短、简单的组合开始,并逐渐增加复杂性。此方法对于破解不在字典中的密码非常有效,但对于长密码或复杂密码可能非常耗时。
John the Ripper 的增量模式使用字符集和规则来生成密码。对于 NTLM 哈希,我们可以指定 NT 格式并使用 --incremental 选项。John the Ripper 具有内置的增量模式(例如 alnum、digits、all)。我们将使用默认的增量模式,它会尝试各种字符集。
在运行增量模式之前,重置 John the Ripper 的会话是一个好习惯,以避免与先前破解的哈希发生冲突。
john --session=reset
现在,在增量模式下针对 ntlm_hashes.txt 文件运行 John the Ripper。此过程可能需要一些时间,具体取决于剩余未破解哈希的复杂性。
john --format=NT --incremental ~/project/ntlm_hashes.txt
当 John the Ripper 尝试破解剩余的哈希时,你可能会看到类似以下的输出:
Using default input encoding: UTF-8
Loaded 5 password hashes with no different salts (NT [MD4 HASHES])
Remaining 2 password hashes to crack
Will run 4 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
(user5)
(user3)
2g 0:00:00:00 DONE (2023-10-27 08:05) 100.0% (ETA: 08:05) 2.500g/s 7.500p/s 7.500c/s 7.500C/s
Session completed.
过程完成后,再次使用 john --show 检查已破解的密码。
john --show ~/project/ntlm_hashes.txt
你现在应该看到所有哈希都已破解,包括 user3 和 user5。user3 的密码是 admin,而 user5 的密码是空字符串(表示为 "" 或冒号后的空白)。
user1:password
user2:test
user4:123456
user3:admin
user5:
5 password hashes cracked, 0 left
这展示了增量模式对于破解可能不在字典中,尤其是简短或简单的密码的有效性。