Skip to content

Commit fb06cb1

Browse files
author
Tod Beardsley
committed
Land rapid7#4774, Chromecast HTTP scanner
2 parents 71c5f62 + 687d84c commit fb06cb1

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit4 < Msf::Auxiliary
9+
10+
include Msf::Exploit::Remote::HttpClient
11+
include Msf::Auxiliary::Scanner
12+
include Msf::Auxiliary::Report
13+
14+
def initialize(info = {})
15+
super(update_info(info,
16+
'Name' => 'Chromecast Web Server Scanner',
17+
'Description' => %q{
18+
This module scans for the Chromecast web server on port 8008/TCP, and
19+
can be used to discover devices which can be targeted by other Chromecast
20+
modules, such as chromecast_youtube.
21+
},
22+
'Author' => ['wvu'],
23+
'References' => [
24+
['URL', 'https://www.google.com/chrome/devices/chromecast/']
25+
],
26+
'License' => MSF_LICENSE
27+
))
28+
29+
register_options([
30+
Opt::RPORT(8008)
31+
])
32+
end
33+
34+
def run_host(ip)
35+
res = send_request_raw(
36+
'method' => 'GET',
37+
'uri' => '/setup/eureka_info',
38+
'agent' => Rex::Text.rand_text_english(rand(42) + 1)
39+
)
40+
41+
return unless (res && res.code == 200)
42+
43+
begin
44+
json = JSON.parse(res.body)
45+
rescue JSON::ParserError
46+
return
47+
end
48+
49+
name, ssid = json['name'], json['ssid']
50+
51+
if name && ssid
52+
print_good(%Q{#{peer} - Chromecast "#{name}" is connected to #{ssid}})
53+
report_service(
54+
:host => ip,
55+
:port => rport,
56+
:proto => 'tcp',
57+
:name => 'http',
58+
:info => %Q{Chromecast "#{name}" connected to #{ssid}}
59+
)
60+
end
61+
end
62+
63+
end

0 commit comments

Comments
 (0)