Detection rules › Sigma
Massive SAM users/groups enumeration (native)
Detects scenarios where an attacker attempts to enumerate sensitive domain users/groups settings and membership. Correlate TargetLogonId from ID 4624 with SubjectLogonId from ID 4661 to identify the source of the enumeration.
Known false positives
- Administrator activity
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Discovery |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4661: A handle to an object was requested. |
Rule body
title: Massive SAM users/groups enumeration (native)
name: SAM_enumeration_user_group
description: Detects scenarios where an attacker attempts to enumerate sensitive domain users/groups settings and membership. Correlate TargetLogonId from ID 4624 with SubjectLogonId from ID 4661 to identify the source of the enumeration.
requirements: extended rights auditing enabled (https://www.manageengine.com/products/active-directory-audit/active-directory-auditing-configuration-guide-configure-object-level-auditing-manually.html)
references:
- https://github.com/mdecrevoisier/EVTX-to-MITRE-Attack/tree/master/TA0007-Discovery/T1069-Permission%20Groups%20Discovery
- https://bitvijays.github.io/LFF-IPS-P3-Exploitation.html
tags:
- attack.discovery
- attack.t1069.002
author: mdecrevoisier
status: experimental
logsource:
product: windows
service: security
detection: # net group <domain_group> /domain
selection:
EventID: 4661
ProcessName|endswith: '\lsass.exe'
ObjectServer: "Security Account Manager"
ObjectName|startswith:
- S-1-5-32- # refers to builtin domain local groups
- S-1-5-21- # refers to domain users and groups
ObjectType:
- SAM_USER
- SAM_GROUP
filter:
- SubjectUserName|endswith: "$"
- ObjectName|endswith: # already covered in a separated rule for sensitive user & group enumeration
- "-500" # local administrator
- "-512" # Domain Admins
- "-513" # Domain users (less critical)
condition: selection and not filter
falsepositives:
- Administrator activity
level: informational
---
title: Massive SAM users/groups enumeration (native)
status: experimental
correlation:
type: value_count
rules:
- SAM_enumeration_user_group
group-by:
- Computer
timespan: 15m
condition:
gte: 30
field: ObjectName
level: high
Stages and Predicates
Stage 0: condition
selection and not filterStage 1: selection
selection:
EventID: 4661
ProcessName|endswith: '\lsass.exe'
ObjectServer: "Security Account Manager"
ObjectName|startswith:
- S-1-5-32-
- S-1-5-21-
ObjectType:
- SAM_USER
- SAM_GROUP
Stage 2: not filter
filter:
- SubjectUserName|endswith: "$"
- ObjectName|endswith:
- "-500"
- "-512"
- "-513"
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
ObjectName | ends_with | -500 | excludes:ObjectName field:"ObjectName" value:"-500" |
ObjectName | ends_with | -512 | excludes:ObjectName field:"ObjectName" value:"-512" |
ObjectName | ends_with | -513 | excludes:ObjectName field:"ObjectName" value:"-513" |
SubjectUserName | ends_with | $ | excludes:SubjectUserName field:"SubjectUserName" value:"$" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
ObjectName | starts_with |
| field:"ObjectName" kind:starts_with |
ObjectServer | eq |
| field:"ObjectServer" kind:eq value:"Security Account Manager" |
ObjectType | eq |
| field:"ObjectType" kind:eq |
ProcessName | ends_with |
| field:"process_name" kind:ends_with value:"\lsass.exe" |