Detection rules › Sigma
WMI registration (PowerShell)
Detects scenarios where an attacker createsan instance of a WMI class using tools like WMImplant or PowerLurk.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence | T1546.003 Event Triggered Execution: Windows Management Instrumentation Event Subscription |
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4103 | Payload Context: ContextInfo User Data: UserData. |
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
| PowerShell | Event ID 800 | Event ID 800 |
Rule body yaml
title: WMI registration (PowerShell)
description: Detects scenarios where an attacker createsan instance of a WMI class using tools like WMImplant or PowerLurk.
references:
- https://github.com/mdecrevoisier/EVTX-to-MITRE-Attack/tree/master/TA0003-Persistence/T1546-Event%20Triggered%20Execution
- https://github.com/Sw4mpf0x/PowerLurk
- https://github.com/FortyNorthSecurity/WMImplant
- https://www.netspi.com/blog/technical/adversary-simulation/getting-started-wmi-weaponization-part-5/
- https://www.darkoperator.com/blog/2017/10/14/basics-of-tracking-wmi-activity
tags:
- attack.persistence
- attack.t1546.003
author: mdecrevoisier
status: experimental
logsource:
product: windows
category:
- ps_module
- ps_classic_script
- ps_script
detection:
selection1_powershell_native:
EventID: 800
EventData|contains:
- Set-WmiInstance
- Swmi
EventData|contains:
- Class
- Namespace
- Arguments
selection2_powershell_modern:
EventID: 4103
Payload|contains:
- Set-WmiInstance
- Swmi
Payload|contains:
- Class
- Namespace
- Arguments
selection3_powershell_block:
EventID: 4104
ScriptBlockText|contains:
- Set-WmiInstance
- Swmi
ScriptBlockText|contains:
- Class
- Namespace
- Arguments
condition: 1 of selection*
falsepositives:
- legitimate WMI class registration
- monitoring products
- Microsoft System Center or security products
level: high
Stages and Predicates
Stage 0: condition
1 of selection*Stage 1: selection1_powershell_native
selection1_powershell_native:
EventID: 800
EventData|contains:
- Set-WmiInstance
- Swmi
EventData|contains:
- Class
- Namespace
- Arguments
Stage 2: selection2_powershell_modern
selection2_powershell_modern:
EventID: 4103
Payload|contains:
- Set-WmiInstance
- Swmi
Payload|contains:
- Class
- Namespace
- Arguments
Stage 3: selection3_powershell_block
selection3_powershell_block:
EventID: 4104
ScriptBlockText|contains:
- Set-WmiInstance
- Swmi
ScriptBlockText|contains:
- Class
- Namespace
- Arguments
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.
| Field | Kind | Values |
|---|---|---|
EventData | match |
|
Payload | match |
|
ScriptBlockText | match |
|