Skip to content

Commit b71729b

Browse files
committed
fixed multi stored creds issue
1 parent d70d2c4 commit b71729b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

modules/post/windows/gather/credentials/spark_im.rb

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,18 @@ def run
102102

103103
# store the hash close the file
104104
password = password.delete_if {|e| e !~ /password.+=.+=\r/}
105-
hash = password[0].split("password").join.chomp
106-
print_status("Spark password hash: #{hash}") if datastore['VERBOSE']
107-
config.close
105+
password.each do | pass |
106+
if pass.nil?
107+
next
108+
end
108109

109-
# call to decrypt the hash
110-
decrypt(hash)
110+
hash = pass.split("password").join.chomp
111+
print_status("Spark password hash: #{hash}") if datastore['VERBOSE']
112+
113+
# call method to decrypt hash
114+
decrypt(hash)
115+
config.close
116+
end
111117
end
112118
end
113119
end

0 commit comments

Comments
 (0)