Detection rules › Sigma

Invoke-Obfuscation Via Use MSHTA - PowerShell

Status
test
Severity
high
Log source
product windows, category ps_script
Author
Nikita Nazarov, oscd.community
Source
github.com/SigmaHQ/sigma

Detects Obfuscated Powershell via use MSHTA in Scripts

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Invoke-Obfuscation Via Use MSHTA - PowerShell
id: e55a5195-4724-480e-a77e-3ebe64bd3759
status: test
description: Detects Obfuscated Powershell via use MSHTA in Scripts
references:
    - https://github.com/SigmaHQ/sigma/issues/1009 # (Task31)
author: Nikita Nazarov, oscd.community
date: 2020-10-08
modified: 2022-11-29
tags:
    - attack.stealth
    - attack.t1027
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection_4104:
        ScriptBlockText|contains|all:
            - 'set'
            - '&&'
            - 'mshta'
            - 'vbscript:createobject'
            - '.run'
            - '(window.close)'
    condition: selection_4104
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

selection_4104

Stage 1: selection_4104

selection_4104:
    ScriptBlockText|contains|all:
        - 'set'
        - '&&'
        - 'mshta'
        - 'vbscript:createobject'
        - '.run'
        - '(window.close)'

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
ScriptBlockTextmatch
  • && corpus 2 (sigma 2)
  • (window.close)
  • .run
  • mshta
  • set
  • vbscript:createobject