Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/scanner/http/chromecast_wifi.rb
Views: 11784
##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::Scanner89def initialize(info = {})10super(update_info(info,11'Name' => 'Chromecast Wifi Enumeration',12'Description' => %q{13This module enumerates wireless access points through Chromecast.14},15'Author' => ['wvu'],16'References' => [17['URL', 'http://www.google.com/intl/en/chrome/devices/chromecast/index.html'] # vendor website18],19'License' => MSF_LICENSE20))2122register_options([23Opt::RPORT(8008)24])25end2627def run_host(ip)28res = scan2930return unless res && res.code == 2003132waps_table = Rex::Text::Table.new(33'Header' => "Wireless Access Points from #{ip}",34'Columns' => [35'BSSID',36'PWR',37'ENC',38'CIPHER',39'AUTH',40'ESSID'41],42'SortIndex' => -143)4445res.get_json_document.each do |wap|46waps_table << [47wap['bssid'],48wap['signal_level'],49enc(wap),50cipher(wap),51auth(wap),52wap['ssid'] + (wap['wpa_id'] ? ' (*)' : '')53]54end5556unless waps_table.rows.empty?57print_line(waps_table.to_s)58report_note(59:host => ip,60:port => rport,61:proto => 'tcp',62:type => 'chromecast.wifi',63:data => waps_table.to_csv64)65end66end6768def scan69send_request_raw(70'method' => 'POST',71'uri' => '/setup/scan_wifi',72'agent' => Rex::Text.rand_text_english(rand(42) + 1)73)74send_request_raw(75'method' => 'GET',76'uri' => '/setup/scan_results',77'agent' => Rex::Text.rand_text_english(rand(42) + 1)78)79end8081def enc(wap)82case wap['wpa_auth']83when 184'OPN'85when 286'WEP'87when 588'WPA'89when 0, 790'WPA2'91else92wap['wpa_auth']93end94end9596def cipher(wap)97case wap['wpa_cipher']98when 199''100when 2101'WEP'102when 3103'TKIP'104when 4105'CCMP'106else107wap['wpa_cipher']108end109end110111def auth(wap)112case wap['wpa_auth']113when 0114'MGT'115when 5, 7116'PSK'117else118''119end120end121end122123124