Merge branch 'feature/MSP-10658/to_credential' into staging/electro-release

bug/bundler_fix
Lance Sanchez 2014-07-08 11:17:17 -05:00
commit 9d3caf9c2f
No known key found for this signature in database
GPG Key ID: 3922EB70FB80E8DD
2 changed files with 10 additions and 2 deletions

View File

@ -1,12 +1,20 @@
# 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) )
Metasploit::Framework::Credential.new(
public: public.try(:username),
private: private.try(:data),
private_type: private.try(:type).try(:demodulize).try(:underscore).try(:to_sym),
realm: realm.try(:value),
realm_key: realm.try(:key)
)
end
end

View File

@ -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