Path: blob/master/lib/msf/core/module/auth.rb
21537 views
module Msf::Module::Auth1def store_valid_credential(user:, private:, private_type: :password, proof: nil, service_data: {})2if service_data.empty? && self.respond_to?("service_details")3service_data = service_details4end56creation_data = {7module_fullname: self.fullname,8username: user,9private_data: private,10private_type: private_type,11workspace_id: myworkspace_id12}.merge(service_data)1314if service_data.empty?15cred_data = {16origin_type: :import,17filename: 'msfconsole' # default as values provided on the console18}.merge(creation_data)19framework.db.create_credential(cred_data)20else21login_data = {22proof: proof,23last_attempted_at: DateTime.now,24status: Metasploit::Model::Login::Status::SUCCESSFUL25}.merge(creation_data)26framework.db.create_credential_and_login(login_data)27end2829nil30end31end323334