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][15] |
| G0087 | APT39 | |
| G1044 | APT42 | |
| S0373 | Astaroth |
Astaroth has used malicious VBS e-mail attachments for execution.[18] |
| S0414 | BabyShark | |
| S0475 | BackConfig |
BackConfig has used VBS to install its downloader component and malicious documents with VBA macro code.[20] |
| S0234 | Bandook |
Bandook has used malicious VBA code against the target system.[21] |
| S0268 | Bisonal |
Bisonal's dropper creates VBS scripts on the victim’s machine.[22][23] |
| G0060 | BRONZE BUTLER |
BRONZE BUTLER has used VBS and VBE scripts for execution.[24][25] |
| S1039 | Bumblebee |
Bumblebee can create a Visual Basic script to enable persistence.[26][27] |
| 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.[28] |
| C0015 | C0015 |
During C0015, the threat actors used a malicious HTA file that contained a mix of HTML and JavaScript/VBScript code.[29] |
| S0631 | Chaes | |
| S1149 | CHIMNEYSWEEP |
CHIMNEYSWEEP has executed a script named cln.vbs on compromised hosts.[31] |
| G0080 | Cobalt Group |
Cobalt Group has sent Word OLE compound documents with malicious obfuscated VBA macros that will run upon user execution.[32][33][34][35][36][37] |
| S0154 | Cobalt Strike |
Cobalt Strike can use VBA to perform execution.[38][39][40] |
| S0244 | Comnie | |
| G0142 | Confucius | |
| G1052 | Contagious Interview |
Contagious Interview has utilized Visual Basic scripts in the execution of their downloader malware targeting Windows devices including as script called update.vbs.[43] |
| S1014 | DanBot |
DanBot can use a VBA macro embedded in an Excel file to drop the payload.[44] |
| S1111 | DarkGate |
DarkGate initial infection mechanisms include masquerading as pirated media that launches malicious VBScript on the victim.[45] |
| S0695 | Donut |
Donut can generate shellcode outputs that execute via VBScript.[46] |
| G1006 | Earth Lusca |
Earth Lusca used VBA scripts.[47] |
| S0367 | Emotet |
Emotet has sent Microsoft Word documents with embedded macros that will invoke scripts to download additional payloads. [48][49][50][51][52] |
| S0343 | Exaramel for Windows |
Exaramel for Windows has a command to execute VBS scripts on the victim’s machine.[53] |
| S0679 | Ferocious |
Ferocious has the ability to use Visual Basic scripts for execution.[54] |
| G1016 | FIN13 |
FIN13 has used VBS scripts for code execution on comrpomised machines.[55] |
| G0085 | FIN4 |
FIN4 has used VBA macros to display a dialog box and collect victim credentials.[56][57] |
| G0046 | FIN7 |
FIN7 used VBS scripts to help perform tasks on the victim's machine.[58][59][60] |
| S0696 | Flagpro |
Flagpro can execute malicious VBA macros embedded in .xlsm files.[61] |
| C0001 | Frankenstein |
During Frankenstein, the threat actors used Word documents that prompted the victim to enable macros and run a Visual Basic script.[62] |
| C0007 | FunnyDream |
During FunnyDream, the threat actors used a Visual Basic script to run remote commands.[63] |
| 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.[64][65][66][67][68][69] Additionally, Gamaredon Group has executed VBScript files using wscript.exe.[70] |
| 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.[71] |
| S0531 | Grandoreiro |
Grandoreiro can use VBScript to execute malicious code.[18][72] |
| 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.[77][78] |
| S1132 | IPsec Helper |
IPsec Helper can run arbitrary Visual Basic scripts and commands passed to it.[79] |
| S0528 | Javali |
Javali has used embedded VBScript to download malicious payloads from C2.[18] |
| S0389 | JCry | |
| S0283 | jRAT | |
| S0648 | JSS Loader |
JSS Loader can download and execute VBScript files.[60] |
| C0044 | Juicy Mix |
During Juicy Mix, OilRig used VBS droppers to deliver and establish persistence for the Mango backdoor.[82] |
| S0585 | Kerrdown |
Kerrdown can use a VBS base64 decoder function published by Motobit.[83] |
| S0387 | KeyBoy |
KeyBoy uses VBS scripts for installing files and performing execution.[84] |
| G0094 | Kimsuky |
Kimsuky has used Visual Basic to download malicious payloads.[85][86][87][88] Kimsuky has also used malicious VBA macros within maldocs disguised as forms that trigger when a victim types any content into the lure.[88] |
| S0250 | Koadic |
Koadic performs most of its operations using Windows Script Host (VBScript) and runs arbitrary shellcode .[89] |
| S0669 | KOCTOPUS |
KOCTOPUS has used VBScript to call wscript to execute a PowerShell command.[90] |
| G0032 | Lazarus Group |
Lazarus Group has used VBA and embedded macros in Word documents to execute malicious code.[91][92] |
| G0140 | LazyScripter |
LazyScripter has used VBScript to execute malicious code.[90] |
| G0065 | Leviathan | |
| S0447 | Lokibot |
Lokibot has used VBS scripts and XLS macros for execution.[94] |
| S0582 | LookBack |
LookBack has used VBA macros in Microsoft Word attachments to drop additional files to the host.[95] |
| S1142 | LunarMail | |
| G0095 | Machete |
Machete has embedded malicious macros within spearphishing attachments to download additional files.[97] |
| G0059 | Magic Hound |
Magic Hound malware has used VBS scripts for execution.[98] |
| G1026 | Malteiro |
Malteiro has utilized a dropper containing malicious VBS scripts.[99] |
| S0530 | Melcoz | |
| S0455 | Metamorfo | |
| S1122 | Mispadu |
Mispadu’s dropper uses VBS files to install payloads and perform execution.[99][101] |
| G0021 | Molerats |
Molerats used various implants, including those built with VBScript, on target machines.[102][103] |
| G0069 | MuddyWater |
MuddyWater has used VBScript files to execute its POWERSTATS payload, as well as macros.[104][105][106][107][108][109][110][111][112] |
| G0129 | Mustang Panda |
Mustang Panda has embedded VBScript components in LNK files to download additional files and automate collection.[113][114][115] Mustang Panda has also used VBA macros in maldocs to execute malicious DLLs.[116] Mustang Panda also utilized a VBS Script "autorun.vbs" that created persistence through saving the VBS Script in the startup directory which would cause it to run each time the machine was turned on.[117] |
| S0228 | NanHaiShu |
NanHaiShu executes additional VBScript code on the victim's machine.[118] |
| S0336 | NanoCore | |
| S0198 | NETWIRE |
NETWIRE has been executed through use of VBScripts.[120][121] |
| G0049 | OilRig |
OilRig has used VBScript macros for execution on compromised hosts.[122] |
| S0264 | OopsIE |
OopsIE creates and uses a VBScript as part of its persistent execution.[123][124] |
| 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.[126][127] |
| C0016 | Operation Dust Storm |
During Operation Dust Storm, the threat actors used Visual Basic scripts.[128] |
| C0006 | Operation Honeybee |
For Operation Honeybee, the threat actors used a Visual Basic script embedded within a Word document to download an implant.[129] |
| C0013 | Operation Sharpshooter |
During Operation Sharpshooter, the threat actors used a VBA macro to execute a simple downloader that installed Rising Sun.[130] |
| C0014 | Operation Wocao |
During Operation Wocao, threat actors used VBScript to conduct reconnaissance on targeted systems.[131] |
| S0352 | OSX_OCEANLOTUS.D |
OSX_OCEANLOTUS.D uses Word macros for execution.[132] |
| C0042 | Outer Space |
During Outer Space, OilRig used VBS droppers to deploy malware.[82] |
| G0040 | Patchwork |
Patchwork used Visual Basic Scripts (VBS) on victim machines.[133][134] |
| S0428 | PoetRAT |
PoetRAT has used Word documents with VBScripts to execute malicious activities.[135][136] |
| S0441 | PowerShower |
PowerShower has the ability to save and execute VBScript.[77] |
| S0223 | POWERSTATS |
POWERSTATS can use VBScript (VBE) code for execution.[108][137] |
| S0147 | Pteranodon |
Pteranodon can use a malicious VBS file for execution.[138] |
| S0650 | QakBot |
QakBot can use VBS to download and execute malicious files.[139] |
| S0269 | QUADAGENT | |
| S0458 | Ramsay |
Ramsay has included embedded Visual Basic scripts in malicious documents.[147][148] |
| G0075 | Rancor |
Rancor has used VBS scripts as well as embedded macros for execution.[149] |
| G1039 | RedCurl | |
| S0375 | Remexi |
Remexi uses AutoIt and VBS scripts throughout its execution process.[152] |
| S0496 | REvil |
REvil has used obfuscated VBA macros for execution.[153][154] |
| S0240 | ROKRAT | |
| S1018 | Saint Bot | |
| G0034 | Sandworm Team |
Sandworm Team has created VBScripts to run an SSH server.[157][158][159][8] |
| S1178 | ShrinkLocker |
ShrinkLocker is a VisualBasic script (VBS) object that calls multiple other operating system functions during execution.[160][161] |
| 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.[164] |
| G0091 | Silence | |
| S0226 | Smoke Loader |
Smoke Loader adds a Visual Basic script in the Startup folder to deploy the payload.[166] |
| S1086 | Snip3 |
Snip3 can use visual basic scripts for first-stage execution.[167][168] |
| C0024 | SolarWinds Compromise |
For the SolarWinds Compromise, APT29 wrote malware such as Sibot in Visual Basic.[169] |
| 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.[173] |
| S0559 | SUNBURST |
SUNBURST used VBScripts to initiate the execution of payloads.[174] |
| 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.[176][177] |
| G0062 | TA459 | |
| G0092 | TA505 | |
| S1193 | TAMECAT | |
| G0134 | Transparent Tribe |
Transparent Tribe has crafted VBS-based malicious documents.[183][184] |
| G0010 | Turla | |
| S0263 | TYPEFRAME |
TYPEFRAME has used a malicious Word document for delivery with VBA macros for execution.[186] |
| S0386 | Ursnif |
Ursnif droppers have used VBA macros to download and execute the malware's full executable payload.[187] |
| 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.[193] |
| 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 [194]. |
| 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 | Name | Analytic ID | Analytic Description |
|---|---|---|---|
| DET0076 | Behavioral Detection of Visual Basic Execution (VBS/VBA/VBScript) | AN0209 |
Detects execution of VB-based scripts or macros (VBS/VBA/VBScript) through cscript.exe/wscript.exe, Office-based process chains, or HTA usage. Focuses on chained behavior: Office or HTML container spawns script host > script host spawns PowerShell, network connections, or process injection. |
| AN0210 |
Detects embedded or emulated VBScript/VBA execution via Wine-based apps, Office for Mac abusing cross-platform .NET features, or macros dropped and invoked via AppleScript or third-party automation tools. |
||
| AN0211 |
Detects abuse of Mono/.NET Core environments to execute VB-like scripts, often in environments with Office emulation or WINE. Focus is on rare invocations of scripting hosts like mono.exe or .NET shells, often seen in spam filtering or forensic labs with Office support. |