@@ -56,13 +56,7 @@ def report_ntlm_type3(address:, ntlm_type1:, ntlm_type2:, ntlm_type3:)
5656
5757 return if hash_type . nil?
5858
59- # TODO: write method for mapping +major+ and +minor+ OS values to human-readable OS names.
60- # client_os_version = ::NTLM::OSVersion.read(type1_msg.os_version)
61- print_line "[SMB] #{ hash_type } Client : #{ address } "
62- # print_line "[SMB] #{hash_type} Client OS : #{client_os_version}"
63- print_line "[SMB] #{ hash_type } Username : #{ domain } \\ #{ user } "
64- print_line "[SMB] #{ hash_type } Hash : #{ combined_hash } "
65- print_line
59+ jtr_format = ntlm_message . ntlm_version == :ntlmv1 ? JTR_NTLMV1 : JTR_NTLMV2
6660
6761 if active_db?
6862 origin = create_credential_origin_service (
@@ -103,9 +97,30 @@ def report_ntlm_type3(address:, ntlm_type1:, ntlm_type2:, ntlm_type3:)
10397 # found_host.os_name = credential_options[:client_os_version]
10498 # found_host.save!
10599
100+ search_options = {
101+ realm : credential_options [ :realm_value ] ,
102+ user : credential_options [ :username ] ,
103+ hosts : credential_options [ :address ] ,
104+ jtr_format : credential_options [ :jtr_format ] ,
105+ type : Metasploit ::Credential ::NonreplayableHash ,
106+ workspace : framework . db . workspace
107+ }
108+ if framework . db . creds ( search_options ) . count > 0
109+ vprint_status ( "Skipping previously captured hash for #{ credential_options [ :realm_value ] } \\ #{ credential_options [ :username ] } " )
110+ return
111+ end
112+
106113 create_credential ( credential_options )
107114 end
108115
116+ # TODO: write method for mapping +major+ and +minor+ OS values to human-readable OS names.
117+ # client_os_version = ::NTLM::OSVersion.read(type1_msg.os_version)
118+ print_line "[SMB] #{ hash_type } Client : #{ address } "
119+ # print_line "[SMB] #{hash_type} Client OS : #{client_os_version}"
120+ print_line "[SMB] #{ hash_type } Username : #{ domain } \\ #{ user } "
121+ print_line "[SMB] #{ hash_type } Hash : #{ combined_hash } "
122+ print_line
123+
109124 if datastore [ 'JOHNPWFILE' ]
110125 path = build_jtr_file_name ( jtr_format )
111126
0 commit comments