6
6
class MetasploitModule < Msf ::Post
7
7
include Msf ::Post ::File
8
8
9
- PLAY_OPTIONS = 'autoplay=1&loop=1&disablekb=1&modestbranding=1&iv_load_policy=3&controls=0&showinfo=0&rel=0'
10
-
11
9
def initialize ( info = { } )
12
10
super ( update_info ( info ,
13
11
'Name' => 'Multi Manage YouTube Broadcast' ,
14
12
'Description' => %q{
15
13
This module will broadcast a YouTube video on specified compromised systems. It will play
16
- the video in the target machine's native browser in full screen mode. The VID datastore
17
- option is the "v" parameter in a YouTube video's URL.
14
+ the video in the target machine's native browser. The VID datastore option is the "v"
15
+ parameter in a YouTube video's URL.
16
+
17
+ Enabling the EMBED option will play the video in full screen mode through a clean interface
18
+ but is not compatible with all videos.
19
+
20
+ This module will create a custom profile for Firefox on Linux systems in the /tmp directory.
18
21
} ,
19
22
'License' => MSF_LICENSE ,
20
- 'Author' => [ 'sinn3r' ] ,
23
+ 'Author' => [ 'sinn3r' ] ,
21
24
'Platform' => [ 'win' , 'osx' , 'linux' , 'android' ] ,
22
- 'SessionTypes' => [ 'shell' , 'meterpreter' ]
25
+ 'SessionTypes' => [ 'shell' , 'meterpreter' ] ,
26
+ 'Notes' =>
27
+ {
28
+ # ARTIFACTS_ON_DISK when the platform is linux
29
+ 'SideEffects' => [ ARTIFACTS_ON_DISK , AUDIO_EFFECTS , SCREEN_EFFECTS ]
30
+ } ,
23
31
) )
24
32
25
33
register_options (
26
34
[
35
+ OptBool . new ( 'EMBED' , [ true , 'Use the embed version of the YouTube URL' , true ] ) ,
27
36
OptString . new ( 'VID' , [ true , 'The video ID to the YouTube video' ] )
28
37
] )
29
38
end
30
39
31
- YOUTUBE_BASE_URL = "https://youtube.com/embed/"
40
+ def youtube_url
41
+ if datastore [ 'EMBED' ]
42
+ "https://youtube.com/embed/#{ datastore [ 'VID' ] } ?autoplay=1&loop=1&disablekb=1&modestbranding=1&iv_load_policy=3&controls=0&showinfo=0&rel=0"
43
+ else
44
+ "https://youtube.com/watch?v=#{ datastore [ 'VID' ] } "
45
+ end
46
+ end
32
47
33
48
#
34
49
# The OSX version uses an apple script to do this
35
50
#
36
51
def osx_start_video ( id )
37
- url = "#{ YOUTUBE_BASE_URL } #{ id } ?#{ PLAY_OPTIONS } "
38
52
script = ''
39
- script << %Q|osascript -e 'tell application "Safari" to open location "#{ url } "' |
53
+ script << %Q|osascript -e 'tell application "Safari" to open location "#{ youtube_url } "' |
40
54
script << %Q|-e 'activate application "Safari"' |
41
55
script << %Q|-e 'tell application "System Events" to key code {59, 55, 3}'|
42
56
@@ -55,7 +69,7 @@ def osx_start_video(id)
55
69
def win_start_video ( id )
56
70
iexplore_path = "C:\\ Program Files\\ Internet Explorer\\ iexplore.exe"
57
71
begin
58
- session . sys . process . execute ( iexplore_path , "-k #{ YOUTUBE_BASE_URL } #{ id } ? #{ PLAY_OPTIONS } " )
72
+ session . sys . process . execute ( iexplore_path , "-k #{ youtube_url } " )
59
73
rescue Rex ::Post ::Meterpreter ::RequestError
60
74
return false
61
75
end
@@ -72,7 +86,9 @@ def linux_start_video(id)
72
86
begin
73
87
# Create a profile
74
88
profile_name = Rex ::Text . rand_text_alpha ( 8 )
75
- o = cmd_exec ( %Q|firefox --display :0 -CreateProfile "#{ profile_name } /tmp/#{ profile_name } "| )
89
+ display = get_env ( 'DISPLAY' ) || ':0'
90
+ vprint_status ( "Creating profile #{ profile_name } using display #{ display } " )
91
+ o = cmd_exec ( %Q|firefox --display #{ display } -CreateProfile "#{ profile_name } /tmp/#{ profile_name } "| )
76
92
77
93
# Add user-defined settings to profile
78
94
s = %Q|
@@ -82,9 +98,8 @@ def linux_start_video(id)
82
98
write_file ( "/tmp/#{ profile_name } /prefs.js" , s )
83
99
84
100
# Start the video
85
- url = "#{ YOUTUBE_BASE_URL } #{ id } ?#{ PLAY_OPTIONS } "
86
- data_js = %Q|"data:text/html,<script>window.open('#{ url } ','','width:100000px;height:100000px');</script>"|
87
- joe = "firefox --display :0 -p #{ profile_name } #{ data_js } &"
101
+ data_js = %Q|"data:text/html,<script>window.open('#{ youtube_url } ','','width:100000px;height:100000px');</script>"|
102
+ joe = "firefox --display #{ display } -p #{ profile_name } #{ data_js } &"
88
103
cmd_exec ( "/bin/sh -c #{ joe . shellescape } " )
89
104
rescue EOFError
90
105
return false
0 commit comments