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/admin/firetv/firetv_youtube.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient78def initialize(info = {})9super(update_info(info,10'Name' => 'Amazon Fire TV YouTube Remote Control',11'Description' => %q{12This module acts as a simple remote control for the Amazon Fire TV's13YouTube app.1415Tested on the Amazon Fire TV Stick.16},17'Author' => ['wvu'],18'References' => [19['URL', 'https://www.amazon.com/dp/B00CX5P8FC?_encoding=UTF8&showFS=1'],20['URL', 'https://www.amazon.com/dp/B00GDQ0RMG/ref=fs_ftvs']21],22'License' => MSF_LICENSE,23'Actions' => [24['Play', 'Description' => 'Play video'],25['Stop', 'Description' => 'Stop video']26],27'DefaultAction' => 'Play'28))2930register_options([31Opt::RPORT(8008),32OptString.new('VID', [true, 'Video ID', 'kxopViU98Xo'])33])34end3536def run37case action.name38when 'Play'39stop40sleep(1)41res = play42when 'Stop'43res = stop44end4546return unless res4748case res.code49when 20150print_good("Playing https://www.youtube.com/watch?v=#{datastore['VID']}")51when 20052print_status('Stopping video')53when 40454print_error("Couldn't #{action.name.downcase} video")55end56end5758def play59begin60send_request_cgi(61'method' => 'POST',62'uri' => '/apps/YouTube',63'ctype' => 'text/plain',64'vars_post' => {65'v' => datastore['VID']66}67)68rescue Rex::ConnectionRefused, Rex::ConnectionTimeout,69Rex::HostUnreachable => e70fail_with(Failure::Unreachable, e)71end72end7374def stop75begin76send_request_raw(77'method' => 'DELETE',78'uri' => '/apps/YouTube/run'79)80rescue Rex::ConnectionRefused, Rex::ConnectionTimeout,81Rex::HostUnreachable => e82fail_with(Failure::Unreachable, e)83end84end85end868788