File tree Expand file tree Collapse file tree 1 file changed +29
-3
lines changed
modules/post/windows/manage Expand file tree Collapse file tree 1 file changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ def initialize(info={})
19
19
} ,
20
20
'License' => MSF_LICENSE ,
21
21
'Author' => [ 'sinn3r' ] ,
22
- 'Platform' => [ 'win' ] ,
23
- 'SessionTypes' => [ 'meterpreter' ]
22
+ 'Platform' => [ 'win' , 'osx' ] ,
23
+ 'SessionTypes' => [ 'shell' , ' meterpreter' ]
24
24
) )
25
25
26
26
register_options (
@@ -33,7 +33,24 @@ def peer
33
33
"#{ session . session_host } :#{ session . session_port } "
34
34
end
35
35
36
- def start_video ( id )
36
+
37
+ #
38
+ # The OSX version uses an action script to do this
39
+ #
40
+ def osx_start_video ( id )
41
+ url = "https://youtube.googleapis.com/v/#{ id } ?fs=1&autoplay=1"
42
+ script = ''
43
+ script << %Q|osascript -e 'tell application "Safari" to open location "#{ url } "' |
44
+ script << %Q|-e 'activate application "Safari"' |
45
+ script << %Q|-e 'tell application "System Events" to key code {59, 55, 3}'|
46
+
47
+ cmd_exec ( script )
48
+ end
49
+
50
+ #
51
+ # The Windows version uses the "embed" player to make sure IE won't download the SWF as an object
52
+ #
53
+ def win_start_video ( id )
37
54
iexplore_path = "C:\\ Program Files\\ Internet Explorer\\ iexplore.exe"
38
55
begin
39
56
session . sys . process . execute ( iexplore_path , "-k http://youtube.com/embed/#{ id } ?autoplay=1" )
@@ -44,6 +61,15 @@ def start_video(id)
44
61
true
45
62
end
46
63
64
+ def start_video ( id )
65
+ case session . platform
66
+ when /osx/
67
+ osx_start_video ( id )
68
+ when /win/
69
+ win_start_video ( id )
70
+ end
71
+ end
72
+
47
73
def run
48
74
id = datastore [ 'VID' ]
49
75
You can’t perform that action at this time.
0 commit comments