Windows AD Same Domain SID History Addition
Description
The following analytic detects changes to the sIDHistory attribute of user or computer objects within the same domain. It leverages Windows Security Event Codes 4738 and 4742 to identify when the sIDHistory attribute is modified. This activity is significant because the sIDHistory attribute can be abused by adversaries to grant unauthorized access by inheriting permissions from another account. If confirmed malicious, this could allow attackers to maintain persistent access or escalate privileges within the domain, posing a severe security risk.
- Type: TTP
-
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2024-05-22
- Author: Dean Luxton
- ID: 5fde0b7c-df7a-40b1-9b3a-294c00f0289d
Annotations
ATT&CK
Kill Chain Phase
- Exploitation
NIST
- DE.CM
CIS20
- CIS 10
CVE
Search
1
2
3
4
5
6
7
8
9
10
`wineventlog_security` (EventCode=4742 OR EventCode=4738) NOT SidHistory IN ("%%1793", -)
| rex field=SidHistory "(^%{
|^)(?P<SidHistoryMatch>.*)(\-
|\\\)"
| rex field=TargetSid "^(?P<TargetSidmatch>.*)(\-
|\\\)"
| where SidHistoryMatch=TargetSidmatch OR SidHistoryMatch=TargetDomainName
| rename TargetSid as userSid, TargetDomainName as userDomainName
| table _time action status host user userSid userDomainName SidHistory Logon_ID src_user
| `windows_ad_same_domain_sid_history_addition_filter`
Macros
The SPL above uses the following Macros:
windows_ad_same_domain_sid_history_addition_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Required fields
List of fields required to use this analytic.
- _time
- EventCode
- SidHistory
- TargetSid
- TargetDomainName
- user
- src_user
- Logon_ID
How To Implement
To successfully implement this search, you need to be ingesting eventcodes 4738
and 4742
. The Advanced Security Audit policy settings Audit User Account Management
and Audit Computer Account Management
within Account Management
all need to be enabled. SID resolution is not required..
Known False Positives
Unknown
Associated Analytic Story
RBA
Risk Score | Impact | Confidence | Message |
---|---|---|---|
100.0 | 100 | 100 | Active Directory SID History Attribute was added to $user$ by $src_user$ |
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.
Reference
- https://adsecurity.org/?p=1772
- https://learn.microsoft.com/en-us/windows/win32/adschema/a-sidhistory?redirectedfrom=MSDN
- https://learn.microsoft.com/en-us/defender-for-identity/security-assessment-unsecure-sid-history-attribute
- https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/sid-history-injection
Test Dataset
Replay any dataset to Splunk Enterprise by using our replay.py
tool or the UI.
Alternatively you can replay a dataset into a Splunk Attack Range
source | version: 3