Skip to content

Commit eee72a8

Browse files
committed
Fix the case when john cracks only half of LM
1 parent addecb6 commit eee72a8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/msf/core/auxiliary/jtr.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ def initialize(info = {})
4141

4242
end
4343

44+
# @param pwd [String] Password recovered from cracking an LM hash
45+
# @param hash [String] NTLM hash for this password
46+
# @return [String] `pwd` converted to the correct case to match the
47+
# given NTLM hash
48+
# @return [nil] if no case matches the NT hash. This can happen when
49+
# `pwd` came from a john run that only cracked half of the LM hash
4450
def john_lm_upper_to_ntlm(pwd, hash)
4551
pwd = pwd.upcase
4652
hash = hash.upcase

modules/auxiliary/analyze/jtr_crack_fast.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ def run
9898
end
9999
end
100100
password = john_lm_upper_to_ntlm(password, nt_hash)
101+
# password can be nil if the hash is broken (i.e., the NT and
102+
# LM sides don't actually match) or if john was only able to
103+
# crack one half of the LM hash. In the latter case, we'll
104+
# have a line like:
105+
# username:???????WORD:...:...:::
106+
next if password.nil?
101107
end
102108

103109
print_good "#{username}:#{password}:#{core_id}"

0 commit comments

Comments
 (0)