@@ -91,56 +91,36 @@ def extract_hashes_and_versions(keys)
91
91
92
92
def process_hashes_and_versions ( hashes_and_versions )
93
93
hashes_and_versions . each do |hash , version |
94
- if version >= VERSION_8 && version < VERSION_9
95
- # Base64 decode hash
96
- hash = Rex ::Text . to_hex ( Rex ::Text . decode_base64 ( hash ) , "" )
97
- print_good ( "McAfee v8 password hash: #{ hash } " )
98
- hashtype = 'dynamic_1405'
99
- elsif version >= VERSION_5 && version < VERSION_6
100
- print_good ( "McAfee v5 password hash: #{ hash } " )
94
+ if version >= VERSION_5 && version < VERSION_6
101
95
hashtype = 'md5u'
96
+ version_name = 'v5'
102
97
else
103
- print_warning ( "Could not identify the version of McAfee - Assuming v8" )
104
- print_good ( "McAfee v8 password hash: #{ hash } ")
98
+ # Base64 decode hash
99
+ hash = Rex :: Text . to_hex ( Rex :: Text . decode_base64 ( hash ) , " ")
105
100
hashtype = 'dynamic_1405'
101
+ version_name = 'v8'
102
+ if !( version >= VERSION_8 && version < VERSION_9 )
103
+ print_warning ( "Unknown McAfee version #{ version_name } - Assuming v8" )
104
+ end
106
105
end
107
106
108
- # report
109
- service_data = {
110
- address : ::Rex ::Socket . getaddress ( session . sock . peerhost , true ) ,
111
- port : rport ,
112
- service_name : 'McAfee' ,
113
- protocol : 'tcp' ,
114
- workspace_id : myworkspace_id
115
- }
107
+ print_good ( "McAfee #{ version_name } (#{ hashtype } ) password hash: #{ hash } " )
116
108
117
- # Initialize Metasploit::Credential::Core object
118
109
credential_data = {
119
110
post_reference_name : refname ,
120
111
origin_type : :session ,
121
- private_type : :password ,
112
+ private_type : :nonreplayable_hash ,
122
113
private_data : hash ,
123
114
session_id : session_db_id ,
124
115
jtr_format : hashtype ,
125
116
workspace_id : myworkspace_id ,
126
- username : "null"
127
117
}
128
118
129
- # Merge the service data into the credential data
130
- credential_data . merge! ( service_data )
131
-
132
- # Create the Metasploit::Credential::Core object
133
- credential_core = create_credential ( credential_data )
119
+ create_credential ( credential_data )
134
120
135
- # Assemble the options hash for creating the Metasploit::Credential::Login object
136
- login_data = {
137
- core : credential_core ,
138
- status : Metasploit ::Model ::Login ::Status ::UNTRIED
139
- }
140
-
141
- # Merge in the service data and create our Login
142
- create_credential_login ( login_data . merge! ( service_data ) )
121
+ # TODO: store_loot the file in the appropriate format, which likely means
122
+ # iterating over hashes_and_versions differently so that they are grouped
123
+ # by version (because john can only crack one format at a time)
143
124
end
144
125
end
145
-
146
126
end
0 commit comments