Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / ACTIVE DIRECTORY / DC REPLICATION

DCShadow

This note documents detection patterns related to DCShadow within Active Directory environments.


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Security4742Computer account changedHighAttackers may modify attributes of a computer account when registering a rogue domain controller during DCShadow operations.
Security5136Directory object modifiedCriticalDCShadow modifies AD objects directly via replication. Review AttributeLDAPDisplayName, ObjectDN, and SubjectUserName.
Security4672Special privileges assignedHighAttackers often require Domain Admin or equivalent privileges before performing DCShadow.
Security4624Successful logonHighAdministrative logon preceding DCShadow operation.
Security4688Process creationHighMay reveal execution of mimikatz with DCShadow modules.
Sysmon1Process creationCriticalExecution of mimikatz or other tooling enabling DCShadow attack.
Sysmon3Network connectionMediumSuspicious RPC communication between host and domain controllers.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Rogue domain controller registrationTemporary domain controller objects appearing in ADCriticalDCShadow simulates a rogue DC for replication operations.
Unusual AD attribute modificationsChanges to sensitive attributes like admin privileges or password hashesHighAttackers may inject privileges or persistence mechanisms.
Replication operations from non-DC hostReplication traffic initiated by workstation or serverCriticalStrong indicator of DCShadow.
Mimikatz executionCommand line containing lsadump::dcshadowHighDirect evidence of attack tooling.
Persistence artifactsBackdoored accounts or modified ACLsHighOften used to maintain domain persistence.

Common Tools

ToolUsage
MimikatzImplements DCShadow to push malicious replication changes to domain controllers.
Cobalt StrikeUsed to execute Mimikatz modules remotely.
PowerShellUsed to stage and execute credential manipulation scripts.

Relevant Artifacts

  • Windows Security logs (4742, 5136, 4624, 4672, 4688)
  • Directory Service logs
  • Sysmon logs (1, 3)
  • AD replication metadata
  • EDR telemetry showing suspicious administrative tools
  • Network traffic between compromised host and domain controllers
  • Attribute modification records within AD objects
  • New nTDSDSA object
  • Appended a global catalog ServicePrincipalName to the computer object

MITRE ATT&CK References

  • T1207 DCShadow
  • T1098 Account Manipulation
  • T1078 Valid Accounts
  • T1484 Domain Policy Modification

Decision Tree

  1. Is the suspicious event present?
    • Look for Event 5136 modifications involving privileged attributes.
  2. What host generated the event?
    • Determine whether modifications originated from a non-domain-controller host.
  3. Is the account expected to perform this action?
    • Only domain controllers and authorized admins normally perform replication modifications.
  4. Pivot:
    • Source host → inspect executed processes and administrative tools.
    • Account → review privilege assignments and group membership.
    • Network → inspect replication traffic patterns.
  5. Confirm exploitation
    • Determine whether attacker modified privileges or persistence mechanisms.

Example Detection Templates

KQL

SecurityEvent
| where EventID == 5136
| where AttributeLDAPDisplayName contains "admin"
| project TimeGenerated, SubjectUserName, ObjectDN, AttributeLDAPDisplayName
SecurityEvent
| where EventID == 4742
| project TimeGenerated, TargetUserName, SubjectUserName

EQL

any where event.code == "5136"

Sigma

title: Possible DCShadow Attack
id: dcshadow-detection
status: experimental
description: Detects suspicious Active Directory object modifications that may indicate DCShadow
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 5136
  condition: selection
fields:
  - SubjectUserName
  - ObjectDN
  - AttributeLDAPDisplayName
falsepositives:
  - Legitimate directory modifications by administrators
level: high
tags:
  - attack.persistence
  - attack.t1207

Splunk

PKINIT Logons

index=main source="WinEventLog:Security" EventCode=4768 Pre_Authentication_Type=16
| stats count values(user) as Users values(src_ip) as SourceIPs values(Ticket_Encryption_Type) as Encryption by user  
| sort - count

Unexpected PKINIT by Non-Smartcard User

index=main source="WinEventLog:Security" EventCode=4768 Pre_Authentication_Type=16
| search user!=*$  
| stats count values(src_ip) as SourceIPs values(TargetUserName) as TargetUsers by user  
| where count > 1

Detect msDS-KeyCredentialLink Modification

index=main source="WinEventLog:Security" EventCode=5136
| search AttributeLDAPDisplayName="msDS-KeyCredentialLink"
| table _time SubjectUserName ObjectDN AttributeLDAPDisplayName AttributeValue
# Hunt Global Catalog SPNS
index=main earliest=1690623888 latest=1690623890 EventCode=4742 
| rex field=Message "(?P<gcspn>GC\/[a-zA-Z0-9\.\-\/]+)" 
| table _time, ComputerName, Security_ID, Account_Name, user, gcspn 
| search gcspn=*

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
Privileged access controlRestrict Domain Admin and replication privilegesHighLimits ability to perform DCShadow.
AD monitoringAlert on unusual directory attribute modificationsHighDetects unauthorized changes to AD objects.
Network monitoringMonitor replication traffic between hostsMediumDetects rogue replication activity.
Administrative auditingTrack administrative command executionHighProvides visibility into misuse of administrative tools.
Security baselinesRegularly audit AD objects and ACLsHighDetects unauthorized persistence mechanisms.