Path: blob/master/modules/auxiliary/scanner/nessus/nessus_xmlrpc_ping.rb
19567 views
##1# nessus_xmlrpc_ping.rb2##34##5# This module requires Metasploit: https://metasploit.com/download6# Current source: https://github.com/rapid7/metasploit-framework7##89class MetasploitModule < Msf::Auxiliary10include Msf::Exploit::Remote::HttpClient11include Msf::Auxiliary::Report12include Msf::Auxiliary::Scanner1314def initialize15super(16'Name' => 'Nessus XMLRPC Interface Ping Utility',17'Description' => %q{18This module simply attempts to find and check19for Nessus XMLRPC interface.'20},21'Author' => [ 'Vlatko Kosturjak <kost[at]linux.hr>' ],22'License' => MSF_LICENSE,23'DefaultOptions' => { 'SSL' => true }24)2526register_options(27[28Opt::RPORT(8834),29OptInt.new('THREADS', [true, "The number of concurrent threads", 25]),30OptString.new('URI', [true, "URI for Nessus XMLRPC. Default is /", "/"])31]32)33end3435def run_host(ip)36begin37res = send_request_cgi({38'uri' => datastore['URI'],39'method' => 'GET'40}, 25)41http_fingerprint({ :response => res })42rescue ::Rex::ConnectionError => e43vprint_error("#{datastore['URI']} - #{e.to_s}")44return45end4647if not res48vprint_error("#{datastore['URI']} - No response")49return50end51if not (res.code == 200 or res.code == 302)52vprint_error("HTTP Response was not 200/302")53return54end55if res.headers['Server'] =~ /NessusWWW/56print_good("SUCCESS. '#{ip}' : '#{datastore['RPORT']}'")57report_service(58:host => ip,59:port => datastore['RPORT'],60:name => "nessus-xmlrpc",61:info => 'Nessus XMLRPC',62:state => 'open'63)64else65vprint_error("Wrong HTTP Server header: #{res.headers['Server'] || ''}")66end67end68end697071