Windows AD Same Domain SID History Addition
Description
The following analytic looks for changes to the sIDHistory AD attribute of user or computer objects which exist within the same domain. The SID history AD attribute allows users to inherit permissions from a separate AD account without group changes. Initially developed for access continuity when migrating user accounts to different domains, this attribute can also be abused by adversaries to stealthily grant access to a backdoor account within the same domain. This analytic was written to pick up on activity via Mimikatz sid::patch. Please note there are additional avenues to abuse SID history such as DCShadow & Golden / Diamond tickets which won't be detected using these event codes.
- Type: TTP
-
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2022-09-09
- Author: Dean Luxton
- ID: 5fde0b7c-df7a-40b1-9b3a-294c00f0289d
Annotations
ATT&CK
Kill Chain Phase
- Actions on Objectives
NIST
- DE.CM
CIS20
- CIS 4
- CIS 6
- CIS 16
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: 2