| Title | WSF/JSE/JS/VBA/VBE File Execution |
|:-------------------------|:------------------|
| **Description** | Detects suspicious file execution by wscript and cscript |
| **ATT&CK Tactic** |
- [TA0002: Execution](https://attack.mitre.org/tactics/TA0002)
|
| **ATT&CK Technique** | - [T1059.005: Visual Basic](https://attack.mitre.org/techniques/T1059/005)
- [T1059.007: JavaScript/JScript](https://attack.mitre.org/techniques/T1059/007)
- [T1064: Scripting](https://attack.mitre.org/techniques/T1064)
|
| **Data Needed** | - [DN_0002_4688_windows_process_creation_with_commandline](../Data_Needed/DN_0002_4688_windows_process_creation_with_commandline.md)
- [DN_0003_1_windows_sysmon_process_creation](../Data_Needed/DN_0003_1_windows_sysmon_process_creation.md)
|
| **Trigger** | - [T1059.005: Visual Basic](../Triggers/T1059.005.md)
|
| **Severity Level** | medium |
| **False Positives** | - Will need to be tuned. I recommend adding the user profile path in CommandLine if it is getting too noisy.
|
| **Development Status** | experimental |
| **References** | There are no documented References for this Detection Rule yet |
| **Author** | Michael Haag |
## Detection Rules
### Sigma rule
```
title: WSF/JSE/JS/VBA/VBE File Execution
id: 1e33157c-53b1-41ad-bbcc-780b80b58288
status: experimental
description: Detects suspicious file execution by wscript and cscript
author: Michael Haag
date: 2019/01/16
modified: 2020/08/28
tags:
- attack.execution
- attack.t1059.005
- attack.t1059.007
- attack.t1064 # an old one
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith:
- '\wscript.exe'
- '\cscript.exe'
CommandLine|contains:
- '.jse'
- '.vbe'
- '.js'
- '.vba'
condition: selection
fields:
- CommandLine
- ParentCommandLine
falsepositives:
- Will need to be tuned. I recommend adding the user profile path in CommandLine if it is getting too noisy.
level: medium
```
### powershell
```
Get-WinEvent | where {(($_.message -match "Image.*.*\\\\wscript.exe" -or $_.message -match "Image.*.*\\\\cscript.exe") -and ($_.message -match "CommandLine.*.*.jse.*" -or $_.message -match "CommandLine.*.*.vbe.*" -or $_.message -match "CommandLine.*.*.js.*" -or $_.message -match "CommandLine.*.*.vba.*")) } | select TimeCreated,Id,RecordId,ProcessId,MachineName,Message
```
### es-qs
```
(winlog.event_data.Image.keyword:(*\\\\wscript.exe OR *\\\\cscript.exe) AND winlog.event_data.CommandLine.keyword:(*.jse* OR *.vbe* OR *.js* OR *.vba*))
```
### xpack-watcher
```
curl -s -XPUT -H \'Content-Type: application/json\' --data-binary @- localhost:9200/_watcher/watch/1e33157c-53b1-41ad-bbcc-780b80b58288 <