Detection rules › Splunk

WmiPrvSE Suspicious Child Process (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Windows Management Instrumentation Provider Service (WmiPrvSE.exe) is a Windows component used for system management, monitoring, and reporting. While it is legitimately used by system administrators, its system privileges make it an attractive target for abuse by threat actors. This use case detects unusual child processes of WmiPrvSe.exe. It specifically looks for instances where known scripting or executable processes are spawned by WmiPrvSe.exe. The rule excludes certain system processes like 'werfault' and 'wmiprvse' and specific user accounts to reduce false positives, focusing on patterns that are often associated with security threats or attacks

MITRE ATT&CK coverage

References

Telemetry coverage

Rule body

id: '25922.47940'
title: WmiPrvSE Suspicious Child Process
description: Windows Management Instrumentation Provider Service (WmiPrvSE.exe) is
  a Windows component used for system management, monitoring, and reporting. While
  it is legitimately used by system administrators, its system privileges make it
  an attractive target for abuse by threat actors. This use case detects unusual child
  processes of WmiPrvSe.exe. It specifically looks for instances where known scripting
  or executable processes are spawned by WmiPrvSe.exe. The rule excludes certain system
  processes like 'werfault' and 'wmiprvse' and specific user accounts to reduce false
  positives, focusing on patterns that are often associated with security threats
  or attacks. Living Off the Land Binary and Scripts (LOLBAS) (LOLBIN)
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) (TERM(wmiprvse) OR "wmiprvse.exe") (TERM(certutil)
  OR TERM(cscript) OR TERM(mshta) OR TERM(msiexec) OR TERM(regsvr32) OR TERM(rundll32)
  OR TERM(verclsid) OR TERM(wscript) OR "certutil" OR "cscript" OR "mshta" OR "msiexec"
  OR "regsvr32" OR "rundll32" OR "verclsid" OR "wscript") | where match(parent_process_path,
  "(?i)(\x5cwbem\x5cwmiprvse\.exe)") and (match(process_name, "(?i)(certutil|cscript|mshta|msiexec|regsvr32|rundll32|verclsid|wscript)\.exe")
  or match(process_name, "(?i)cmd\.exe") and match(process, "(?i)(cscript|mshta|powershell|pwsh|regsvr32|rundll32|wscript)"))
  and not match(process_name, "(?i)(werfault|wmiprvse)\.exe") and not match(user,
  "AUTHORI|AUTORI") | table _time, host, user, process, process_*, parent_process_*
  | bin span=1s | stats values(*) as * by _time, host '
techniques:
- execution:windows management instrumentation
technique_id: 
- T1047
data_category:
- Windows event logs
references:
- https://thedfirreport.com/2021/03/29/sodinokibi-aka-revil-ransomware/
- https://blog.osarmor.com/319/onenote-attachment-delivers-asyncrat-malware/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) (TERM(wmiprvse) OR "wmiprvse.exe") (TERM(certutil) OR TERM(cscript) OR TERM(mshta) OR TERM(msiexec) OR TERM(regsvr32) OR TERM(rundll32) OR TERM(verclsid) OR TERM(wscript) OR "certutil" OR "cscript" OR "mshta" OR "msiexec" OR "regsvr32" OR "rundll32" OR "verclsid" OR "wscript")

Stage 2: where

| where match(parent_process_path, "(?i)(\x5cwbem\x5cwmiprvse\.exe)") and (match(process_name, "(?i)(certutil|cscript|mshta|msiexec|regsvr32|rundll32|verclsid|wscript)\.exe") or match(process_name, "(?i)cmd\.exe") and match(process, "(?i)(cscript|mshta|powershell|pwsh|regsvr32|rundll32|wscript)")) and not match(process_name, "(?i)(werfault|wmiprvse)\.exe") and not match(user, "AUTHORI|AUTORI")

Stage 3: table

| table _time, host, user, process, process_*, parent_process_*

Stage 4: bucket

| bin span=1s

Stage 5: stats

| stats values(*) as * by _time, host

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process_nameregex_match"(?i)(werfault|wmiprvse).exe"excludes:process_name
userregex_match"AUTHORI, AUTORI"excludes:user

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq value:"4688"
parent_process_pathregex_match
  • "(?i)(\x5cwbem\x5cwmiprvse.exe)" corpus 2 (splunk 2)
field:"parent_process_name" kind:regex_match
processregex_match
  • "(?i)(cscript|mshta|powershell|pwsh|regsvr32|rundll32|wscript)" corpus 2 (splunk 2)
field:"CommandLine" kind:regex_match
process_nameregex_match
  • "(?i)(certutil|cscript|mshta|msiexec|regsvr32|rundll32|verclsid|wscript).exe" corpus 2 (splunk 2)
  • "(?i)cmd.exe" corpus 3 (splunk 3)
field:"process_name" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4688<"
1wmiprvse
1"wmiprvse.exe"
1certutil
1cscript
1mshta
1msiexec
1regsvr32
1rundll32
1verclsid
1wscript
1"certutil"
1"cscript"
1"mshta"
1"msiexec"
1"regsvr32"
1"rundll32"
1"verclsid"
1"wscript"