Detection rules › Sigma

Cscript/Wscript Uncommon Script Extension Execution

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects Wscript/Cscript executing a file with an uncommon (i.e. non-script) extension

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Cscript/Wscript Uncommon Script Extension Execution
id: 99b7460d-c9f1-40d7-a316-1f36f61d52ee
status: test
description: Detects Wscript/Cscript executing a file with an uncommon (i.e. non-script) extension
references:
    - Internal Research
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-05-15
modified: 2023-06-19
tags:
    - attack.execution
    - attack.t1059.005
    - attack.t1059.007
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - OriginalFileName:
              - 'wscript.exe'
              - 'cscript.exe'
        - Image|endswith:
              - '\wscript.exe'
              - '\cscript.exe'
    selection_extension:
        CommandLine|contains:
            # Note: add additional potential suspicious extension
            # We could specify the "//E:" flag to avoid typos by admin. But since that's prone to blind spots via the creation of assoc it's better not to include it
            - '.csv'
            - '.dat'
            - '.doc'
            - '.gif'
            - '.jpeg'
            - '.jpg'
            - '.png'
            - '.ppt'
            - '.txt'
            - '.xls'
            - '.xml'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high

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_extension

selection_extension:
    CommandLine|contains:
        - '.csv'
        - '.dat'
        - '.doc'
        - '.gif'
        - '.jpeg'
        - '.jpg'
        - '.png'
        - '.ppt'
        - '.txt'
        - '.xls'
        - '.xml'

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
  • .csv corpus 2 (sigma 2)
  • .dat corpus 3 (sigma 3)
  • .doc corpus 4 (sigma 4)
  • .gif corpus 8 (sigma 8)
  • .jpeg corpus 6 (sigma 6)
  • .jpg corpus 7 (sigma 7)
  • .png corpus 7 (sigma 7)
  • .ppt corpus 4 (sigma 4)
  • .txt corpus 9 (sigma 9)
  • .xls corpus 4 (sigma 4)
  • .xml corpus 6 (sigma 4, splunk 2)
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)