Skip to content

Commit 245c763

Browse files
committed
Update nessus_xmlrpc_logic to use the new creds API
1 parent a39539f commit 245c763

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

modules/auxiliary/scanner/nessus/nessus_xmlrpc_login.rb

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,43 @@ def do_login(user='nessus', pass='nessus')
110110
:active => true,
111111
:type => 'password'}
112112

113-
report_auth_info(report_hash)
113+
report_cred(
114+
ip: datastore['RHOST'],
115+
port: datastore['RPORT'],
116+
service_name: 'nessus-xmlrpc',
117+
user: user,
118+
password: pass
119+
)
114120
return :next_user
115121
end
116122
end
117123
vprint_error("FAILED LOGIN. '#{user}' : '#{pass}'")
118124
return :skip_pass
119125
end
126+
127+
def report_cred(opts)
128+
service_data = {
129+
address: opts[:ip],
130+
port: opts[:port],
131+
service_name: opts[:service_name],
132+
protocol: 'tcp',
133+
workspace_id: myworkspace_id
134+
}
135+
136+
credential_data = {
137+
origin_type: :service,
138+
module_fullname: fullname,
139+
username: opts[:user],
140+
private_data: opts[:password],
141+
private_type: :password
142+
}.merge(service_data)
143+
144+
login_data = {
145+
core: create_credential(credential_data),
146+
status: Metasploit::Model::Login::Status::UNTRIED,
147+
}.merge(service_data)
148+
149+
create_credential_login(login_data)
150+
end
151+
120152
end

0 commit comments

Comments
 (0)