Skip to content

Commit dfb1ed6

Browse files
committed
Land rapid7#19842, fixing jtr_format for NTLM hashes
2 parents 94c1167 + 8e68d1d commit dfb1ed6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ def report_ntlm_type3(address:, ntlm_type1:, ntlm_type2:, ntlm_type3:)
5454
case ntlm_message.ntlm_version
5555
when :ntlmv1, :ntlm2_session
5656
hash_type = 'NTLMv1-SSP'
57+
jtr_format = Metasploit::Framework::Hashes::JTR_NTLMV1
5758
client_hash = "#{bin_to_hex(ntlm_message.lm_response)}:#{bin_to_hex(ntlm_message.ntlm_response)}"
5859

5960
combined_hash << ":#{client_hash}"
6061
combined_hash << ":#{bin_to_hex(challenge)}"
6162
when :ntlmv2
6263
hash_type = 'NTLMv2-SSP'
64+
jtr_format = Metasploit::Framework::Hashes::JTR_NTLMV2
6365
client_hash = "#{bin_to_hex(ntlm_message.ntlm_response[0...16])}:#{bin_to_hex(ntlm_message.ntlm_response[16..-1])}"
6466

6567
combined_hash << ":#{bin_to_hex(challenge)}"
@@ -68,8 +70,6 @@ def report_ntlm_type3(address:, ntlm_type1:, ntlm_type2:, ntlm_type3:)
6870

6971
return if hash_type.nil?
7072

71-
jtr_format = ntlm_message.ntlm_version == :ntlmv1 ? Metasploit::Framework::Hashes::JTR_NTLMV1 : Metasploit::Framework::Hashes::JTR_NTLMV2
72-
7373
if active_db?
7474
origin = create_credential_origin_service(
7575
{

0 commit comments

Comments
 (0)