Detection rules › Sigma

Suspicious MSHTA Child Process

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

Detects a suspicious process spawning from an "mshta.exe" process, which could be indicative of a malicious HTA script execution

Known false positives

  • Printer software / driver installations
  • HP software

MITRE ATT&CK coverage

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Suspicious MSHTA Child Process
id: 03cc0c25-389f-4bf8-b48d-11878079f1ca
status: test
description: Detects a suspicious process spawning from an "mshta.exe" process, which could be indicative of a malicious HTA script execution
references:
    - https://www.trustedsec.com/july-2015/malicious-htas/
author: Michael Haag
date: 2019-01-16
modified: 2023-02-06
tags:
    - attack.stealth
    - attack.t1218.005
    - car.2013-02-003
    - car.2013-03-001
    - car.2014-04-003
logsource:
    category: process_creation
    product: windows
detection:
    selection_parent:
        ParentImage|endswith: '\mshta.exe'
    selection_child:
        - Image|endswith:
              - '\cmd.exe'
              - '\powershell.exe'
              - '\pwsh.exe'
              - '\wscript.exe'
              - '\cscript.exe'
              - '\sh.exe'
              - '\bash.exe'
              - '\reg.exe'
              - '\regsvr32.exe'
              - '\bitsadmin.exe'
        - OriginalFileName:
              - 'Cmd.Exe'
              - 'PowerShell.EXE'
              - 'pwsh.dll'
              - 'wscript.exe'
              - 'cscript.exe'
              - 'Bash.exe'
              - 'reg.exe'
              - 'REGSVR32.EXE'
              - 'bitsadmin.exe'
    condition: all of selection*
falsepositives:
    - Printer software / driver installations
    - HP software
level: high

Stages and Predicates

Stage 0: condition

all of selection*

Stage 1: selection_parent

selection_parent:
    ParentImage|endswith: '\mshta.exe'

Stage 2: selection_child

selection_child:
    - Image|endswith:
          - '\cmd.exe'
          - '\powershell.exe'
          - '\pwsh.exe'
          - '\wscript.exe'
          - '\cscript.exe'
          - '\sh.exe'
          - '\bash.exe'
          - '\reg.exe'
          - '\regsvr32.exe'
          - '\bitsadmin.exe'
    - OriginalFileName:
          - 'Cmd.Exe'
          - 'PowerShell.EXE'
          - 'pwsh.dll'
          - 'wscript.exe'
          - 'cscript.exe'
          - 'Bash.exe'
          - 'reg.exe'
          - 'REGSVR32.EXE'
          - 'bitsadmin.exe'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Imageends_with
  • \bash.exe corpus 21 (sigma 21)
  • \bitsadmin.exe corpus 29 (sigma 29)
  • \cmd.exe corpus 130 (sigma 130)
  • \cscript.exe corpus 72 (sigma 72)
  • \powershell.exe corpus 179 (sigma 178, kusto 1)
  • \pwsh.exe corpus 165 (sigma 164, kusto 1)
  • \reg.exe corpus 58 (sigma 58)
  • \regsvr32.exe corpus 64 (sigma 64)
  • \sh.exe corpus 16 (sigma 16)
  • \wscript.exe corpus 74 (sigma 74)
field:"Image" kind:ends_with
OriginalFileNameeq
  • Bash.exe corpus 4 (sigma 3, elastic 1)
  • Cmd.Exe corpus 81 (sigma 43, elastic 21, splunk 17)
  • PowerShell.EXE corpus 138 (sigma 84, splunk 30, elastic 24)
  • REGSVR32.EXE corpus 37 (sigma 17, elastic 15, splunk 5)
  • bitsadmin.exe corpus 20 (sigma 9, elastic 8, splunk 2, kusto 1)
  • cscript.exe corpus 32 (sigma 17, elastic 15)
  • pwsh.dll corpus 112 (sigma 79, splunk 30, elastic 3)
  • reg.exe corpus 43 (sigma 32, splunk 8, elastic 3)
  • wscript.exe corpus 38 (elastic 21, sigma 17)
field:"OriginalFileName" kind:eq
ParentImageends_with
  • \mshta.exe corpus 13 (sigma 13)
field:"ParentImage" kind:ends_with value:"\mshta.exe"