CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/scanner/http/chromecast_webserver.rb
Views: 11784
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Auxiliary
7
include Msf::Exploit::Remote::HttpClient
8
include Msf::Auxiliary::Scanner
9
include Msf::Auxiliary::Report
10
11
def initialize(info = {})
12
super(update_info(info,
13
'Name' => 'Chromecast Web Server Scanner',
14
'Description' => %q{
15
This module scans for the Chromecast web server on port 8008/TCP, and
16
can be used to discover devices which can be targeted by other Chromecast
17
modules, such as chromecast_youtube.
18
},
19
'Author' => ['wvu'],
20
'References' => [
21
['URL', 'https://store.google.com/product/chromecast?utm_source=chromecast.com&hl=en-US']
22
],
23
'License' => MSF_LICENSE
24
))
25
26
register_options([
27
Opt::RPORT(8008)
28
])
29
end
30
31
def run_host(ip)
32
res = send_request_raw(
33
'method' => 'GET',
34
'uri' => '/setup/eureka_info',
35
'agent' => Rex::Text.rand_text_english(rand(42) + 1)
36
)
37
38
return unless (res && res.code == 200)
39
40
json = res.get_json_document
41
name, ssid = json['name'], json['ssid']
42
43
if name && ssid
44
print_good(%Q{#{peer} - Chromecast "#{name}" is connected to #{ssid}})
45
report_service(
46
:host => ip,
47
:port => rport,
48
:proto => 'tcp',
49
:name => 'http',
50
:info => %Q{Chromecast "#{name}" connected to #{ssid}}
51
)
52
end
53
end
54
end
55
56