Skip to content

Commit 8ccc1eb

Browse files
committed
Land PR #16628, Log ntlm_session hashes
This PR fixes the logging and storing of NTLM session hashes
2 parents 6942e0c + 1e5f867 commit 8ccc1eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/msf/core/exploit/remote/smb/server/hash_capture.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,20 @@ def report_ntlm_type3(address:, ntlm_type1:, ntlm_type2:, ntlm_type3:)
3838
combined_hash = "#{user}::#{domain}"
3939

4040
case ntlm_message.ntlm_version
41-
when :ntlmv1
41+
when :ntlmv1, :ntlm2_session
4242
hash_type = 'NTLMv1-SSP'
4343
client_hash = "#{bin_to_hex(ntlm_message.lm_response)}:#{bin_to_hex(ntlm_message.ntlm_response)}"
4444

4545
combined_hash << ":#{client_hash}"
4646
combined_hash << ":#{bin_to_hex(challenge)}"
47+
jtr_format = JTR_NTLMV1
4748
when :ntlmv2
4849
hash_type = 'NTLMv2-SSP'
4950
client_hash = "#{bin_to_hex(ntlm_message.ntlm_response[0...16])}:#{bin_to_hex(ntlm_message.ntlm_response[16..-1])}"
5051

5152
combined_hash << ":#{bin_to_hex(challenge)}"
5253
combined_hash << ":#{client_hash}"
54+
jtr_format = JTR_NTLMV2
5355
end
5456

5557
return if hash_type.nil?
@@ -62,8 +64,6 @@ def report_ntlm_type3(address:, ntlm_type1:, ntlm_type2:, ntlm_type3:)
6264
print_line "[SMB] #{hash_type} Hash : #{combined_hash}"
6365
print_line
6466

65-
jtr_format = ntlm_message.ntlm_version == :ntlmv1 ? JTR_NTLMV1 : JTR_NTLMV2
66-
6767
if active_db?
6868
origin = create_credential_origin_service(
6969
{

0 commit comments

Comments
 (0)