@@ -176,10 +176,15 @@ def cisco_ios_config_eater(thost, tport, config)
176
176
177
177
178
178
when /^\s *(password|secret) 5 (.*)/i
179
- shash = $1 . strip
179
+ shash = $2 . strip
180
180
print_good ( "#{ thost } :#{ tport } MD5 Encrypted VTY Password: #{ shash } " )
181
181
store_loot ( "cisco.ios.vty_password" , "text/plain" , thost , shash , "vty_password_hash.txt" , "Cisco IOS VTY Password Hash (MD5)" )
182
-
182
+
183
+ cred = credential_data . dup
184
+ cred [ :private_data ] = shash
185
+ cred [ :private_type ] = :nonreplayable_hash
186
+ create_credential_and_login ( cred )
187
+
183
188
when /^\s *password (0 |)([^\s ]+)/i
184
189
spass = $2. strip
185
190
print_good ( "#{ thost } :#{ tport } Unencrypted VTY Password: #{ spass } " )
@@ -205,29 +210,29 @@ def cisco_ios_config_eater(thost, tport, config)
205
210
if stype == 5
206
211
print_good ( "#{ thost } :#{ tport } Wireless WPA-PSK MD5 Password Hash: #{ spass } " )
207
212
store_loot ( "cisco.ios.wireless_wpapsk_hash" , "text/plain" , thost , spass , "wireless_wpapsk_hash.txt" , "Cisco IOS Wireless WPA-PSK Password Hash (MD5)" )
213
+ cred = credential_data . dup
214
+ cred [ :private_data ] = spass
215
+ cred [ :private_type ] = :nonreplayable_hash
216
+ create_credential_and_login ( cred )
208
217
end
209
218
210
219
if stype == 0
211
220
print_good ( "#{ thost } :#{ tport } Wireless WPA-PSK Password: #{ spass } " )
212
- cred = cred_info . dup
213
- cred [ :pass ] = spass
214
- cred [ :type ] = "password"
215
- cred [ :collect_type ] = "password"
216
- store_cred ( cred )
217
-
218
221
store_loot ( "cisco.ios.wireless_wpapsk" , "text/plain" , thost , spass , "wireless_wpapsk.txt" , "Cisco IOS Wireless WPA-PSK Password" )
222
+ cred = credential_data . dup
223
+ cred [ :private_data ] = spass
224
+ cred [ :private_type ] = :nonreplayable_hash
225
+ create_credential_and_login ( cred )
219
226
end
220
227
221
228
if stype == 7
222
229
spass = cisco_ios_decrypt7 ( spass ) rescue spass
223
230
print_good ( "#{ thost } :#{ tport } Wireless WPA-PSK Decrypted Password: #{ spass } " )
224
- cred = cred_info . dup
225
- cred [ :pass ] = spass
226
- cred [ :type ] = "password"
227
- cred [ :collect_type ] = "password"
228
- store_cred ( cred )
229
-
230
231
store_loot ( "cisco.ios.wireless_wpapsk" , "text/plain" , thost , spass , "wireless_wpapsk.txt" , "Cisco IOS Wireless WPA-PSK Decrypted Password" )
232
+ cred = credential_data . dup
233
+ cred [ :private_data ] = spass
234
+ cred [ :private_type ] = :password
235
+ create_credential_and_login ( cred )
231
236
end
232
237
233
238
#
@@ -240,11 +245,11 @@ def cisco_ios_config_eater(thost, tport, config)
240
245
print_good ( "#{ thost } :#{ tport } VPN IPSEC ISAKMP Key '#{ spass } ' Host '#{ shost } '" )
241
246
store_loot ( "cisco.ios.vpn_ipsec_key" , "text/plain" , thost , "#{ spass } " , "vpn_ipsec_key.txt" , "Cisco VPN IPSEC Key" )
242
247
243
- cred = cred_info . dup
244
- cred [ :pass ] = spass
245
- cred [ :type ] = "password"
246
- cred [ :collect_type ] = "password"
247
- store_cred ( cred )
248
+ cred = credential_data . dup
249
+ cred [ :private_data ] = spass
250
+ cred [ :private_type ] = :nonreplayable_hash
251
+ create_credential_and_login ( cred )
252
+
248
253
when /^\s *interface tunnel(\d +)/i
249
254
tuniface = $1
250
255
@@ -254,25 +259,24 @@ def cisco_ios_config_eater(thost, tport, config)
254
259
255
260
print_good ( "#{ thost } :#{ tport } GRE Tunnel Key #{ spass } for Interface Tunnel #{ siface } " )
256
261
store_loot ( "cisco.ios.gre_tunnel_key" , "text/plain" , thost , "tunnel#{ siface } _#{ spass } " , "gre_tunnel_key.txt" , "Cisco GRE Tunnel Key" )
257
-
258
- cred = cred_info . dup
259
- cred [ :pass ] = spass
260
- cred [ :type ] = "password"
261
- cred [ :collect_type ] = "password"
262
- store_cred ( cred )
263
-
262
+
263
+ cred = credential_data . dup
264
+ cred [ :private_data ] = spass
265
+ cred [ :private_type ] = :nonreplayable_hash
266
+ create_credential_and_login ( cred )
267
+
264
268
when /^\s *ip nhrp authentication ([^\s ]+)/i
265
269
spass = $1
266
270
siface = tuniface
267
271
268
272
print_good ( "#{ thost } :#{ tport } NHRP Authentication Key #{ spass } for Interface Tunnel #{ siface } " )
269
273
store_loot ( "cisco.ios.nhrp_tunnel_key" , "text/plain" , thost , "tunnel#{ siface } _#{ spass } " , "nhrp_tunnel_key.txt" , "Cisco NHRP Authentication Key" )
270
-
271
- cred = cred_info . dup
272
- cred [ :pass ] = spass
273
- cred [ :type ] = "password"
274
- cred [ :collect_type ] = "password"
275
- store_cred ( cred )
274
+
275
+ cred = credential_data . dup
276
+ cred [ :private_data ] = spass
277
+ cred [ :private_type ] = :nonreplayable_hash
278
+ create_credential_and_login ( cred )
279
+
276
280
277
281
#
278
282
# Various authentication secrets
0 commit comments