Land #5507, Update nessus_xmlrpc_logic to use the new creds API

bug/bundler_fix
wchen-r7 2015-06-15 02:59:01 -05:00
commit ebce415957
No known key found for this signature in database
GPG Key ID: 2384DB4EF06F730B
1 changed files with 36 additions and 13 deletions

View File

@ -99,22 +99,45 @@ class Metasploit3 < Msf::Auxiliary
if res.code == 200
if res.body =~ /<status>OK<\/status>/
print_good("SUCCESSFUL LOGIN. '#{user}' : '#{pass}'")
report_hash = {
:host => datastore['RHOST'],
:port => datastore['RPORT'],
:sname => 'nessus-xmlrpc',
:user => user,
:pass => pass,
:active => true,
:type => 'password'}
report_auth_info(report_hash)
print_good("SUCCESSFUL LOGIN. '#{user}':'#{pass}'")
report_cred(
ip: datastore['RHOST'],
port: datastore['RPORT'],
service_name: 'nessus-xmlrpc',
user: user,
password: pass
)
return :next_user
end
end
vprint_error("FAILED LOGIN. '#{user}' : '#{pass}'")
vprint_error("FAILED LOGIN. '#{user}':'#{pass}'")
return :skip_pass
end
def report_cred(opts)
service_data = {
address: opts[:ip],
port: opts[:port],
service_name: opts[:service_name],
protocol: 'tcp',
workspace_id: myworkspace_id
}
credential_data = {
origin_type: :service,
module_fullname: fullname,
username: opts[:user],
private_data: opts[:password],
private_type: :password
}.merge(service_data)
login_data = {
last_attempted_at: DateTime.now,
core: create_credential(credential_data),
status: Metasploit::Model::Login::Status::SUCCESSFUL,
}.merge(service_data)
create_credential_login(login_data)
end
end