2012-11-15 21:28:56 +00:00
|
|
|
##
|
2012-11-15 21:43:47 +00:00
|
|
|
# nessus_xmlrpc_ping.rb
|
2012-11-15 21:28:56 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2012-11-15 21:28:56 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
2016-03-07 08:56:58 +00:00
|
|
|
class Metasploit < Msf::Auxiliary
|
2012-11-15 21:28:56 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
include Msf::Auxiliary::Scanner
|
2012-11-15 21:28:56 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'Nessus XMLRPC Interface Ping Utility',
|
|
|
|
'Description' => %q{
|
|
|
|
This module simply attempts to find and check
|
|
|
|
for Nessus XMLRPC interface.'
|
|
|
|
},
|
|
|
|
'Author' => [ 'Vlatko Kosturjak <kost[at]linux.hr>' ],
|
2016-01-22 08:54:52 +00:00
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'DefaultOptions' => { 'SSL' => true }
|
2013-08-30 21:28:54 +00:00
|
|
|
)
|
2012-11-15 21:28:56 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(8834),
|
|
|
|
OptInt.new('THREADS', [true, "The number of concurrent threads", 25]),
|
|
|
|
OptString.new('URI', [true, "URI for Nessus XMLRPC. Default is /", "/"])
|
|
|
|
], self.class)
|
|
|
|
end
|
2012-11-15 21:28:56 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def run_host(ip)
|
|
|
|
begin
|
|
|
|
res = send_request_cgi({
|
|
|
|
'uri' => datastore['URI'],
|
|
|
|
'method' => 'GET'
|
|
|
|
}, 25)
|
|
|
|
http_fingerprint({ :response => res })
|
|
|
|
rescue ::Rex::ConnectionError => e
|
|
|
|
vprint_error("#{datastore['URI']} - #{e.to_s}")
|
|
|
|
return
|
|
|
|
end
|
2012-11-15 21:28:56 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if not res
|
|
|
|
vprint_error("#{datastore['URI']} - No response")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if not (res.code == 200 or res.code ==302)
|
|
|
|
vprint_error("HTTP Response was not 200/302")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
if res.headers['Server'] =~ /NessusWWW/
|
|
|
|
print_good("SUCCESS. '#{ip}' : '#{datastore['RPORT']}'")
|
|
|
|
report_service(
|
|
|
|
:host => ip,
|
|
|
|
:port => datastore['RPORT'],
|
|
|
|
:name => "nessus-xmlrpc",
|
|
|
|
:info => 'Nessus XMLRPC',
|
2014-07-28 17:49:24 +00:00
|
|
|
:state => 'open'
|
2013-08-30 21:28:54 +00:00
|
|
|
)
|
|
|
|
else
|
|
|
|
vprint_error("Wrong HTTP Server header: #{res.headers['Server'] || ''}")
|
|
|
|
end
|
2012-11-15 21:28:56 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2012-11-15 21:28:56 +00:00
|
|
|
end
|