2014-06-12 02:00:47 +00:00
|
|
|
##
|
|
|
|
# This module requires Metasploit: http//metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
|
|
##
|
|
|
|
|
2014-06-17 19:22:55 +00:00
|
|
|
require 'msf/core'
|
2014-06-12 02:00:47 +00:00
|
|
|
|
|
|
|
class Metasploit4 < Msf::Auxiliary
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2014-06-17 19:22:55 +00:00
|
|
|
'Name' => 'Chromecast Wifi Enumeration',
|
|
|
|
'Description' => %q{
|
2014-06-12 02:00:47 +00:00
|
|
|
This module enumerates wireless access points through Chromecast.
|
|
|
|
},
|
2014-06-17 19:22:55 +00:00
|
|
|
'Author' => ['wvu'],
|
|
|
|
'References' => [
|
|
|
|
['URL', 'https://en.wikipedia.org/wiki/Chromecast']
|
2014-06-12 02:00:47 +00:00
|
|
|
],
|
2014-06-17 19:22:55 +00:00
|
|
|
'License' => MSF_LICENSE
|
2014-06-12 02:00:47 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
register_options([
|
|
|
|
Opt::RPORT(8008)
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
res = scan
|
|
|
|
|
|
|
|
if res && res.code == 200
|
|
|
|
waps = Rex::Ui::Text::Table.new(
|
2014-06-17 19:22:55 +00:00
|
|
|
'Header' => 'Wireless Access Points',
|
|
|
|
'Columns' => [
|
|
|
|
'BSSID',
|
|
|
|
'PWR',
|
|
|
|
'ENC',
|
|
|
|
'CIPHER',
|
|
|
|
'ESSID'
|
2014-06-12 02:00:47 +00:00
|
|
|
],
|
2014-06-17 19:22:55 +00:00
|
|
|
'SortIndex' => -1
|
2014-06-12 02:00:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
JSON.parse(res.body).each do |wap|
|
|
|
|
waps << [
|
2014-06-17 19:22:55 +00:00
|
|
|
wap['bssid'],
|
|
|
|
wap['signal_level'],
|
|
|
|
case wap['wpa_auth']
|
2014-06-17 18:10:08 +00:00
|
|
|
when 1
|
2014-06-17 19:22:55 +00:00
|
|
|
'OPN'
|
2014-06-17 18:10:08 +00:00
|
|
|
when 5
|
2014-06-17 19:22:55 +00:00
|
|
|
'WPA'
|
2014-06-17 18:10:08 +00:00
|
|
|
when 7
|
2014-06-17 19:22:55 +00:00
|
|
|
'WPA2'
|
2014-06-17 18:10:08 +00:00
|
|
|
else
|
2014-06-17 19:22:55 +00:00
|
|
|
wap['wpa_auth']
|
2014-06-17 18:10:08 +00:00
|
|
|
end,
|
2014-06-17 19:22:55 +00:00
|
|
|
case wap['wpa_cipher']
|
2014-06-17 18:10:08 +00:00
|
|
|
when 1
|
2014-06-17 19:22:55 +00:00
|
|
|
''
|
2014-06-17 18:10:08 +00:00
|
|
|
when 3
|
2014-06-17 19:22:55 +00:00
|
|
|
'TKIP'
|
2014-06-17 18:10:08 +00:00
|
|
|
when 4
|
2014-06-17 19:22:55 +00:00
|
|
|
'CCMP'
|
2014-06-17 18:10:08 +00:00
|
|
|
else
|
2014-06-17 19:22:55 +00:00
|
|
|
wap['wpa_cipher']
|
2014-06-17 18:10:08 +00:00
|
|
|
end,
|
2014-06-17 19:22:55 +00:00
|
|
|
wap['ssid'] + (wap['wpa_id'] ? ' (*)' : '')
|
2014-06-12 02:00:47 +00:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
print_line(waps.to_s)
|
|
|
|
|
|
|
|
report_note(
|
|
|
|
:host => rhost,
|
|
|
|
:port => rport,
|
2014-06-17 19:22:55 +00:00
|
|
|
:proto => 'tcp',
|
|
|
|
:type => 'chromecast.wifi',
|
2014-06-12 02:00:47 +00:00
|
|
|
:data => waps.to_csv
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def scan
|
|
|
|
begin
|
|
|
|
send_request_raw(
|
2014-06-17 19:22:55 +00:00
|
|
|
'method' => 'POST',
|
|
|
|
'uri' => '/setup/scan_wifi',
|
|
|
|
'agent' => Rex::Text.rand_text_english(rand(42) + 1)
|
2014-06-12 02:00:47 +00:00
|
|
|
)
|
|
|
|
send_request_raw(
|
2014-06-17 19:22:55 +00:00
|
|
|
'method' => 'GET',
|
|
|
|
'uri' => '/setup/scan_results',
|
|
|
|
'agent' => Rex::Text.rand_text_english(rand(42) + 1)
|
2014-06-12 02:00:47 +00:00
|
|
|
)
|
|
|
|
rescue Rex::ConnectionRefused, Rex::ConnectionTimeout,
|
|
|
|
Rex::HostUnreachable => e
|
|
|
|
fail_with(Failure::Unreachable, e)
|
|
|
|
ensure
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|