A handle was requested to a securable object such as a SAM account database object or an Active Directory object. Records the Object Type, Object Name and the accesses requested.
4661 to SAM or directory-service objects underpins credential-dumping and enumeration detection. Handle requests to the SAM database or to sensitive AD objects can indicate secretsdump-style activity or targeted recon. Very high volume — it must be filtered by object type and requested accesses to be useful.
Focus on ObjectType SAM_* and DS objects where the requested Accesses include reads of credential attributes. Correlate with 4662 (DS object operation) and 4663 (object access). Baseline heavily before alerting.
SubjectUserNameObjectNameObjectTypeAccessMask | Tactic | Technique |
|---|---|
| Credential Access | OS Credential Dumping (T1003) |
Starting points — adapt the log source, projected fields and thresholds for your environment.
title: Handle Requested To SAM Or DS Object
status: experimental
logsource:
product: windows
service: security
detection:
sel:
EventID: 4661
obj:
ObjectType|startswith: 'SAM_'
condition: sel and obj
level: medium
SecurityEvent
| where EventID == 4661 // A handle to an object was requested (SAM / DS object)
| project TimeGenerated, Computer, SubjectUserName, ObjectName, ObjectType, AccessMask
| sort by TimeGenerated desc
index=* sourcetype="WinEventLog:Security" EventCode=4661
| stats count earliest(_time) as first_seen latest(_time) as last_seen by ComputerName
| sort - count `# A handle to an object was requested (SAM / DS object) — add EventData fields: SubjectUserName, ObjectName, ObjectType, AccessMask`
A handle to an object was requested (SAM / DS object). A handle was requested to a securable object such as a SAM account database object or an Active Directory object. Records the Object Type, Object Name and the accesses requested.
Event 4661 is written to the Security channel by Microsoft-Windows-Security-Auditing. Advanced Audit Policy — enable the 'DS Access' subcategory (Success and/or Failure).
Event 4661 is associated with: OS Credential Dumping (T1003).
Focus on ObjectType SAM_* and DS objects where the requested Accesses include reads of credential attributes. Correlate with 4662 (DS object operation) and 4663 (object access). Baseline heavily before alerting.