Detection rules › Sigma

Cscript/Wscript Uncommon Script Extension Execution

Status
test
Severity
high
Log source
category process_creation, product windows
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

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

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

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • .csv corpus 2 (sigma 2)
  • .dat corpus 4 (sigma 3, elastic 1)
  • .doc corpus 4 (sigma 4)
  • .gif corpus 9 (sigma 8, elastic 1)
  • .jpeg corpus 7 (sigma 6, elastic 1)
  • .jpg corpus 8 (sigma 7, elastic 1)
  • .png corpus 8 (sigma 7, elastic 1)
  • .ppt corpus 4 (sigma 4)
  • .txt corpus 9 (sigma 9)
  • .xls corpus 4 (sigma 4)
  • .xml corpus 6 (sigma 4, splunk 2)
field:"CommandLine" kind:match
Imageends_with
  • \cscript.exe corpus 72 (sigma 72)
  • \wscript.exe corpus 74 (sigma 74)
field:"Image" kind:ends_with
OriginalFileNameeq
  • cscript.exe corpus 32 (sigma 17, elastic 15)
  • wscript.exe corpus 38 (elastic 21, sigma 17)
field:"OriginalFileName" kind:eq