| Title | WSF/JSE/JS/VBA/VBE File Execution | |:-------------------------|:------------------| | **Description** | Detects suspicious file execution by wscript and cscript | | **ATT&CK Tactic** | | | **ATT&CK Technique** | | | **Data Needed** | | | **Trigger** | | | **Severity Level** | medium | | **False Positives** | | | **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 <