2015-03-12 10:50:29 +00:00
|
|
|
##
|
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
|
|
##
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Auxiliary
|
2015-03-12 10:50:29 +00:00
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
|
2015-03-25 06:34:33 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2015-05-08 19:56:39 +00:00
|
|
|
'Name' => 'F5 Networks Devices Management Interface Scanner',
|
2015-03-25 06:34:33 +00:00
|
|
|
'Description' => %q{
|
2015-05-08 19:56:39 +00:00
|
|
|
This module scans for web management interfaces of the following F5 Networks devices:
|
|
|
|
BigIP, BigIQ, Enterprise Manager, ARX, and FirePass.
|
2015-03-25 06:34:33 +00:00
|
|
|
},
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'Denis Kolegov <dnkolegov[at]gmail.com>',
|
|
|
|
'Oleg Broslavsky <ovbroslavsky[at]gmail.com>',
|
|
|
|
'Nikita Oleksov <neoleksov[at]gmail.com>'
|
|
|
|
],
|
2015-03-23 08:34:38 +00:00
|
|
|
'DefaultOptions' =>
|
2015-03-23 08:31:08 +00:00
|
|
|
{
|
|
|
|
'SSL' => true,
|
2015-03-25 06:34:33 +00:00
|
|
|
'RPORT' => 443
|
2015-03-23 08:31:08 +00:00
|
|
|
}
|
2015-03-25 06:34:33 +00:00
|
|
|
))
|
2015-03-17 06:49:11 +00:00
|
|
|
|
2015-03-23 08:31:08 +00:00
|
|
|
register_options(
|
2015-05-08 19:56:39 +00:00
|
|
|
[
|
|
|
|
OptInt.new('TIMEOUT', [true, 'HTTPS connect/read timeout in seconds', 1])
|
2017-05-03 20:42:21 +00:00
|
|
|
])
|
2015-03-25 06:34:33 +00:00
|
|
|
end
|
2015-03-12 10:50:29 +00:00
|
|
|
|
2015-05-08 19:56:39 +00:00
|
|
|
def port_open?
|
2015-03-25 06:34:33 +00:00
|
|
|
begin
|
2015-05-08 20:23:08 +00:00
|
|
|
res = send_request_raw({'method' => 'GET', 'uri' => '/'}, datastore['TIMEOUT'])
|
2015-05-08 19:56:39 +00:00
|
|
|
return true if res
|
|
|
|
rescue ::Rex::ConnectionRefused
|
2016-02-01 22:06:34 +00:00
|
|
|
vprint_status("Connection refused")
|
2015-05-08 19:56:39 +00:00
|
|
|
return false
|
|
|
|
rescue ::Rex::ConnectionError
|
2016-02-01 22:06:34 +00:00
|
|
|
vprint_error("Connection failed")
|
2015-05-08 19:56:39 +00:00
|
|
|
return false
|
|
|
|
rescue ::OpenSSL::SSL::SSLError
|
2016-02-01 22:06:34 +00:00
|
|
|
vprint_error("SSL/TLS connection error")
|
2015-03-25 06:34:33 +00:00
|
|
|
return false
|
|
|
|
end
|
2015-03-12 10:50:29 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run_host(ip)
|
2015-05-08 19:56:39 +00:00
|
|
|
return unless port_open?
|
2015-03-25 06:34:33 +00:00
|
|
|
|
2015-05-02 09:09:03 +00:00
|
|
|
res = send_request_raw('method' => 'GET', 'uri' => '/')
|
2015-03-25 06:34:33 +00:00
|
|
|
if res && res.code == 200
|
|
|
|
|
|
|
|
# Detect BigIP management interface
|
|
|
|
if res.body =~ /<title>BIG\-IP/
|
2016-02-01 22:06:34 +00:00
|
|
|
print_good("F5 BigIP web management interface found")
|
2015-03-25 06:34:33 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
# Detect EM management interface
|
|
|
|
if res.body =~ /<title>Enterprise Manager/
|
2016-02-01 22:06:34 +00:00
|
|
|
print_good("F5 Enterprise Manager web management interface found")
|
2015-03-25 06:34:33 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
# Detect ARX management interface
|
|
|
|
if res.body =~ /<title>F5 ARX Manager Login<\/title>/
|
2016-02-01 22:06:34 +00:00
|
|
|
print_good("ARX web management interface found")
|
2015-03-25 06:34:33 +00:00
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
2015-03-12 10:50:29 +00:00
|
|
|
|
2015-03-25 06:34:33 +00:00
|
|
|
# Detect BigIQ management interface
|
2015-05-08 19:56:39 +00:00
|
|
|
res = send_request_raw('method' => 'GET', 'uri' => '/ui/login/')
|
2015-03-25 06:34:33 +00:00
|
|
|
if res && res.code == 200 && res.body =~ /<title>BIG\-IQ/
|
2016-02-01 22:06:34 +00:00
|
|
|
print_good("F5 BigIQ web management interface found")
|
2015-03-25 06:34:33 +00:00
|
|
|
return
|
2015-03-23 08:31:08 +00:00
|
|
|
end
|
2015-03-23 08:34:38 +00:00
|
|
|
|
2015-03-25 06:34:33 +00:00
|
|
|
# Detect FirePass management interface
|
|
|
|
res = send_request_raw('method' => 'GET', 'uri' => '/admin/', 'rport' => rport)
|
|
|
|
if res && res.code == 200 && res.body =~ /<br><br><br><big><b> FirePass/
|
2016-02-01 22:06:34 +00:00
|
|
|
print_good("F5 FirePass web management interface found")
|
2015-03-25 06:34:33 +00:00
|
|
|
return
|
|
|
|
end
|
2015-03-17 06:49:11 +00:00
|
|
|
end
|
2015-03-12 10:50:29 +00:00
|
|
|
end
|