lib/metasploit/credential/exporter/pwdump.rb in metasploit-credential-0.14.2 vs lib/metasploit/credential/exporter/pwdump.rb in metasploit-credential-0.14.3

- old
+ new

@@ -84,10 +84,11 @@ unless instance_variable_defined? :@data @data = {} @data[:ntlm] = logins.select{ |l| l.core.private.present? && l.core.private.is_a?(Metasploit::Credential::NTLMHash) } @data[:non_replayable] = logins.select{ |l| l.core.private.present? && l.core.private.is_a?(Metasploit::Credential::NonreplayableHash) } @data[:password] = logins.select{ |l| l.core.private.present? && l.core.private.is_a?(Metasploit::Credential::Password) } + @data[:postgres_md5] = logins.select{ |l| l.core.private.present? && l.core.private.is_a?(Metasploit::Credential::PostgresMD5) } end @data end # The collection of {Metasploit::Credential::Login} objects that will get parsed for output in the export @@ -118,9 +119,17 @@ # @param login [Metasploit::Credential::Login] # @return [String] def format_password(login) creds_data = data_for_login(login) "#{creds_data[:username]} #{creds_data[:private_data]}" + end + + # Format a {Metasploit::Credential::Public} and a {Metasploit::Credential::PostgresMD5} for output + # @param login [Metasploit::Credential::Login] + # @return [String] + def format_postgres_md5(login) + creds_data = data_for_login(login) + "#{creds_data[:username]}:#{creds_data[:private_data]}" end # Returns a string for the host/service/port/proto/service name combination in the pwdump file. # This string is added to make it easier for a human to scan the file. # @param login [Metasploit::Credential::Login] the login to look at