Detection rules › Sigma

WSF/JSE/JS/VBA/VBE File Execution Via Cscript/Wscript

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Michael Haag
Source
github.com/SigmaHQ/sigma

Detects script file execution (.js, .jse, .vba, .vbe, .vbs, .wsf, .wsh) by Wscript/Cscript.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: WSF/JSE/JS/VBA/VBE File Execution Via Cscript/Wscript
id: 1e33157c-53b1-41ad-bbcc-780b80b58288
related:
    - id: 23250293-eed5-4c39-b57a-841c8933a57d
      type: obsolete
    - id: cea72823-df4d-4567-950c-0b579eaf0846
      type: derived
status: test
description: Detects script file execution (.js, .jse, .vba, .vbe, .vbs, .wsf, .wsh) by Wscript/Cscript.
references:
    - https://thedfirreport.com/2023/10/30/netsupport-intrusion-results-in-domain-compromise/
    - https://redcanary.com/blog/gootloader/
author: Michael Haag
date: 2019-01-16
modified: 2026-02-17
tags:
    - attack.execution
    - attack.t1059.005
    - attack.t1059.007
    - detection.threat-hunting
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - OriginalFileName:
              - 'wscript.exe'
              - 'cscript.exe'
        - Image|endswith:
              - '\wscript.exe'
              - '\cscript.exe'
    selection_cli:
        CommandLine|contains:
            - '.js'
            - '.jse'
            - '.vba'
            - '.vbe'
            - '.vbs'
            - '.wsf'
            - '.wsh'
    condition: all of selection_*
falsepositives:
    - Some additional tuning is required. It is recommended to add the user profile path in CommandLine if it is getting too noisy.
level: medium

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_img

selection_img:
    - OriginalFileName:
          - 'wscript.exe'
          - 'cscript.exe'
    - Image|endswith:
          - '\wscript.exe'
          - '\cscript.exe'

Stage 2: selection_cli

selection_cli:
    CommandLine|contains:
        - '.js'
        - '.jse'
        - '.vba'
        - '.vbe'
        - '.vbs'
        - '.wsf'
        - '.wsh'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • .js corpus 9 (sigma 9)
  • .jse corpus 3 (sigma 2, kusto 1)
  • .vba corpus 2 (sigma 2)
  • .vbe corpus 5 (sigma 5)
  • .vbs corpus 7 (sigma 7)
  • .wsf corpus 4 (sigma 3, elastic 1)
  • .wsh corpus 4 (sigma 4)
Imageends_with
  • \cscript.exe corpus 73 (sigma 73)
  • \wscript.exe corpus 75 (sigma 75)
OriginalFileNameeq
  • cscript.exe corpus 19 (sigma 17, elastic 2)
  • wscript.exe corpus 20 (sigma 17, elastic 3)