Skip to content

Commit 9d50fb6

Browse files
committed
Fix jtr_format assignment in HashCapture module
1 parent 936e0df commit 9d50fb6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def validate_smb_hash_capture_datastore(datastore, ntlm_provider)
4141
print_line
4242
end
4343
end
44-
4544
def report_ntlm_type3(address:, ntlm_type1:, ntlm_type2:, ntlm_type3:)
4645
ntlm_message = ntlm_type3
4746
hash_type = nil
@@ -54,12 +53,14 @@ def report_ntlm_type3(address:, ntlm_type1:, ntlm_type2:, ntlm_type3:)
5453
case ntlm_message.ntlm_version
5554
when :ntlmv1, :ntlm2_session
5655
hash_type = 'NTLMv1-SSP'
56+
jtr_format = Metasploit::Framework::Hashes::JTR_NTLMV1
5757
client_hash = "#{bin_to_hex(ntlm_message.lm_response)}:#{bin_to_hex(ntlm_message.ntlm_response)}"
5858

5959
combined_hash << ":#{client_hash}"
6060
combined_hash << ":#{bin_to_hex(challenge)}"
6161
when :ntlmv2
6262
hash_type = 'NTLMv2-SSP'
63+
jtr_format = Metasploit::Framework::Hashes::JTR_NTLMV2
6364
client_hash = "#{bin_to_hex(ntlm_message.ntlm_response[0...16])}:#{bin_to_hex(ntlm_message.ntlm_response[16..-1])}"
6465

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

6970
return if hash_type.nil?
7071

71-
jtr_format = ntlm_message.ntlm_version == :ntlmv1 ? Metasploit::Framework::Hashes::JTR_NTLMV1 : Metasploit::Framework::Hashes::JTR_NTLMV2
72-
7372
if active_db?
7473
origin = create_credential_origin_service(
7574
{

0 commit comments

Comments
 (0)