2009-03-29 05:51:08 +00:00
|
|
|
##
|
2017-07-24 13:26:21 +00:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2009-03-29 05:51:08 +00:00
|
|
|
##
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Auxiliary
|
2014-07-18 20:27:21 +00:00
|
|
|
include Msf::Exploit::Remote::Udp
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Auxiliary::Report
|
2014-07-18 20:27:21 +00:00
|
|
|
include Msf::Auxiliary::UDPScanner
|
2014-07-18 18:52:18 +00:00
|
|
|
include Msf::Exploit::Remote::SIP
|
2013-08-30 21:28:54 +00:00
|
|
|
|
|
|
|
def initialize
|
|
|
|
super(
|
|
|
|
'Name' => 'SIP Endpoint Scanner (UDP)',
|
|
|
|
'Description' => 'Scan for SIP devices using OPTIONS requests',
|
|
|
|
'Author' => 'hdm',
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
)
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
2014-07-18 00:17:31 +00:00
|
|
|
OptString.new('TO', [false, 'The destination username to probe at each host', 'nobody']),
|
2014-07-18 20:27:21 +00:00
|
|
|
Opt::RPORT(5060)
|
2017-05-03 20:42:21 +00:00
|
|
|
])
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
|
|
|
|
2014-07-18 20:27:21 +00:00
|
|
|
def scanner_prescan(batch)
|
|
|
|
print_status("Sending SIP UDP OPTIONS requests to #{batch[0]}->#{batch[-1]} (#{batch.length} hosts)")
|
|
|
|
@res = {}
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
|
|
|
|
2014-07-18 20:27:21 +00:00
|
|
|
def scan_host(ip)
|
2014-07-19 00:39:52 +00:00
|
|
|
scanner_send(create_probe(ip, 'udp'), ip, datastore['RPORT'])
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
|
|
|
|
2014-07-18 20:27:21 +00:00
|
|
|
def scanner_process(data, shost, _)
|
2014-08-26 18:40:49 +00:00
|
|
|
report_response(data, shost, 'udp')
|
2014-07-18 00:17:31 +00:00
|
|
|
end
|
2009-03-29 05:51:08 +00:00
|
|
|
end
|