Detection rules › Sigma
Local group membership change
Detects if a member is added to a local group via PowerShell.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence | T1098 Account Manipulation |
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
| PowerShell | Event ID 800 | Event ID 800 |
Rule body yaml
title: Local group membership change
description: Detects if a member is added to a local group via PowerShell.
references:
-
tags:
- attack.persistence
- attack.t1098 # account manipulation
author: mdecrevoisier
status: experimental
logsource:
product: windows
category:
- ps_module
- ps_classic_script
- ps_script
detection: # Add-LocalGroupMember -Group "Administrators" -Member "Admin02",
selection1_powershell_native:
EventID: 800
EventData|contains|all:
- 'Add-LocalGroupMember'
- '-Group'
- '-Member'
selection2_powershell_modern:
EventID: 4103
- 'Add-LocalGroupMember'
- '-Group'
- '-Member'
selection3_powershell_block:
EventID: 4104
ScriptBlockText|contains|all:
- 'Add-LocalGroupMember'
- '-Group'
- '-Member'
condition: 1 of selection*
falsepositives:
- Pentest
- Administrator activity
- Splunk UF agent installation
level: high
Stages and Predicates
Stage 0: condition
1 of selection*Stage 1: selection1_powershell_native
selection1_powershell_native:
EventID: 800
EventData|contains|all:
- 'Add-LocalGroupMember'
- '-Group'
- '-Member'
Stage 2: selection2_powershell_modern
selection2_powershell_modern:
EventID: 4103
- 'Add-LocalGroupMember'
- '-Group'
- '-Member'
Stage 3: selection3_powershell_block
selection3_powershell_block:
EventID: 4104
ScriptBlockText|contains|all:
- 'Add-LocalGroupMember'
- '-Group'
- '-Member'
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 |
|
ScriptBlockText | match |
|