WSF/JSE/JS/VBA/VBE File Execution Via Cscript/Wscript
A Sigma rule for process creation on Windows, from SigmaHQ’s threat hunting rules, by Michael Haag.
medium 2 ATT&CK techniques 2 programs it names 18 everyday examples trip it
What it looks for
detection:
selection_cli:
CommandLine|contains:
- '.js'
- '.jse'
- '.vba'
- '.vbe'
- '.vbs'
- '.wsf'
- '.wsh'
selection_img:
- OriginalFileName:
- 'wscript.exe'
- 'cscript.exe'
- Image|endswith:
- '\wscript.exe'
- '\cscript.exe'
condition: all of selection_*
The rule’s detection, its selections and fields in order of name. The whole rule, with its references and false positives, is on SigmaHQ, by Michael Haag, under the Detection Rule License 1.1. CmdID evaluates it on a command line alone: a test on what a command line cannot show, such as the parent process or the user, is not met.
Command lines that trip it
Run a script on the page for cscript.exe
cscript path\to\script.vbsIdentifyRun script in the interactive or batch mode (enable or suppress alerts, prompts, and scripting errors) on the page for cscript.exe
cscript //i path\to\script.vbsIdentifyRun a script on the page for wscript.exe
wscript path\to\script.vbsIdentifyRun script in the interactive or batch mode (enable or suppress alerts, prompts, and scripting errors) on the page for wscript.exe
wscript //i path\to\script.vbsIdentifyInstall a product key (Note: It replaces the existing key) on the page for ospp.vbs
cscript ospp.vbs /inpkey:product_keyIdentifyUninstall an installed product key with the last five digits of the product key on the page for ospp.vbs
cscript ospp.vbs /unpkey:product_key_digitsIdentifyDisplay license information for installed product keys on the page for ospp.vbs
cscript ospp.vbs /dstatusIdentifydisplay the current Windows license information on the page for slmgr.vbs
cscript slmgr.vbs /dliIdentifydisplay the installation iD for the current device. Useful for offline license activation on the page for slmgr.vbs
cscript slmgr.vbs /dtiIdentifyAnd 6 more examples on CmdID’s program pages.
The commands documented for cscript.exe, manage-bde.wsf, winrm.vbs, wscript.exe trip it too: each is on its program’s page, read by CmdID.