Path: blob/master/modules/auxiliary/scanner/http/chromecast_webserver.rb
19591 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient7include Msf::Auxiliary::Scanner8include Msf::Auxiliary::Report910def initialize(info = {})11super(12update_info(13info,14'Name' => 'Chromecast Web Server Scanner',15'Description' => %q{16This module scans for the Chromecast web server on port 8008/TCP, and17can be used to discover devices which can be targeted by other Chromecast18modules, such as chromecast_youtube.19},20'Author' => ['wvu'],21'References' => [22['URL', 'https://store.google.com/product/chromecast?utm_source=chromecast.com&hl=en-US']23],24'License' => MSF_LICENSE,25'Notes' => {26'Reliability' => UNKNOWN_RELIABILITY,27'Stability' => UNKNOWN_STABILITY,28'SideEffects' => UNKNOWN_SIDE_EFFECTS29}30)31)3233register_options([34Opt::RPORT(8008)35])36end3738def run_host(ip)39res = send_request_raw(40'method' => 'GET',41'uri' => '/setup/eureka_info',42'agent' => Rex::Text.rand_text_english(rand(42) + 1)43)4445return unless (res && res.code == 200)4647json = res.get_json_document48name, ssid = json['name'], json['ssid']4950if name && ssid51print_good(%Q{#{peer} - Chromecast "#{name}" is connected to #{ssid}})52report_service(53:host => ip,54:port => rport,55:proto => 'tcp',56:name => 'http',57:info => %Q{Chromecast "#{name}" connected to #{ssid}}58)59end60end61end626364