Skip to content

Commit bb681ba

Browse files
committed
Land rapid7#4610, add play options to play_youtube
2 parents 923d1ef + 43e0afe commit bb681ba

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/post/multi/manage/play_youtube.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ class Metasploit3 < Msf::Post
99

1010
include Msf::Post::File
1111

12+
PLAY_OPTIONS = 'autoplay=1&loop=1&disablekb=1&modestbranding=1&iv_load_policy=3&controls=0&showinfo=0&rel=0'
13+
1214
def initialize(info={})
1315
super( update_info( info,
1416
'Name' => 'Multi Manage YouTube Broadcast',
@@ -38,7 +40,7 @@ def peer
3840
# The OSX version uses an apple script to do this
3941
#
4042
def osx_start_video(id)
41-
url = "https://youtube.googleapis.com/v/#{id}?fs=1&autoplay=1"
43+
url = "https://youtube.googleapis.com/v/#{id}?fs=1&#{PLAY_OPTIONS}"
4244
script = ''
4345
script << %Q|osascript -e 'tell application "Safari" to open location "#{url}"' |
4446
script << %Q|-e 'activate application "Safari"' |
@@ -59,7 +61,7 @@ def osx_start_video(id)
5961
def win_start_video(id)
6062
iexplore_path = "C:\\Program Files\\Internet Explorer\\iexplore.exe"
6163
begin
62-
session.sys.process.execute(iexplore_path, "-k http://youtube.com/embed/#{id}?autoplay=1")
64+
session.sys.process.execute(iexplore_path, "-k http://youtube.com/embed/#{id}?#{PLAY_OPTIONS}")
6365
rescue Rex::Post::Meterpreter::RequestError => e
6466
return false
6567
end
@@ -86,7 +88,7 @@ def linux_start_video(id)
8688
write_file("/tmp/#{profile_name}/prefs.js", s)
8789

8890
# Start the video
89-
url = "https://youtube.googleapis.com/v/#{id}?fs=1&autoplay=1"
91+
url = "https://youtube.googleapis.com/v/#{id}?fs=1&#{PLAY_OPTIONS}"
9092
data_js = %Q|"data:text/html,<script>window.open('#{url}','','width:100000px;height:100000px');</script>"|
9193
joe = "firefox --display :0 -p #{profile_name} #{data_js} &"
9294
cmd_exec("/bin/sh -c #{joe.shellescape}")

0 commit comments

Comments
 (0)