Adversaries may abuse Visual Basic (VB) for execution. VB is a programming language created by Microsoft with interoperability with many Windows technologies such as Component Object Model and the Native API through the Windows API. Although tagged as legacy with no planned future evolutions, VB is integrated and supported in the .NET Framework and cross-platform .NET Core.[1][2]
Derivative languages based on VB have also been created, such as Visual Basic for Applications (VBA) and VBScript. VBA is an event-driven programming language built into Microsoft Office, as well as several third-party applications.[3][4] VBA enables documents to contain macros used to automate the execution of tasks and other functionality on the host. VBScript is a default scripting language on Windows hosts and can also be used in place of JavaScript on HTML Application (HTA) webpages served to Internet Explorer (though most modern browsers do not come with VBScript support).[5]
Adversaries may use VB payloads to execute malicious commands. Common malicious usage includes automating execution of behaviors with VBScript or embedding VBA content into Spearphishing Attachment payloads (which may also involve Mark-of-the-Web Bypass to enable execution).[6]
ID | Name | Description |
---|---|---|
C0028 | 2015 Ukraine Electric Power Attack |
During the 2015 Ukraine Electric Power Attack, Sandworm Team installed a VBA script called |
C0025 | 2016 Ukraine Electric Power Attack |
During the 2016 Ukraine Electric Power Attack, Sandworm Team created VBScripts to run on an SSH server.[8] |
G0099 | APT-C-36 |
APT-C-36 has embedded a VBScript within a malicious Word document which is executed upon the document opening.[9] |
G0050 | APT32 |
APT32 has used macros, COM scriptlets, and VBS scripts.[10][11] |
G0064 | APT33 |
APT33 has used VBScript to initiate the delivery of payloads.[12] |
G0067 | APT37 |
APT37 executes shellcode and a VBA script to decode Base64 strings.[13] |
G0082 | APT38 |
APT38 has used VBScript to execute commands and other operational tasks.[14] |
G0087 | APT39 | |
S0373 | Astaroth |
Astaroth has used malicious VBS e-mail attachments for execution.[16] |
S0475 | BackConfig |
BackConfig has used VBS to install its downloader component and malicious documents with VBA macro code.[17] |
S0234 | Bandook |
Bandook has used malicious VBA code against the target system.[18] |
S0268 | Bisonal |
Bisonal's dropper creates VBS scripts on the victim’s machine.[19][20] |
G0060 | BRONZE BUTLER |
BRONZE BUTLER has used VBS and VBE scripts for execution.[21][22] |
S1039 | Bumblebee |
Bumblebee can create a Visual Basic script to enable persistence.[23][24] |
C0011 | C0011 |
For C0011, Transparent Tribe used malicious VBA macros within a lure document as part of the Crimson malware installation process onto a compromised host.[25] |
C0015 | C0015 |
During C0015, the threat actors used a malicious HTA file that contained a mix of HTML and JavaScript/VBScript code.[26] |
S0631 | Chaes | |
S1149 | CHIMNEYSWEEP |
CHIMNEYSWEEP has executed a script named cln.vbs on compromised hosts.[28] |
G0080 | Cobalt Group |
Cobalt Group has sent Word OLE compound documents with malicious obfuscated VBA macros that will run upon user execution.[29][30][31][32][33][34] |
S0154 | Cobalt Strike |
Cobalt Strike can use VBA to perform execution.[35][36][37] |
S0244 | Comnie | |
G0142 | Confucius | |
S1014 | DanBot |
DanBot can use a VBA macro embedded in an Excel file to drop the payload.[40] |
S1111 | DarkGate |
DarkGate initial infection mechanisms include masquerading as pirated media that launches malicious VBScript on the victim.[41] |
S0695 | Donut |
Donut can generate shellcode outputs that execute via VBScript.[42] |
G1006 | Earth Lusca |
Earth Lusca used VBA scripts.[43] |
S0367 | Emotet |
Emotet has sent Microsoft Word documents with embedded macros that will invoke scripts to download additional payloads. [44][45][46][47][48] |
S0343 | Exaramel for Windows |
Exaramel for Windows has a command to execute VBS scripts on the victim’s machine.[49] |
S0679 | Ferocious |
Ferocious has the ability to use Visual Basic scripts for execution.[50] |
G1016 | FIN13 |
FIN13 has used VBS scripts for code execution on comrpomised machines.[51] |
G0085 | FIN4 |
FIN4 has used VBA macros to display a dialog box and collect victim credentials.[52][53] |
G0046 | FIN7 |
FIN7 used VBS scripts to help perform tasks on the victim's machine.[54][55][56] |
S0696 | Flagpro |
Flagpro can execute malicious VBA macros embedded in .xlsm files.[57] |
C0001 | Frankenstein |
During Frankenstein, the threat actors used Word documents that prompted the victim to enable macros and run a Visual Basic script.[58] |
C0007 | FunnyDream |
During FunnyDream, the threat actors used a Visual Basic script to run remote commands.[59] |
G0047 | Gamaredon Group |
Gamaredon Group has embedded malicious macros in document templates, which executed VBScript. Gamaredon Group has also delivered Microsoft Outlook VBA projects with embedded macros.[60][61][62][63][64] |
S0477 | Goopy |
Goopy has the ability to use a Microsoft Outlook backdoor macro to communicate with its C2.[11] |
G0078 | Gorgon Group |
Gorgon Group has used macros in Spearphishing Attachments as well as executed VBScripts on victim machines.[65] |
S0531 | Grandoreiro |
Grandoreiro can use VBScript to execute malicious code.[16][66] |
S0170 | Helminth | |
G1001 | HEXANE |
HEXANE has used a VisualBasic script named |
G0126 | Higaisa | |
S0483 | IcedID | |
G0100 | Inception |
Inception has used VBScript to execute malicious commands and payloads.[71][72] |
S1132 | IPsec Helper |
IPsec Helper can run arbitrary Visual Basic scripts and commands passed to it.[73] |
S0528 | Javali |
Javali has used embedded VBScript to download malicious payloads from C2.[16] |
S0389 | JCry | |
S0283 | jRAT | |
S0648 | JSS Loader |
JSS Loader can download and execute VBScript files.[56] |
S0585 | Kerrdown |
Kerrdown can use a VBS base64 decoder function published by Motobit.[76] |
S0387 | KeyBoy |
KeyBoy uses VBS scripts for installing files and performing execution.[77] |
G0094 | Kimsuky |
Kimsuky has used Visual Basic to download malicious payloads.[78][79][80][81] Kimsuky has also used malicious VBA macros within maldocs disguised as forms that trigger when a victim types any content into the lure.[81] |
S0250 | Koadic |
Koadic performs most of its operations using Windows Script Host (VBScript) and runs arbitrary shellcode .[82] |
S0669 | KOCTOPUS |
KOCTOPUS has used VBScript to call wscript to execute a PowerShell command.[83] |
G0032 | Lazarus Group |
Lazarus Group has used VBA and embedded macros in Word documents to execute malicious code.[84][85] |
G0140 | LazyScripter |
LazyScripter has used VBScript to execute malicious code.[83] |
G0065 | Leviathan | |
S0447 | Lokibot |
Lokibot has used VBS scripts and XLS macros for execution.[87] |
S0582 | LookBack |
LookBack has used VBA macros in Microsoft Word attachments to drop additional files to the host.[88] |
S1142 | LunarMail | |
G0095 | Machete |
Machete has embedded malicious macros within spearphishing attachments to download additional files.[90] |
G0059 | Magic Hound |
Magic Hound malware has used VBS scripts for execution.[91] |
G1026 | Malteiro |
Malteiro has utilized a dropper containing malicious VBS scripts.[92] |
S0530 | Melcoz | |
S0455 | Metamorfo | |
S1122 | Mispadu |
Mispadu’s dropper uses VBS files to install payloads and perform execution.[92][94] |
G0021 | Molerats |
Molerats used various implants, including those built with VBScript, on target machines.[95][96] |
G0069 | MuddyWater |
MuddyWater has used VBScript files to execute its POWERSTATS payload, as well as macros.[97][98][99][100][101][102][103][104][105] |
G0129 | Mustang Panda |
Mustang Panda has embedded VBScript components in LNK files to download additional files and automate collection.[106][107][108] |
S0228 | NanHaiShu |
NanHaiShu executes additional VBScript code on the victim's machine.[109] |
S0336 | NanoCore | |
S0198 | NETWIRE |
NETWIRE has been executed through use of VBScripts.[111][112] |
G0049 | OilRig |
OilRig has used VBScript macros for execution on compromised hosts.[113] |
S0264 | OopsIE |
OopsIE creates and uses a VBScript as part of its persistent execution.[114][115] |
C0012 | Operation CuckooBees |
During Operation CuckooBees, the threat actors executed an encoded VBScript file using |
C0022 | Operation Dream Job |
During Operation Dream Job, Lazarus Group executed a VBA written malicious macro after victims download malicious DOTM files; Lazarus Group also used Visual Basic macro code to extract a double Base64 encoded DLL implant.[117][118] |
C0016 | Operation Dust Storm |
During Operation Dust Storm, the threat actors used Visual Basic scripts.[119] |
C0006 | Operation Honeybee |
For Operation Honeybee, the threat actors used a Visual Basic script embedded within a Word document to download an implant.[120] |
C0013 | Operation Sharpshooter |
During Operation Sharpshooter, the threat actors used a VBA macro to execute a simple downloader that installed Rising Sun.[121] |
C0014 | Operation Wocao |
During Operation Wocao, threat actors used VBScript to conduct reconnaissance on targeted systems.[122] |
S0352 | OSX_OCEANLOTUS.D |
OSX_OCEANLOTUS.D uses Word macros for execution.[123] |
G0040 | Patchwork |
Patchwork used Visual Basic Scripts (VBS) on victim machines.[124][125] |
S0428 | PoetRAT |
PoetRAT has used Word documents with VBScripts to execute malicious activities.[126][127] |
S0441 | PowerShower |
PowerShower has the ability to save and execute VBScript.[71] |
S0223 | POWERSTATS |
POWERSTATS can use VBScript (VBE) code for execution.[101][128] |
S0147 | Pteranodon |
Pteranodon can use a malicious VBS file for execution.[129] |
S0650 | QakBot |
QakBot can use VBS to download and execute malicious files.[130][131][132][133][134][135][136] |
S0269 | QUADAGENT | |
S0458 | Ramsay |
Ramsay has included embedded Visual Basic scripts in malicious documents.[138][139] |
G0075 | Rancor |
Rancor has used VBS scripts as well as embedded macros for execution.[140] |
G1039 | RedCurl | |
S0375 | Remexi |
Remexi uses AutoIt and VBS scripts throughout its execution process.[143] |
S0496 | REvil |
REvil has used obfuscated VBA macros for execution.[144][145] |
S0240 | ROKRAT | |
S1018 | Saint Bot | |
G0034 | Sandworm Team |
Sandworm Team has created VBScripts to run an SSH server.[148][149][150][8] |
S0589 | Sibot | |
G1008 | SideCopy |
SideCopy has sent Microsoft Office Publisher documents to victims that have embedded malicious macros that execute an hta file via calling |
G0121 | Sidewinder |
Sidewinder has used VBScript to drop and execute malware loaders.[153] |
G0091 | Silence | |
S0226 | Smoke Loader |
Smoke Loader adds a Visual Basic script in the Startup folder to deploy the payload.[155] |
S1086 | Snip3 |
Snip3 can use visual basic scripts for first-stage execution.[156][157] |
C0024 | SolarWinds Compromise |
For the SolarWinds Compromise, APT29 wrote malware such as Sibot in Visual Basic.[158] |
S1030 | Squirrelwaffle |
Squirrelwaffle has used malicious VBA macros in Microsoft Word documents and Excel spreadsheets that execute an |
S1037 | STARWHALE |
STARWHALE can use the VBScript function |
S0380 | StoneDrill |
StoneDrill has several VBS scripts used throughout the malware's lifecycle.[162] |
S0559 | SUNBURST |
SUNBURST used VBScripts to initiate the execution of payloads.[163] |
S1064 | SVCReady | |
G1018 | TA2541 |
TA2541 has used VBS files to execute or establish persistence for additional payloads, often using file names consistent with email themes or mimicking system functionality.[165][166] |
G0062 | TA459 | |
G0092 | TA505 | |
G0134 | Transparent Tribe |
Transparent Tribe has crafted VBS-based malicious documents.[172][173] |
G0010 | Turla | |
S0263 | TYPEFRAME |
TYPEFRAME has used a malicious Word document for delivery with VBA macros for execution.[175] |
S0386 | Ursnif |
Ursnif droppers have used VBA macros to download and execute the malware's full executable payload.[176] |
S0442 | VBShower | |
S0689 | WhisperGate |
WhisperGate can use a Visual Basic script to exclude the |
G0112 | Windshift | |
G0090 | WIRTE | |
S0341 | Xbash |
Xbash can execute malicious VBScript payloads on the victim’s machine.[182] |
ID | Mitigation | Description |
---|---|---|
M1049 | Antivirus/Antimalware |
Anti-virus can be used to automatically quarantine suspicious files. |
M1040 | Behavior Prevention on Endpoint |
On Windows 10, enable Attack Surface Reduction (ASR) rules to prevent Visual Basic scripts from executing potentially malicious downloaded content [183]. |
M1042 | Disable or Remove Feature or Program |
Turn off or restrict access to unneeded VB components. |
M1038 | Execution Prevention |
Use application control where appropriate. VBA macros obtained from the Internet, based on the file's Mark of the Web (MOTW) attribute, may be blocked from executing in Office applications (ex: Access, Excel, PowerPoint, Visio, and Word) by default starting in Windows Version 2203.[6] |
M1021 | Restrict Web-Based Content |
Script blocking extensions can help prevent the execution of scripts and HTA files that may commonly be used during the exploitation process. For malicious code served up through ads, adblockers can help prevent that code from executing in the first place. |
ID | Data Source | Data Component | Detects |
---|---|---|---|
DS0017 | Command | Command Execution |
Monitor executed commands and arguments that may abuse Visual Basic (VB) for execution. Analytic 1 - Look for unusual VB execution.
|
DS0011 | Module | Module Load |
Monitor for the loading of modules associated with VB languages (ex: vbscript.dll). Note: For Windows, Sysmon Event ID 7 (Image loaded) can be used to alert on the loading of DLL modules (e.g., vbscript.dll) associated with Visual Basic into processes. Due to the high frequency of image load operations, Event ID 7 can generate a large volume of events. Therefore, we recommend tuning the Sysmon configuration file to exclude common, benign image loads that may result in false positives. This query focuses on monitoring the loading of specific VB-related modules such as Analytic 1 - Look for unusual VB module loads.
|
DS0009 | Process | Process Creation |
Monitor for the creation of processes related to VBScript and VBA execution. Monitor for events associated with VB execution, such as Office applications spawning processes, usage of the Windows Script Host (typically cscript.exe or wscript.exe). VB execution is likely to perform actions with various effects on a system that may generate events, depending on the types of monitoring used. Note: This query monitors for the creation of processes like cscript.exe, wscript.exe, excel.exe, and winword.exe, which are commonly used to execute VB scripts. It highlights instances where these processes are initiated, providing insight into potential VB script execution. Analytic 1 - Look for unusual VB process creation.
|
DS0012 | Script | Script Execution |
Monitor for any attempts to enable scripts running on a system that would be considered suspicious. If scripts are not commonly used on a system, but enabled, scripts running out of cycle from patching or other administrator functions are suspicious. Scripts should be captured from the file system when possible to determine their actions and intent. Note: Be aware of VBScript execution from temporary or unusual file locations, which may indicate malicious activity. Analytic 1 - Script Execution from Temporary Locations
|