How to Detect DCSync: DRSUAPI Replication, Packet by Packet

This walkthrough uses ntlm_rpc.pcapng from the NTLMSSP section of the Wireshark wiki's SampleCaptures page, published with the password that decrypts it. The comparison with real replication uses win2016_win2016.pcapng and its keytab from Wireshark issue 19699. Download them there. We decoded them with VisualEther, which turns a Wireshark PCAP into a sequence diagram with a plain-English caption on every message.

DCSync is a well-known attack name, but few defenders have seen one on the wire. It is not malware or an exploit: it is an ordinary Active Directory replication request, the same call domain controllers make to each other every few minutes, sent by a machine that is not a domain controller. The domain controller answers it because the caller's account holds replication rights, and the answer contains password hashes.

This capture holds one complete DCSync: 32 frames in 203 ms. A workstation looks up the replication service, logs in with NTLM, resolves one account name, and pulls that account's secrets with a single DsGetNCChanges call. Its traffic is encrypted, but the capture comes with the password, so Wireshark decrypts every call. We put it beside a real domain controller replicating, so each difference is visible in the packets rather than claimed.

This article explains what replication looks like and how to recognize the imitation. It is not a guide to running DCSync.

Each participant gets a lane, and each message is an arrow, numbered as in Wireshark and captioned with what it does. Under each arrow are the fields that matter: the RPC interface, the authentication type and level, the NTLM user and host, the DRS extensions and GUIDs, and the DsGetNCChanges extended operation, object, flags, and attribute list. The password hashes in the reply are redacted from the packet trees.

💡 Read the walkthrough and the diagram side by side: open the interactive diagram in a split-screen window, or open it in a new tab and snap the two windows side by side.

What is DRSUAPI?

DRSUAPI is the RPC interface domain controllers use to replicate Active Directory to each other. Microsoft specifies it in [MS-DRSR], the Directory Replication Service (DRS) Remote Protocol.

Some background first. Active Directory (AD) stores a Windows domain's users, computers, groups, and their passwords. Every domain controller (DC) holds a full writable copy, so a user can log in at any of them, and a change made on one DC must reach all the others. Replication is how it gets there.

The copies are split into naming contexts (NCs), also called partitions: the domain NC with the users and computers, the configuration NC, and the schema NC. Each object has a distinguished name (DN), such as CN=DC,OU=Domain Controllers,DC=lab,DC=lan, and a GUID (a 128-bit globally unique identifier) that never changes. Each DC also has its own identity for replication: the GUID of its NTDS Settings object, called its DSA GUID (DSA, directory system agent, is the old X.500 name for a directory server).

DRSUAPI runs over DCE/RPC (the Distributed Computing Environment's remote procedure call protocol, which Windows extends as [MS-RPCE]). A client finds the interface through the Endpoint Mapper (EPM) on TCP port 135, binds to it with UUID e3514235-4b06-11d1-ab04-00c04fc2dcd2, version 4.0 ([MS-DRSR] 1.9 and 2.1), and then calls its operations by number:

OpnumOperationWhat it does
0DsBindOpen a session and exchange capabilities, the DRS extensions
1DsUnbindClose it
3DsGetNCChangesPull directory changes from a partner: the replication call
12DsCrackNamesTranslate a name between formats, such as account name to GUID
16DsGetDomainControllerInfoList the domain's DCs and their GUIDs

How do domain controllers replicate?

Replication is pull-based: a DC that wants changes asks a partner for them with DsGetNCChanges ([MS-DRSR] 4.1.10). Each request names a naming context and says how much the caller already has, so the partner sends only what is new.

Two counters make that work. Each DC numbers its own changes with an update sequence number (USN) that only goes up. The caller sends a high-water mark, the highest USN it has seen from this partner, and an up-to-dateness (UTD) vector, the highest USN it has seen from every DC in the domain, so changes that already reached it another way are skipped. The partner replies with a batch of objects, a new high-water mark, and a more data flag; the caller repeats until the flag is clear.

The issue 19699 capture shows a real DC doing this. It records a new DC, SUBWINDC4002, being promoted against an existing one, WINDC1. Its first replication requests decrypt with the attached keytab, so we can read them:

RoundNaming contextWatermark (USN)Reply sizeReply time
1Schema0379 kB107 ms
2Schema1,003345 kB79 ms
3Configuration0469 kB78 ms
4Configuration5,103347 kB114 ms

Every request asks for up to 1,000 objects and 10 MiB, with no extended operation and no attribute list (all attributes). Each reply arrives as 61 to 82 RPC fragments of about 5.7 kB. Their contents stay unreadable for a different reason than encryption: the requests set DRSUAPI_DRS_USE_COMPRESSION, and the replies come back compressed with the Windows Server 2003 algorithm (DRS_COMP_ALG_WIN2K3, [MS-DRSR] 4.1.10.2.18). Wireshark labels it WIN2K3_LZ77_DIRECT2 but does not decompress it. After promotion, the two DCs replicate in both directions with their own machine accounts, and those connections stay sealed because the keytab holds only the Administrator key.

sequenceDiagram accTitle: Domain controller replication with DsGetNCChanges accDescr: The destination DC binds to the source DC, then sends DsGetNCChanges requests with its high-water mark. The source DC replies with a batch of objects and a more-data flag until the flag is clear. participant D as Destination DC participant S as Source DC D->>S: DsBind with its own DSA GUID and full extensions S-->>D: DsBind reply with bind handle D->>S: DsGetNCChanges for an NC, watermark 0, up to 1000 objects S-->>D: Objects, new watermark, more data set D->>S: DsGetNCChanges from the new watermark S-->>D: Objects, more data clear
A replication cycle in outline, as the issue 19699 promotion shows it: rounds continue until the reply's more-data flag is clear.

What is DCSync?

DCSync is a DsGetNCChanges request for one account's secrets, sent by a machine that is not a domain controller. Tools such as Mimikatz (lsadump::dcsync) and Impacket (secretsdump) implement it. Nothing in the protocol requires the caller to be a DC: the server checks the caller's account for two control access rights on the naming context, DS-Replication-Get-Changes and, for secret attributes, DS-Replication-Get-Changes-All ([MS-DRSR] 5.101; the rights are listed in [MS-ADTS] 5.1.3.2.1).

Domain Admins, Enterprise Admins, and the domain controllers hold those rights by default, and so do some service accounts, such as the one Microsoft Entra Connect uses to synchronize password hashes. Anyone who controls one of those accounts can pull the hash of any user, including krbtgt, whose key signs every Kerberos ticket in the domain.

What does the whole DCSync look like?

sequenceDiagram accTitle: DCSync in the ntlm_rpc capture accDescr: The workstation PC asks the DC's Endpoint Mapper for the DRSUAPI port, binds with NTLM at packet privacy, calls DsBind, DsGetDomainControllerInfo and DsCrackNames, binds again with the DC's own GUID, sends one DsGetNCChanges for the DC computer account, receives its password attributes, and unbinds. participant PC as PC workstation participant DC as DC domain controller PC->>DC: [6] EPM Map, where is DRSUAPI DC-->>PC: [7] TCP port 49667 PC->>DC: [11-13] Bind and NTLM login as LAB\admin, packet privacy PC->>DC: [14] DsBind with the NTDSAPI client GUID PC->>DC: [17] DsGetDomainControllerInfo for lab.lan PC->>DC: [20] DsCrackNames lab\dc$ to GUID PC->>DC: [22] DsBind with the DC's own DSA GUID PC->>DC: [24] DsGetNCChanges, one object, 19 attributes DC-->>PC: [25] The account with unicodePwd and supplementalCredentials PC->>DC: [29] DsUnbind
The DCSync capture at a glance. Frame numbers are in brackets; TCP handshakes and acknowledgments are left out.

The capture has five phases. The diagram keeps every message except the TCP acknowledgments and one retransmitted EPM reply, and each section below names the frames it covers.

Finding the service: EPM on port 135 (frames 1 to 7)

The workstation, which names itself PC (10.0.0.20), connects to port 135 on the domain controller DC (10.0.0.10) and binds to the Endpoint Mapper with no authentication. It asks where DRSUAPI listens, and the DC answers in 200 µs: TCP port 49667, in the Windows dynamic range of 49152 to 65535.

This is the first point a network sensor can catch. The EPM request names the DRSUAPI UUID in the clear, and so does the RPC bind on the new port. Neither depends on decryption.

Logging in: NTLM at packet privacy (frames 8 to 13)

The workstation opens a second connection, to port 49667, and binds to DRSUAPI with NTLM authentication at RPC authentication level 6, packet privacy: every call after the bind is signed and encrypted ([MS-RPCE] 2.2.1.1.8). The three NTLM messages ride in the bind (NEGOTIATE), the bind acknowledgment (CHALLENGE, naming server DC in domain LAB), and a separate AUTH3 packet (AUTHENTICATE).

The AUTHENTICATE message names the caller in the clear: user LAB\admin on host PC. That is the first strong signal. Real replication logs in as a domain controller's machine account, such as SUBWINDC4002$, with Kerberos and a ticket for the replication service principal name (SPN), E3514235-4B06-11D1-AB04-00C04FC2DCD2/<DSA GUID>/<domain> ([MS-DRSR] 2.2.3.2). Here it is a user on a workstation, with NTLM. The NT response is 24 bytes, so this lab also allows NTLMv1 ([MS-NLMP] 3.3.1), which is worth its own alert on a real network.

Looking up the target: DsBind, DsGetDomainControllerInfo, DsCrackNames (frames 14 to 21)

The first DsBind identifies the client with GUID e24d201a-4fd6-11d1-a3da-0000f875ae0d. That is NTDSAPI_CLIENT_GUID ([MS-DRSR] 5.138), which Windows clients that are not DCs pass to DsBind; a DC passes its own server GUID ([MS-DRSR] 4.1.3 and its product behavior note). The client offers two DRS extension bits (0x04008000: DRS_EXT_STRONG_ENCRYPTION and DRS_EXT_GETCHGREPLY_V6, [MS-DRSR] 5.39), with process ID 0 and no site. The DC answers with extensions 0x3fffff7f (nearly every capability bit), its site GUID, and its process ID.

DsGetDomainControllerInfo then lists the domain's two DCs, DC.lab.lan and dcfr.lab.lan, with their computer-object and DSA GUIDs. DsCrackNames translates the account name lab\dc$, the DC's own computer account, into its object GUID, 2640eac5-0fb7-4550-99da-cc3d97649a28.

Pulling the account: a second DsBind and DsGetNCChanges (frames 22 to 25)

The second DsBind is dressed as a domain controller. Its client GUID is now 3a2a6e1a-1701-45d7-8771-b5dd5a305c46, the DC's own DSA GUID from the list in frame 18, and its site GUID is the one the DC returned in frame 16. The extension bits are still the two from frame 14, and the process ID is still 0. A DC binding to a partner offers its own GUID and its full extension set, as SUBWINDC4002 did when it bound to WINDC1 in the issue 19699 capture (0x3ffffb7f).

Then comes the request itself:

🔁 [00018] Frame 24 DRSUAPI DsGetNCChanges Request 2022-10-30T19:06:42.023569Z 💻 PC workstation → 🏢 DC domain controller
frame : Frame 24: Packet, 454 bytes on wire (3632 bits), 454 bytes captured (3632 bits) on interface \Device\NPF_{0CCC9DBC-B1C8-4DEF-B733-7A34F2894DF7}, id 0
Section number : 1
Interface id : 0 (\Device\NPF_{0CCC9DBC-B1C8-4DEF-B733-7A34F2894DF7})
Interface name : \Device\NPF_{0CCC9DBC-B1C8-4DEF-B733-7A34F2894DF7}
Interface description : Ethernet
Encapsulation type : Ethernet (1)
Arrival Time : Oct 31, 2022 00:36:42.023569000 India Standard Time
UTC Arrival Time : Oct 30, 2022 19:06:42.023569000 UTC
Epoch Arrival Time : 1667156802.023569000
Time shift for this packet : 0.000000000 seconds
Time delta from previous captured frame : 174.000 microseconds
Time delta from previous displayed frame : 174.000 microseconds
Time since reference or first frame : 5.306000 milliseconds
Frame Number : 24
Frame Length : 454 bytes (3632 bits)
Capture Length : 454 bytes (3632 bits)
Frame is marked : False
Frame is ignored : False
Protocols in frame : eth:ethertype:ip:tcp:dcerpc
Character encoding : ASCII (0)
eth : Ethernet II, Src: 00:15:5d:00:02:1d, Dst: 00:15:5d:00:02:1f
Destination : 00:15:5d:00:02:1f
Destination (resolved) : 00:15:5d:00:02:1f
Destination OUI : 00:15:5d (Microsoft Corporation)
Destination OUI (resolved) : Microsoft Corporation
.... ..0. .... .... .... .... = LG bit : Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Address : 00:15:5d:00:02:1f
Address (resolved) : 00:15:5d:00:02:1f
Address OUI : 00:15:5d (Microsoft Corporation)
Address OUI (resolved) : Microsoft Corporation
.... ..0. .... .... .... .... = LG bit : Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Source : 00:15:5d:00:02:1d
Source (resolved) : 00:15:5d:00:02:1d
Source OUI : 00:15:5d (Microsoft Corporation)
Source OUI (resolved) : Microsoft Corporation
.... ..0. .... .... .... .... = LG bit : Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Address : 00:15:5d:00:02:1d
Address (resolved) : 00:15:5d:00:02:1d
Address OUI : 00:15:5d (Microsoft Corporation)
Address OUI (resolved) : Microsoft Corporation
.... ..0. .... .... .... .... = LG bit : Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit : Individual address (unicast)
Type : IPv4 (0x0800)
Stream index : 0
ip : Internet Protocol Version 4, Src: 10.0.0.20, Dst: 10.0.0.10
0100 .... = Version : 4
.... 0101 = Header Length : 20 bytes (5)
Differentiated Services Field : 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint : Default (0)
.... ..00 = Explicit Congestion Notification : Not ECN-Capable Transport (0)
Total Length : 440
Identification : 0x1112 (4370)
010. .... = Flags : 0x2, Don't fragment
0... .... = Reserved bit : Not set
.1.. .... = Don't fragment : Set
..0. .... = More fragments : Not set
...0 0000 0000 0000 = Fragment Offset : 0
Time to Live : 128
Protocol : TCP (6)
Header Checksum : 0xd410 [validation disabled]
Header checksum status : Unverified
Source Address : 10.0.0.20
Source or Destination Address : 10.0.0.20
Source Host : 10.0.0.20
Source or Destination Host : 10.0.0.20
Destination Address : 10.0.0.10
Source or Destination Address : 10.0.0.10
Destination Host : 10.0.0.10
Source or Destination Host : 10.0.0.10
Stream index : 0
tcp : Transmission Control Protocol, Src Port: 49943, Dst Port: 49667, Seq: 957, Ack: 2569, Len: 400
Source Port : 49943
Destination Port : 49667
Source or Destination Port : 49943
Source or Destination Port : 49667
Stream index : 1
Stream Packet Number : 17
Conversation completeness : Complete, WITH_DATA (47)
..1. .... = RST : Present
...0 .... = FIN : Absent
.... 1... = Data : Present
.... .1.. = ACK : Present
.... ..1. = SYN-ACK : Present
.... ...1 = SYN : Present
Completeness Flags : R·DASS
TCP Segment Len : 400
Sequence Number : 957 (relative sequence number)
Sequence Number (raw) : 809353871
Next Sequence Number : 1357 (relative sequence number)
Acknowledgment Number : 2569 (relative ack number)
Acknowledgment number (raw) : 4048644572
0101 .... = Header Length : 20 bytes (5)
Flags : 0x018 (PSH, ACK)
000. .... .... = Reserved : Not set
...0 .... .... = Accurate ECN : Not set
.... 0... .... = Congestion Window Reduced : Not set
.... .0.. .... = ECN-Echo : Not set
.... ..0. .... = Urgent : Not set
.... ...1 .... = Acknowledgment : Set
.... .... 1... = Push : Set
.... .... .0.. = Reset : Not set
.... .... ..0. = Syn : Not set
.... .... ...0 = Fin : Not set
TCP Flags : ·······AP···
Window : 1025
Calculated window size : 262400
Window size scaling factor : 256
Checksum : 0xb3c2 [unverified]
Checksum Status : Unverified
Urgent Pointer : 0
Timestamps
Time since first frame in this TCP stream : 3.253000 milliseconds
Time since previous frame in this TCP stream : 174.000 microseconds
SEQ/ACK analysis
This is an ACK to the segment in frame : 23
The RTT to ACK the segment was : 174.000 microseconds
iRTT : 145.000 microseconds
Bytes in flight : 400
Bytes sent since last PSH flag : 400
Client Contiguous Streams : 1
Server Contiguous Streams : 1
TCP payload (400 bytes)
PDU Size : 400
dcerpc : Distributed Computing Environment / Remote Procedure Call (DCE/RPC) Request, Fragment: Single, FragLen: 400, Call: 6, Ctx: 0, [Resp: #25]
Version : 5
Version (minor) : 0
Packet type : Request (0)
Packet Flags : 0x03
0... .... = Object : Not set
.0.. .... = Maybe : Not set
..0. .... = Did Not Execute : Not set
...0 .... = Multiplex : Not set
.... 0... = Reserved : Not set
.... .0.. = Cancel Pending : Not set
.... ..1. = Last Frag : Set
.... ...1 = First Frag : Set
Data Representation : 10000000 (Order: Little-endian, Char: ASCII, Float: IEEE)
Byte order : Little-endian (1)
Character : ASCII (0)
Floating-point : IEEE (0)
Frag Length : 400
Auth Length : 16
Call ID : 6
Alloc hint : 352
Context ID : 0
Opnum : 3
Response in frame : 25
Encrypted stub data […] : 14ced09dcb6f31588a3581cb1a284063c03692609bc4f37218382471083473697f692fce741f05e521259607d79f8902e6bd98dadf916f7e08a12abc8758d7e4e07cfab2c63d59097d858aebba1b5e05edc2124c816c8f8bc1f3a21bb95b1d6bbb79933b508651a9870f
Complete stub data (352 bytes)
Payload stub data (352 bytes)
Auth Info : NTLMSSP, Packet privacy, AuthContextId(0)
Auth type : NTLMSSP (10)
Auth level : Packet privacy (6)
Auth pad len : 0
Auth Rsrvd : 0
Auth Context ID : 0
NTLMSSP Verifier
Version Number : 1
Verifier Body : 1aab20608b96385504000000
drsuapi : Active Directory Replication, DsGetNCChanges
Operation : DsGetNCChanges (3)
Response in frame : 25
Pointer to Bind Handle (policy_handle)
Policy Handle
Bind Handle : 00000000176efede6460f84b81602cd896f611c4
Level : 8
Pointer to Req (drsuapi_DsGetNCChangesRequest)
drsuapi_DsGetNCChangesRequest
Req
Req8
Destination Dsa Guid : 3a2a6e1a-1701-45d7-8771-b5dd5a305c46
Source Dsa Invocation Id : 00000000-0000-0000-0000-000000000000
Pointer to Naming Context (drsuapi_DsReplicaObjectIdentifier)
Referent ID : 0x00020000
Naming Context
Ndr Size : 0
Ndr Size Sid : 0
Guid : 2640eac5-0fb7-4550-99da-cc3d97649a28
Sid : S-0-0
Revision : 0
Num Auth : 0
Authority : 0
Subauthorities
Ndr Size Dn : 0
Max Count : 1
Dn : 0
Highwatermark
Tmp Highest Usn : 0
Reserved Usn : 0
Highest Usn : 0
NULL Pointer : Pointer to Uptodateness Vector (drsuapi_DsReplicaCursorCtrEx)
Replica Flags […] : 0x00288030, DRSUAPI DRS WRIT REP: DRSUAPI_DRS_WRIT_REP is SET, DRSUAPI DRS INIT SYNC: DRSUAPI_DRS_INIT_SYNC is SET, DRSUAPI DRS FULL SYNC NOW: DRSUAPI_DRS_FULL_SYNC_NOW is SET, DRSUAPI DRS SYNC URGENT: DRSUAPI_DRS_SYNC
.... .... .... .... .... .... .... ...0 = DRSUAPI DRS ASYNC OP : DRSUAPI_DRS_ASYNC_OP is NOT SET
.... .... .... .... .... .... .... ..0. = DRSUAPI DRS GETCHG CHECK : DRSUAPI_DRS_GETCHG_CHECK is NOT SET
.... .... .... .... .... .... .... .0.. = DRSUAPI DRS ADD REF : DRSUAPI_DRS_ADD_REF is NOT SET
.... .... .... .... .... .... .... 0... = DRSUAPI DRS SYNC ALL : DRSUAPI_DRS_SYNC_ALL is NOT SET
.... .... .... .... .... .... ...1 .... = DRSUAPI DRS WRIT REP : DRSUAPI_DRS_WRIT_REP is SET
.... .... .... .... .... .... ..1. .... = DRSUAPI DRS INIT SYNC : DRSUAPI_DRS_INIT_SYNC is SET
.... .... .... .... .... .... .0.. .... = DRSUAPI DRS PER SYNC : DRSUAPI_DRS_PER_SYNC is NOT SET
.... .... .... .... .... .... 0... .... = DRSUAPI DRS MAIL REP : DRSUAPI_DRS_MAIL_REP is NOT SET
.... .... .... .... .... ...0 .... .... = DRSUAPI DRS ASYNC REP : DRSUAPI_DRS_ASYNC_REP is NOT SET
.... .... .... .... .... ..0. .... .... = DRSUAPI DRS TWOWAY SYNC : DRSUAPI_DRS_TWOWAY_SYNC is NOT SET
.... .... .... .... .... .0.. .... .... = DRSUAPI DRS CRITICAL ONLY : DRSUAPI_DRS_CRITICAL_ONLY is NOT SET
.... .... .... .... .... 0... .... .... = DRSUAPI DRS GET ANC : DRSUAPI_DRS_GET_ANC is NOT SET
.... .... .... .... ...0 .... .... .... = DRSUAPI DRS GET NC SIZE : DRSUAPI_DRS_GET_NC_SIZE is NOT SET
.... .... .... .... ..0. .... .... .... = DRSUAPI DRS NONGC RO REP : DRSUAPI_DRS_NONGC_RO_REP is NOT SET
.... .... .... .... .0.. .... .... .... = DRSUAPI DRS SYNC BYNAME : DRSUAPI_DRS_SYNC_BYNAME is NOT SET
.... .... .... .... 1... .... .... .... = DRSUAPI DRS FULL SYNC NOW : DRSUAPI_DRS_FULL_SYNC_NOW is SET
.... .... .... ...0 .... .... .... .... = DRSUAPI DRS FULL SYNC IN PROGRESS : DRSUAPI_DRS_FULL_SYNC_IN_PROGRESS is NOT SET
.... .... .... ..0. .... .... .... .... = DRSUAPI DRS FULL SYNC PACKET : DRSUAPI_DRS_FULL_SYNC_PACKET is NOT SET
.... .... .... .0.. .... .... .... .... = DRSUAPI DRS SYNC REQUEUE : DRSUAPI_DRS_SYNC_REQUEUE is NOT SET
.... .... .... 1... .... .... .... .... = DRSUAPI DRS SYNC URGENT : DRSUAPI_DRS_SYNC_URGENT is SET
.... .... ...0 .... .... .... .... .... = DRSUAPI DRS REF GCSPN : DRSUAPI_DRS_REF_GCSPN is NOT SET
.... .... ..1. .... .... .... .... .... = DRSUAPI DRS NEVER SYNCED : DRSUAPI_DRS_NEVER_SYNCED is SET
.... .... .0.. .... .... .... .... .... = DRSUAPI DRS SPECIAL SECRET PROCESSING : DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING is NOT SET
.... .... 0... .... .... .... .... .... = DRSUAPI DRS INIT SYNC NOW : DRSUAPI_DRS_INIT_SYNC_NOW is NOT SET
.... ...0 .... .... .... .... .... .... = DRSUAPI DRS PREEMPTED : DRSUAPI_DRS_PREEMPTED is NOT SET
.... ..0. .... .... .... .... .... .... = DRSUAPI DRS SYNC FORCED : DRSUAPI_DRS_SYNC_FORCED is NOT SET
.... .0.. .... .... .... .... .... .... = DRSUAPI DRS DISABLE AUTO SYNC : DRSUAPI_DRS_DISABLE_AUTO_SYNC is NOT SET
.... 0... .... .... .... .... .... .... = DRSUAPI DRS DISABLE PERIODIC SYNC : DRSUAPI_DRS_DISABLE_PERIODIC_SYNC is NOT SET
...0 .... .... .... .... .... .... .... = DRSUAPI DRS USE COMPRESSION : DRSUAPI_DRS_USE_COMPRESSION is NOT SET
..0. .... .... .... .... .... .... .... = DRSUAPI DRS NEVER NOTIFY : DRSUAPI_DRS_NEVER_NOTIFY is NOT SET
.0.. .... .... .... .... .... .... .... = DRSUAPI DRS SYNC PAS : DRSUAPI_DRS_SYNC_PAS is NOT SET
0... .... .... .... .... .... .... .... = DRSUAPI DRS GET ALL GROUP MEMBERSHIP : DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP is NOT SET
Max Object Count : 1
Max Ndr Size : 10485760
Extended Op : DRSUAPI_EXOP_REPL_OBJ (0x00000006)
NDR-Padding : 00000000
Fsmo Info : 0
Pointer to Partial Attribute Set (drsuapi_DsPartialAttributeSet)
Referent ID : 0x00020004
Partial Attribute Set
Version : 1
Reserved1 : 0
Num Attids : 19
Max Count : 19
Attids : Unknown (0x00000001)
Attids : Unknown (0x000000dd)
Attids : Unknown (0x00000290)
Attids : Unknown (0x0000012e)
Attids : Unknown (0x00000008)
Attids : Unknown (0x0000009f)
Attids : Unknown (0x00000060)
Attids : Unknown (0x00000092)
Attids : Unknown (0x00000261)
Attids : Unknown (0x0000005a)
Attids : Unknown (0x0000005e)
Attids : Unknown (0x00000037)
Attids : Unknown (0x000000a0)
Attids : Unknown (0x0000007d)
Attids : Unknown (0x00000085)
Attids : Unknown (0x00000081)
Attids : Unknown (0x00000087)
Attids : Unknown (0x0000001b)
Attids : Unknown (0x00010030)
NULL Pointer : Pointer to Partial Attribute Set Ex (drsuapi_DsPartialAttributeSet)
Mapping Ctr
Num Mappings : 2
Pointer to Mappings (drsuapi_DsReplicaOIDMapping)
Referent ID : 0x00020008
Max Count : 2
Mappings
Id Prefix : 0
Oid
Length : 8
Pointer to Binary Oid (uint8)
Referent ID : 0x0002000c
Max Count : 8
Binary Oid : 42
Binary Oid : 134
Binary Oid : 72
Binary Oid : 134
Binary Oid : 247
Binary Oid : 20
Binary Oid : 1
Binary Oid : 4
Mappings
Id Prefix : 1
Oid
Length : 8
Pointer to Binary Oid (uint8)
Referent ID : 0x00020010
Max Count : 8
Binary Oid : 42
Binary Oid : 134
Binary Oid : 72
Binary Oid : 134
Binary Oid : 247
Binary Oid : 20
Binary Oid : 1
Binary Oid : 2
Rendered from a Wireshark PCAP by VisualEther.

Frame 24, the DCSync request, decrypted. DsGetNCChanges at request version 8: destination DSA GUID 3a2a6e1a… (the server's own), the DC$ object 2640eac5… in place of a naming context, USN watermark 0, replica flags 0x00288030, one object, extended operation DRSUAPI_EXOP_REPL_OBJ, and a partial attribute set of 19 attribute IDs encoded against the client's two-entry prefix table.

What does DsGetNCChanges return?

The DC answers 410 µs later with a version 6 reply (Ctr6): one object, 13 attributes, extended result DRSUAPI_EXOP_ERR_SUCCESS, more data 0, status WERR_OK, 5,590 bytes on the wire. The reply is not compressed, because the request did not ask for compression.

The 13 attributes are the ones that exist on a computer account. Five hold credentials: unicodePwd (the NT hash), ntPwdHistory, dBCSPwd (the LM hash), lmPwdHistory, and supplementalCredentials (the Kerberos keys). We redacted their values from the packet trees. The account belongs to a domain controller, so its keys are enough to forge Kerberos service tickets for that DC; pulled for krbtgt, the same call yields the key that signs every ticket in the domain.

[MS-DRSR] protects these values twice. The whole reply is sealed at packet privacy, and inside it each secret value is encrypted again with RC4, under a key made from the RPC session key and a random salt ([MS-DRSR] 4.1.10.5.11), so a sensor that strips only the outer layer still sees ciphertext.

The client spends 191 ms after the reply before it sends DsUnbind, the longest gap in the capture, and then resets both TCP connections. The first bind handle is never released.

Is replication traffic encrypted?

Yes. Both captures run DRSUAPI at authentication level 6, packet privacy, so every request and reply after the bind is encrypted, whether the login is Kerberos (real replication) or NTLM (this DCSync). Wireshark decrypts it only when given the keys: a password for NTLM, or a keytab for Kerberos. The Kerberos walkthrough shows how a keytab unlocks the tickets.

Without keys, a sensor still sees a lot, which is what network detection relies on:

How is DCSync different from real replication?

Real replication (issue 19699)DCSync (this capture)
CallerA domain controllerA workstation, PC
AccountAdministrator during promotion; afterward the DC's machine account, SUBWINDC4002$LAB\admin, a user
AuthenticationKerberos, packet privacyNTLMv1, packet privacy
DsBind client GUIDThe caller's own DSA GUIDNTDSAPI_CLIENT_GUID, then the server's DSA GUID
DsBind extensions0x3ffffb7f0x04008000
RequestVersion 10, whole NC, up to 1,000 objects, all attributesVersion 8, one object, 19 named attributes
Extended operationNone for NC rounds; REPL_OBJ only for its own configuration objectsREPL_OBJ on a credential-bearing account
Destination DSA GUIDThe caller's ownThe server's own
ReplyCompressed, 345 to 469 kB per roundUncompressed, 5.6 kB

One row needs care. DRSUAPI_EXOP_REPL_OBJ alone does not mean DCSync: while promoting, SUBWINDC4002 used it twice to pull single configuration objects, its partition's cross-reference and its own NTDS Settings object. What gives DCSync away is the combination: who asks, as which account, and for which object and attributes.

How do you detect DCSync?

Watch for replication requests from machines that are not domain controllers, on the network and in the domain controllers' security logs.

On the network:

  1. Keep a list of your domain controllers' addresses, and add the few legitimate replication clients, such as the Microsoft Entra Connect server.
  2. Alert on a DRSUAPI bind or a DsGetNCChanges call (opnum 3) from any other address. The interface UUID in the bind and the opnum in each request are readable without keys. Many network detection products and intrusion detection system (IDS) rule sets carry this rule.
  3. Note the account and the authentication type. NTLM to DRSUAPI, or a user account rather than a computer account ending in $, deserves a closer look even from an expected address.

On the domain controllers, Windows logs event 4662, "An operation was performed on an object", when Directory Service Access auditing is on and the domain object's audit list (SACL) covers the replication rights. The event's Properties field lists the GUIDs of the rights and property sets the operation used, and DCSync detection rules look there for the replication rights ([MS-ADTS] 6.1.1.2.7):

RightGUID
DS-Replication-Get-Changes1131f6aa-9c07-11d1-f79f-00c04fc2dcd2
DS-Replication-Get-Changes-All1131f6ad-9c07-11d1-f79f-00c04fc2dcd2
DS-Replication-Get-Changes-In-Filtered-Set89e95b76-444d-4c62-991a-0facbeda640c

Alert when the subject account is not a domain controller's machine account and not a known synchronization account. To match it with the network alert, join its logon ID to the logon event on the same DC (event 4624), which records the source address.

Finally, reduce who can do it: review which accounts hold the two replication rights on the domain, and treat those accounts with the same care as Domain Admins.

How to analyze DRSUAPI in Wireshark

FAQ

What is DRSUAPI used for? Replicating Active Directory between domain controllers, plus a few directory-service API calls such as name translation (DsCrackNames). Its replication call is DsGetNCChanges.

Does DCSync need code on the domain controller? No. It is a network request to the DC's replication interface, which is why the source address is the best network signal.

Which accounts can perform DCSync? Any account with DS-Replication-Get-Changes and DS-Replication-Get-Changes-All on the domain: by default Domain Admins, Enterprise Admins, Administrators, and the domain controllers, plus any service account granted them, such as Microsoft Entra Connect's.

Is DsGetNCChanges from a non-DC always an attack? No, but every one should be on your list. Microsoft Entra Connect and some identity and backup products replicate legitimately; list them, and alert on everything else.

Can a firewall block DCSync? Partly. Allowing RPC to domain controllers only from the hosts that need it shrinks the exposure, but clients need RPC to DCs for other services, so the rights review and the alerts above still matter.

Takeaways

  1. DCSync is replication, not an exploit. One DsGetNCChanges call from an account with the replication rights returns password hashes.
  2. The source is the strongest signal. Real replication comes from domain controllers; this request came from a workstation.
  3. The account and login type follow. A user over NTLM, not a DC machine account over Kerberos with the replication SPN.
  4. The request imitates a DC, imperfectly. The server's own DSA GUID as both bind identity and destination, two extension bits instead of a DC's full set, one object, and 19 named secret-bearing attributes.
  5. EXOP_REPL_OBJ alone is not proof. DCs use it too; combine it with the caller and the object.
  6. Encryption hides the contents, not the call. The EPM lookup, bind, opnum, account, and sizes stay visible; event 4662 with the replication right GUIDs covers the host side.