Skip to content

Commit c685e0d

Browse files
committed
Land rapid7#3444, chromecast wifi enumeration
2 parents aca8fcb + 1394ad1 commit c685e0d

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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+
12+
def initialize(info = {})
13+
super(update_info(info,
14+
'Name' => 'Chromecast Wifi Enumeration',
15+
'Description' => %q{
16+
This module enumerates wireless access points through Chromecast.
17+
},
18+
'Author' => ['wvu'],
19+
'References' => [
20+
['URL', 'https://en.wikipedia.org/wiki/Chromecast']
21+
],
22+
'License' => MSF_LICENSE
23+
))
24+
25+
register_options([
26+
Opt::RPORT(8008)
27+
], self.class)
28+
end
29+
30+
def run
31+
res = scan
32+
33+
if res && res.code == 200
34+
waps = Rex::Ui::Text::Table.new(
35+
'Header' => 'Wireless Access Points',
36+
'Columns' => [
37+
'BSSID',
38+
'PWR',
39+
'ENC',
40+
'CIPHER',
41+
'ESSID'
42+
],
43+
'SortIndex' => -1
44+
)
45+
46+
JSON.parse(res.body).each do |wap|
47+
waps << [
48+
wap['bssid'],
49+
wap['signal_level'],
50+
case wap['wpa_auth']
51+
when 1
52+
'OPN'
53+
when 5
54+
'WPA'
55+
when 7
56+
'WPA2'
57+
else
58+
wap['wpa_auth']
59+
end,
60+
case wap['wpa_cipher']
61+
when 1
62+
''
63+
when 3
64+
'TKIP'
65+
when 4
66+
'CCMP'
67+
else
68+
wap['wpa_cipher']
69+
end,
70+
wap['ssid'] + (wap['wpa_id'] ? ' (*)' : '')
71+
]
72+
end
73+
74+
print_line(waps.to_s)
75+
76+
report_note(
77+
:host => rhost,
78+
:port => rport,
79+
:proto => 'tcp',
80+
:type => 'chromecast.wifi',
81+
:data => waps.to_csv
82+
)
83+
end
84+
end
85+
86+
def scan
87+
begin
88+
send_request_raw(
89+
'method' => 'POST',
90+
'uri' => '/setup/scan_wifi',
91+
'agent' => Rex::Text.rand_text_english(rand(42) + 1)
92+
)
93+
send_request_raw(
94+
'method' => 'GET',
95+
'uri' => '/setup/scan_results',
96+
'agent' => Rex::Text.rand_text_english(rand(42) + 1)
97+
)
98+
rescue Rex::ConnectionRefused, Rex::ConnectionTimeout,
99+
Rex::HostUnreachable => e
100+
fail_with(Failure::Unreachable, e)
101+
ensure
102+
disconnect
103+
end
104+
end
105+
106+
end

0 commit comments

Comments
 (0)