Skip to content

Commit 0369559

Browse files
committed
Add support for Linux, thanks @jvennix-r7!
1 parent 7d12ced commit 0369559

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

modules/post/multi/manage/play_youtube.rb

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
class Metasploit3 < Msf::Post
99

10+
include Msf::Post::File
11+
1012
def initialize(info={})
1113
super( update_info( info,
1214
'Name' => 'Multi Manage Youtube Broadcast',
@@ -17,7 +19,7 @@ def initialize(info={})
1719
},
1820
'License' => MSF_LICENSE,
1921
'Author' => [ 'sinn3r'],
20-
'Platform' => [ 'win', 'osx' ],
22+
'Platform' => [ 'win', 'osx', 'linux' ],
2123
'SessionTypes' => [ 'shell', 'meterpreter' ]
2224
))
2325

@@ -65,12 +67,43 @@ def win_start_video(id)
6567
true
6668
end
6769

70+
71+
#
72+
# The Linux version uses Firefox
73+
#
74+
def linux_start_video(id)
75+
begin
76+
# Create a profile
77+
profile_name = "temp_profile"
78+
o = cmd_exec(%Q|firefox --display :0 -CreateProfile "#{profile_name} /tmp/#{profile_name}"|)
79+
80+
# Add user-defined settings to profile
81+
s = %Q|
82+
user_pref("dom.disable_open_during_load", false);
83+
user_pref("browser.shell.checkDefaultBrowser", false);
84+
|
85+
write_file("/tmp/#{profile_name}/prefs.js", s)
86+
87+
# Start the video
88+
url = "https://youtube.googleapis.com/v/#{id}?fs=1&autoplay=1"
89+
data_js = %Q|"data:text/html,<script>window.open('#{url}','','width:100000px;height:100000px');</script>"|
90+
joe = "firefox --display :0 -p #{profile_name} #{data_js} &"
91+
cmd_exec("/bin/sh -c #{joe.shellescape}")
92+
rescue EOFError
93+
return false
94+
end
95+
96+
true
97+
end
98+
6899
def start_video(id)
69100
case session.platform
70101
when /osx/
71102
osx_start_video(id)
72103
when /win/
73104
win_start_video(id)
105+
when /linux/
106+
linux_start_video(id)
74107
end
75108
end
76109

0 commit comments

Comments
 (0)