Use create_credential when importing XML files

GSoC/Meterpreter_Web_Console
James Barnett 2018-07-10 10:37:46 -05:00
parent d3eb71e8e5
commit 35f52a129c
No known key found for this signature in database
GPG Key ID: 647983861A4EC5EA
1 changed files with 11 additions and 4 deletions

View File

@ -452,10 +452,17 @@ module Msf::DBManager::Import::MetasploitFramework::XML
pass = cred.at('pass').try(:text) pass = cred.at('pass').try(:text)
pass = "" if pass == "*MASKED*" pass = "" if pass == "*MASKED*"
private = create_credential_private(private_data: pass, private_type: :password) cred_opts = {
public = create_credential_public(username: username) workspace: wspace.name,
core = create_credential_core(private: private, public: public, origin: origin, workspace_id: wspace.id) username: username,
private_data: pass,
private_type: 'Metasploit::Credential::Password',
service_name: sname,
protocol: proto,
port: port,
origin: origin
}
core = create_credential(cred_opts)
create_credential_login(core: core, create_credential_login(core: core,
workspace_id: wspace.id, workspace_id: wspace.id,
address: hobj.address, address: hobj.address,