fix to_credential on core

the Metasploit::Credential::Core to_credential
method now seats private_type and realm_key correctly
This commit is contained in:
David Maloney
2014-07-07 18:05:04 -05:00
parent aeda74f394
commit 38419dae83
2 changed files with 9 additions and 2 deletions
@@ -1,12 +1,19 @@
# Adds associations to `Metasploit::Credential::Core` which are inverses of association on models under
# {BruteForce::Reuse}.
require 'metasploit/framework/credential'
module Metasploit::Credential::Core::ToCredential
extend ActiveSupport::Concern
included do
def to_credential
Metasploit::Framework::Credential.new(public: public.try(:username), private: private.try(:data), realm: realm.try(:value) )
if private.present?
private_type = private.type.demodulize.underscore.to_sym
else
private_type = nil
end
Metasploit::Framework::Credential.new(public: public.try(:username), private: private.try(:data), private_type: private_type, realm: realm.try(:value), realm_key: realm.try(:key) )
end
end
@@ -78,7 +78,7 @@ class Metasploit::Framework::CredentialCollection
# @yieldparam credential [Metasploit::Framework::Credential]
# @return [void]
def each
if pass_file
if pass_file.present?
pass_fd = File.open(pass_file, 'r:binary')
end