2015-02-17 09:27:48 +00:00
|
|
|
##
|
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit4 < Msf::Auxiliary
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Chromecast Web Server Scanner',
|
|
|
|
'Description' => %q{
|
2015-02-17 18:51:55 +00:00
|
|
|
This module scans for the Chromecast web server on port 8008/TCP, and
|
2015-02-17 19:04:26 +00:00
|
|
|
can be used to discover devices which can be targeted by other Chromecast
|
|
|
|
modules, such as chromecast_youtube.
|
2015-02-17 09:27:48 +00:00
|
|
|
},
|
|
|
|
'Author' => ['wvu'],
|
|
|
|
'References' => [
|
|
|
|
['URL', 'https://www.google.com/chrome/devices/chromecast/']
|
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE
|
|
|
|
))
|
|
|
|
|
|
|
|
register_options([
|
|
|
|
Opt::RPORT(8008)
|
|
|
|
])
|
|
|
|
end
|
|
|
|
|
|
|
|
def run_host(ip)
|
|
|
|
res = send_request_raw(
|
|
|
|
'method' => 'GET',
|
2015-02-17 10:37:16 +00:00
|
|
|
'uri' => '/setup/eureka_info',
|
2015-02-17 09:27:48 +00:00
|
|
|
'agent' => Rex::Text.rand_text_english(rand(42) + 1)
|
|
|
|
)
|
|
|
|
|
|
|
|
return unless (res && res.code == 200)
|
|
|
|
|
2015-02-17 11:04:17 +00:00
|
|
|
begin
|
|
|
|
json = JSON.parse(res.body)
|
|
|
|
rescue JSON::ParserError
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2015-02-17 10:37:16 +00:00
|
|
|
name, ssid = json['name'], json['ssid']
|
2015-02-17 09:27:48 +00:00
|
|
|
|
2015-02-17 10:37:16 +00:00
|
|
|
if name && ssid
|
|
|
|
print_good(%Q{#{peer} - Chromecast "#{name}" is connected to #{ssid}})
|
2015-02-17 09:27:48 +00:00
|
|
|
report_service(
|
|
|
|
:host => ip,
|
|
|
|
:port => rport,
|
|
|
|
:proto => 'tcp',
|
2015-02-17 18:41:31 +00:00
|
|
|
:name => 'http',
|
|
|
|
:info => %Q{Chromecast "#{name}" connected to #{ssid}}
|
2015-02-17 09:27:48 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|