Detection rule
Suspicious WmiPrvSE Child Process
Overview
Detects suspicious and uncommon child processes of WmiPrvSE
- Rule id
8a582fe2-0882-4b89-a82a-da6b2dc32937- ATT&CK techniques
- T1047 Windows Management Instrumentation, T1204.002 User Execution: Malicious File, T1218.010 System Binary Proxy Execution: Regsvr32
- Severity
- High
- Confidence
- Low
- Origin
- SigmaHQ (community)
- SigmaHQ status
test- Used in defense packs
- The Gentlemen, INC Ransom, Akira, safepay, nightspire, braincipher
Validation
- ExperimentalSyntax checked only. Not yet tested on events.
- Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
- SIEM-validatedRun in a real SIEM, with a recorded result.
2 of 2 positive test events matched; 1 of 1 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.
Detection logic and queries
Queries are shown exactly as generated. Test them in your environment before you deploy them.
Sigma
Sigma (YAML) · 8a582fe2-0882-4b89-a82a-da6b2dc32937
title: Suspicious WmiPrvSE Child Process
id: 8a582fe2-0882-4b89-a82a-da6b2dc32937
related:
- id: 692f0bec-83ba-4d04-af7e-e884a96059b6
type: similar
- id: d21374ff-f574-44a7-9998-4a8c8bf33d7d
type: similar
- id: 18cf6cf0-39b0-4c22-9593-e244bdc9a2d4
type: obsolete
status: test
description: Detects suspicious and uncommon child processes of WmiPrvSE
references:
- https://thedfirreport.com/2021/03/29/sodinokibi-aka-revil-ransomware/
- https://github.com/vadim-hunter/Detection-Ideas-Rules/blob/02bcbfc2bfb8b4da601bb30de0344ae453aa1afe/Threat%20Intelligence/The%20DFIR%20Report/20210329_Sodinokibi_(aka_REvil)_Ransomware.yaml
- https://blog.osarmor.com/319/onenote-attachment-delivers-asyncrat-malware/
- https://twitter.com/ForensicITGuy/status/1334734244120309760
author: Vadim Khrykov (ThreatIntel), Cyb3rEng, Florian Roth (Nextron Systems)
date: 2021-08-23
modified: 2023-11-10
tags:
- attack.execution
- attack.stealth
- attack.t1047
- attack.t1204.002
- attack.t1218.010
logsource:
product: windows
category: process_creation
detection:
selection_parent:
ParentImage|endswith: '\wbem\WmiPrvSE.exe'
selection_children_1:
# TODO: Add more LOLBINs or suspicious processes that make sens in your environment
Image|endswith:
- '\certutil.exe'
- '\cscript.exe'
- '\mshta.exe'
- '\msiexec.exe'
- '\regsvr32.exe'
- '\rundll32.exe'
- '\verclsid.exe'
- '\wscript.exe'
selection_children_2:
# This is in a separate selection due to the nature of FP generated with CMD
Image|endswith: '\cmd.exe'
CommandLine|contains:
- 'cscript'
- 'mshta'
- 'powershell'
- 'pwsh'
- 'regsvr32'
- 'rundll32'
- 'wscript'
filter_main_werfault:
Image|endswith: '\WerFault.exe'
filter_main_wmiprvse:
Image|endswith: '\WmiPrvSE.exe' # In some legitimate case WmiPrvSE was seen spawning itself
filter_main_msiexec:
Image|endswith: '\msiexec.exe'
CommandLine|contains: '/i '
condition: selection_parent and 1 of selection_children_* and not 1 of filter_main_*
falsepositives:
- Unknown
level: highQRadar AQL
IBM QRadar AQL (hunting query)Hunting query
Hunting search for the Log Activity tab or the API. It is not a QRadar rule.
AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).
SELECT * FROM events WHERE devicetype=12 AND LOWER("Parent Process Path") LIKE '%\wbem\wmiprvse.exe' AND (((LOWER("Process Path") LIKE '%\certutil.exe' OR LOWER("Process Path") LIKE '%\cscript.exe' OR LOWER("Process Path") LIKE '%\mshta.exe' OR LOWER("Process Path") LIKE '%\msiexec.exe' OR LOWER("Process Path") LIKE '%\regsvr32.exe' OR LOWER("Process Path") LIKE '%\rundll32.exe' OR LOWER("Process Path") LIKE '%\verclsid.exe' OR LOWER("Process Path") LIKE '%\wscript.exe') OR (LOWER("Process Name") LIKE '%\certutil.exe' OR LOWER("Process Name") LIKE '%\cscript.exe' OR LOWER("Process Name") LIKE '%\mshta.exe' OR LOWER("Process Name") LIKE '%\msiexec.exe' OR LOWER("Process Name") LIKE '%\regsvr32.exe' OR LOWER("Process Name") LIKE '%\rundll32.exe' OR LOWER("Process Name") LIKE '%\verclsid.exe' OR LOWER("Process Name") LIKE '%\wscript.exe')) OR ((LOWER("Process Path") LIKE '%\cmd.exe' OR LOWER("Process Name") LIKE '%\cmd.exe') AND (LOWER(Command) LIKE '%cscript%' OR LOWER(Command) LIKE '%mshta%' OR LOWER(Command) LIKE '%powershell%' OR LOWER(Command) LIKE '%pwsh%' OR LOWER(Command) LIKE '%regsvr32%' OR LOWER(Command) LIKE '%rundll32%' OR LOWER(Command) LIKE '%wscript%'))) AND (NOT(((LOWER("Process Path") LIKE '%\werfault.exe' OR LOWER("Process Name") LIKE '%\werfault.exe') OR (LOWER("Process Path") LIKE '%\wmiprvse.exe' OR LOWER("Process Name") LIKE '%\wmiprvse.exe') OR ((LOWER("Process Path") LIKE '%\msiexec.exe' OR LOWER("Process Name") LIKE '%\msiexec.exe') AND LOWER(Command) LIKE '%/i %'))))QRadar CRE
Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.
- Rule name
OffSet7: Suspicious WmiPrvSE Child Process- Rule type
- Event rule (Local)
- Log source types
- Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1
Building blocks
BB:OffSet7:Suspicious WmiPrvSE Child Process:selection_parent(match)All test lines must match (AND).Parent Process Pathends with:\wbem\WmiPrvSE.exe
BB:OffSet7:Suspicious WmiPrvSE Child Process:selection_children_1(match)All test lines must match (AND).Process Path / Process Nameends with:\certutil.exe,\cscript.exe,\mshta.exe,\msiexec.exe,\regsvr32.exe,\rundll32.exe,\verclsid.exe,\wscript.exe
BB:OffSet7:Suspicious WmiPrvSE Child Process:selection_children_2(match)All test lines must match (AND).Process Path / Process Nameends with:\cmd.exeCommandcontains:cscript,mshta,powershell,pwsh,regsvr32,rundll32,wscript
BB:OffSet7:Suspicious WmiPrvSE Child Process:filter_main_werfault(exclusion)All test lines must match (AND).Process Path / Process Nameends with:\WerFault.exe
BB:OffSet7:Suspicious WmiPrvSE Child Process:filter_main_wmiprvse(exclusion)All test lines must match (AND).Process Path / Process Nameends with:\WmiPrvSE.exe
BB:OffSet7:Suspicious WmiPrvSE Child Process:filter_main_msiexec(exclusion)All test lines must match (AND).Process Path / Process Nameends with:\msiexec.exeCommandcontains:/i
Main rule, option A (building blocks)
- when the event(s) were detected by one or more of these log source types:
Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1 - when an event matches the condition built from these building blocks:
BB:OffSet7:Suspicious WmiPrvSE Child Process:selection_parent AND (ANY of [BB:OffSet7:Suspicious WmiPrvSE Child Process:selection_children_1, BB:OffSet7:Suspicious WmiPrvSE Child Process:selection_children_2]) AND NOT (ANY of [BB:OffSet7:Suspicious WmiPrvSE Child Process:filter_main_werfault, BB:OffSet7:Suspicious WmiPrvSE Child Process:filter_main_wmiprvse, BB:OffSet7:Suspicious WmiPrvSE Child Process:filter_main_msiexec])
Main rule, option B (AQL filter test)
- when the event matches this AQL filter query:
devicetype=12 AND LOWER("Parent Process Path") LIKE '%\wbem\wmiprvse.exe' AND (((LOWER("Process Path") LIKE '%\certutil.exe' OR LOWER("Process Path") LIKE '%\cscript.exe' OR LOWER("Process Path") LIKE '%\mshta.exe' OR LOWER("Process Path") LIKE '%\msiexec.exe' OR LOWER("Process Path") LIKE '%\regsvr32.exe' OR LOWER("Process Path") LIKE '%\rundll32.exe' OR LOWER("Process Path") LIKE '%\verclsid.exe' OR LOWER("Process Path") LIKE '%\wscript.exe') OR (LOWER("Process Name") LIKE '%\certutil.exe' OR LOWER("Process Name") LIKE '%\cscript.exe' OR LOWER("Process Name") LIKE '%\mshta.exe' OR LOWER("Process Name") LIKE '%\msiexec.exe' OR LOWER("Process Name") LIKE '%\regsvr32.exe' OR LOWER("Process Name") LIKE '%\rundll32.exe' OR LOWER("Process Name") LIKE '%\verclsid.exe' OR LOWER("Process Name") LIKE '%\wscript.exe')) OR ((LOWER("Process Path") LIKE '%\cmd.exe' OR LOWER("Process Name") LIKE '%\cmd.exe') AND (LOWER(Command) LIKE '%cscript%' OR LOWER(Command) LIKE '%mshta%' OR LOWER(Command) LIKE '%powershell%' OR LOWER(Command) LIKE '%pwsh%' OR LOWER(Command) LIKE '%regsvr32%' OR LOWER(Command) LIKE '%rundll32%' OR LOWER(Command) LIKE '%wscript%'))) AND (NOT(((LOWER("Process Path") LIKE '%\werfault.exe' OR LOWER("Process Name") LIKE '%\werfault.exe') OR (LOWER("Process Path") LIKE '%\wmiprvse.exe' OR LOWER("Process Name") LIKE '%\wmiprvse.exe') OR ((LOWER("Process Path") LIKE '%\msiexec.exe' OR LOWER("Process Name") LIKE '%\msiexec.exe') AND LOWER(Command) LIKE '%/i %'))))
Rule response
- Severity 7, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)
Limitations
- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.
Splunk
Splunk SPLSearch
Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.
ParentImage="*\\wbem\\WmiPrvSE.exe" (Image IN ("*\\certutil.exe", "*\\cscript.exe", "*\\mshta.exe", "*\\msiexec.exe", "*\\regsvr32.exe", "*\\rundll32.exe", "*\\verclsid.exe", "*\\wscript.exe") OR (Image="*\\cmd.exe" (CommandLine IN ("*cscript*", "*mshta*", "*powershell*", "*pwsh*", "*regsvr32*", "*rundll32*", "*wscript*")))) NOT (Image="*\\WerFault.exe" OR Image="*\\WmiPrvSE.exe" OR (Image="*\\msiexec.exe" CommandLine="*/i *"))Splunk savedsearches.conf stanzaScheduled search template
Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.
[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now
[Suspicious WmiPrvSE Child Process]
description = Detects suspicious and uncommon child processes of WmiPrvSE
search = ParentImage="*\\wbem\\WmiPrvSE.exe" (Image IN ("*\\certutil.exe", "*\\cscript.exe", "*\\mshta.exe", "*\\msiexec.exe", "*\\regsvr32.exe", "*\\rundll32.exe", "*\\verclsid.exe", "*\\wscript.exe") OR (Image="*\\cmd.exe" (CommandLine IN ("*cscript*", "*mshta*", "*powershell*", "*pwsh*", "*regsvr32*", "*rundll32*", "*wscript*")))) NOT (Image="*\\WerFault.exe" OR Image="*\\WmiPrvSE.exe" OR (Image="*\\msiexec.exe" CommandLine="*/i *"))Microsoft Sentinel
Microsoft Sentinel KQL (ASIM)Hunting query
Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.
imProcessCreate
| where (ParentProcessName endswith "\\wbem\\WmiPrvSE.exe" or ActingProcessName endswith "\\wbem\\WmiPrvSE.exe") and ((TargetProcessName endswith "\\certutil.exe" or TargetProcessName endswith "\\cscript.exe" or TargetProcessName endswith "\\mshta.exe" or TargetProcessName endswith "\\msiexec.exe" or TargetProcessName endswith "\\regsvr32.exe" or TargetProcessName endswith "\\rundll32.exe" or TargetProcessName endswith "\\verclsid.exe" or TargetProcessName endswith "\\wscript.exe") or (TargetProcessName endswith "\\cmd.exe" and (TargetProcessCommandLine contains "cscript" or TargetProcessCommandLine contains "mshta" or TargetProcessCommandLine contains "powershell" or TargetProcessCommandLine contains "pwsh" or TargetProcessCommandLine contains "regsvr32" or TargetProcessCommandLine contains "rundll32" or TargetProcessCommandLine contains "wscript"))) and (not((TargetProcessName endswith "\\WerFault.exe" or TargetProcessName endswith "\\WmiPrvSE.exe" or (TargetProcessName endswith "\\msiexec.exe" and TargetProcessCommandLine contains "/i "))))Defender XDR
Microsoft Defender XDR KQLHunting query
Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.
DeviceProcessEvents
| where InitiatingProcessFolderPath endswith "\\wbem\\WmiPrvSE.exe" and ((FolderPath endswith "\\certutil.exe" or FolderPath endswith "\\cscript.exe" or FolderPath endswith "\\mshta.exe" or FolderPath endswith "\\msiexec.exe" or FolderPath endswith "\\regsvr32.exe" or FolderPath endswith "\\rundll32.exe" or FolderPath endswith "\\verclsid.exe" or FolderPath endswith "\\wscript.exe") or (FolderPath endswith "\\cmd.exe" and (ProcessCommandLine contains "cscript" or ProcessCommandLine contains "mshta" or ProcessCommandLine contains "powershell" or ProcessCommandLine contains "pwsh" or ProcessCommandLine contains "regsvr32" or ProcessCommandLine contains "rundll32" or ProcessCommandLine contains "wscript"))) and (not((FolderPath endswith "\\WerFault.exe" or FolderPath endswith "\\WmiPrvSE.exe" or (FolderPath endswith "\\msiexec.exe" and ProcessCommandLine contains "/i "))))Elastic
Elastic Lucene (ECS)Hunting query
Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.
process.parent.executable:*\\wbem\\WmiPrvSE.exe AND ((process.executable:(*\\certutil.exe OR *\\cscript.exe OR *\\mshta.exe OR *\\msiexec.exe OR *\\regsvr32.exe OR *\\rundll32.exe OR *\\verclsid.exe OR *\\wscript.exe)) OR (process.executable:*\\cmd.exe AND (process.command_line:(*cscript* OR *mshta* OR *powershell* OR *pwsh* OR *regsvr32* OR *rundll32* OR *wscript*)))) AND (NOT (process.executable:*\\WerFault.exe OR process.executable:*\\WmiPrvSE.exe OR (process.executable:*\\msiexec.exe AND process.command_line:*\/i\ *)))Elastic EQL (ECS)Hunting query
EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.
any where process.parent.executable:"*\\wbem\\WmiPrvSE.exe" and ((process.executable like~ ("*\\certutil.exe", "*\\cscript.exe", "*\\mshta.exe", "*\\msiexec.exe", "*\\regsvr32.exe", "*\\rundll32.exe", "*\\verclsid.exe", "*\\wscript.exe")) or (process.executable:"*\\cmd.exe" and (process.command_line like~ ("*cscript*", "*mshta*", "*powershell*", "*pwsh*", "*regsvr32*", "*rundll32*", "*wscript*")))) and (not (process.executable:"*\\WerFault.exe" or process.executable:"*\\WmiPrvSE.exe" or (process.executable:"*\\msiexec.exe" and process.command_line:"*/i *")))Elastic ES|QL (ECS)Hunting query
ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.
from * metadata _id, _index, _version | where ends_with(process.parent.executable, "\\wbem\\WmiPrvSE.exe") and (ends_with(process.executable, "\\certutil.exe") or ends_with(process.executable, "\\cscript.exe") or ends_with(process.executable, "\\mshta.exe") or ends_with(process.executable, "\\msiexec.exe") or ends_with(process.executable, "\\regsvr32.exe") or ends_with(process.executable, "\\rundll32.exe") or ends_with(process.executable, "\\verclsid.exe") or ends_with(process.executable, "\\wscript.exe") or ends_with(process.executable, "\\cmd.exe") and (process.command_line like "*cscript*" or process.command_line like "*mshta*" or process.command_line like "*powershell*" or process.command_line like "*pwsh*" or process.command_line like "*regsvr32*" or process.command_line like "*rundll32*" or process.command_line like "*wscript*")) and not (ends_with(process.executable, "\\WerFault.exe") or ends_with(process.executable, "\\WmiPrvSE.exe") or ends_with(process.executable, "\\msiexec.exe") and process.command_line like "*/i *")Required telemetry
- Log source
product: windows · category: process_creation- Fields used
CommandLineImageParentImage
False positives
- Unknown
Investigation and response
No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.
References
- https://thedfirreport.com/2021/03/29/sodinokibi-aka-revil-ransomware/
- https://github.com/vadim-hunter/Detection-Ideas-Rules/blob/02bcbfc2bfb8b4da601bb30de0344ae453aa1afe/Threat%20Intelligence/The%20DFIR%20Report/20210329_Sodinokibi_(aka_REvil)_Ransomware.yaml
- https://blog.osarmor.com/319/onenote-attachment-delivers-asyncrat-malware/
- https://twitter.com/ForensicITGuy/status/1334734244120309760
Author and attribution
- Author
- Vadim Khrykov (ThreatIntel), Cyb3rEng, Florian Roth (Nextron Systems)
- Source
- SigmaHQ ·
rules/windows/process_creation/proc_creation_win_wmiprvse_susp_child_processes.yml - Upstream commit
9688134317a2- Licence
- Detection Rule License (DRL) 1.1
Version history
- Version 1Imported from SigmaHQ
- OffSet7 build · SigmaHQ
9688134317a2