Detection rules › Sigma

Potential Suspicious Mofcomp Execution

Severity
high
Author
Nasreddine Bencherchali (Nextron Systems)
Source
upstream

Detects execution of the "mofcomp" utility as a child of a suspicious shell or script running utility or by having a suspicious path in the commandline. The "mofcomp" utility parses a file containing MOF statements and adds the classes and class instances defined in the file to the WMI repository. Attackers abuse this utility to install malicious MOF scripts

MITRE ATT&CK coverage

TacticTechniques
Defense EvasionT1218 System Binary Proxy Execution

Event coverage

ProviderEvent IDTitle
Sysmon1Process creation

Stages and Predicates

Stage 1: all of selection_img

or:
Image|endswith: '\mofcomp.exe'
OriginalFileName: mofcomp.exe

Stage 2: all of selection_case

or:
CommandLine|contains: '%appdata%'
CommandLine|contains: '%temp%'
CommandLine|contains: '%tmp%'
CommandLine|contains: '\AppData\Local\Temp'
CommandLine|contains: '\Users\Public\'
CommandLine|contains: '\WINDOWS\Temp\'
ParentImage|endswith: '\cmd.exe'
ParentImage|endswith: '\cscript.exe'
ParentImage|endswith: '\powershell.exe'
ParentImage|endswith: '\pwsh.exe'
ParentImage|endswith: '\wscript.exe'
ParentImage|endswith: '\wsl.exe'

Stage 3: not 1 of filter_main_wmiprvse

CommandLine|endswith: .mof
CommandLine|contains: 'C:\Windows\TEMP\'
ParentImage: 'C:\Windows\System32\wbem\WmiPrvSE.exe'

Stage 4: not 1 of filter_optional_null_parent

CommandLine|endswith: .mof
CommandLine|contains: 'C:\Windows\TEMP\'

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
CommandLineends_with
  • .mof
CommandLinematch
  • %appdata% corpus 4 (sigma 4)
  • %temp% corpus 5 (sigma 5)
  • %tmp% corpus 9 (sigma 9)
  • C:\Windows\TEMP\ corpus 3 (sigma 3)
  • \AppData\Local\Temp corpus 8 (sigma 8)
  • \Users\Public\ corpus 17 (sigma 17)
  • \WINDOWS\Temp\ corpus 2 (sigma 2)
Imageends_with
  • \mofcomp.exe
OriginalFileNameeq
  • mofcomp.exe
ParentImageends_with
  • \cmd.exe corpus 13 (sigma 13)
  • \cscript.exe corpus 14 (sigma 14)
  • \powershell.exe corpus 16 (sigma 16)
  • \pwsh.exe corpus 16 (sigma 16)
  • \wscript.exe corpus 14 (sigma 14)
  • \wsl.exe corpus 4 (sigma 4)
ParentImageeq
  • C:\Windows\System32\wbem\WmiPrvSE.exe