File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
modules/auxiliary/analyze Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ def initialize(info = {})
41
41
42
42
end
43
43
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
44
50
def john_lm_upper_to_ntlm ( pwd , hash )
45
51
pwd = pwd . upcase
46
52
hash = hash . upcase
Original file line number Diff line number Diff line change @@ -98,6 +98,12 @@ def run
98
98
end
99
99
end
100
100
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?
101
107
end
102
108
103
109
print_good "#{ username } :#{ password } :#{ core_id } "
You can’t perform that action at this time.
0 commit comments