Update September 28, 2020: Researcher Kevin Beaumont further confirmed active exploitation of CVE-2020-1472. CISA disseminated a patch validation script (developed by Microsoft) last week to aid security teams in detecting unpatched domain controllers.
Update September 23, 2020: Microsoft has confirmed that Zerologon is being exploited in the wild. Defenders should ensure that systems, especially domain controllers, are patched and not exposed on the internet. CISA also issued an emergency directive last week.
Update September 16, 2020: Samba domain controllers before 4.8 have been confirmed to be vulnerable to CVE-2020-1472. There are reports of the vulnerability’s being actively exploited in the wild, including to spread ransomware. The maintainer of popular post-exploitation tool Mimikatz has also announced a new release of the tool that integrates Zerologon detection and exploitation support. Microsoft customers with affected Windows Server versions are once again urged to apply the patch for CVE-2020-1472 on an emergency basis.
Update September 15, 2020: There are now multiple public PoC exploits available, most if not all of which are modifications to Secura’s original PoC built on Impacket. There’s also at least one report that Samba may be affected by the vulnerability; we have not verified that information independently. Several threads on exploitation traces and community detection rules have also garnered attention from researchers and security engineers.
Description
On Monday, September 14, security firm Secura published a detailed technical paper on CVE-2020-1472, a vulnerability they dubbed “Zerologon.” The vulnerability, which was partially patched in Microsoft’s August 2020 Patch Tuesday release, is an elevation of privilege in Netlogon, a Windows Server process that authenticates users and other services within a domain. The bug makes use of a weak cryptographic algorithm in Netlogon’s authentication process to allow full takeover of Active Directory domains by compromising Windows Servers running as domain controllers. In Secura’s words, the bug allows “an attacker with a foothold on your internal network to essentially become Domain Admin with one click. All that is required is for a connection to the Domain Controller to be possible from the attacker’s viewpoint.” This RPC connection can be made either directly or over SMB via namedpipes. CVE-2020-1472 carries a CVSSv3 base score of 10.
Secura’s blog includes proof-of-concept (PoC) code that uses the popular Impacket library to determine if a target is vulnerable to Zerologon. While Secura reinforced on GitHub that “the script will immediately terminate when successfully performing the bypass, and [will] not perform any Netlogon operations,” the PoC is easily weaponizable to execute operations past a mere check. Rapid7 researchers recommend that organizations that have not already applied the August 11, 2020 security updates patch on an emergency basis due to the severity of the vulnerability, the availability of an easily weaponizable PoC, and the ease of exploitation.
Additional information from Microsoft’s August 2020 advisory:
CVE-2020-1472 is an elevation of privilege vulnerability that exists when an attacker establishes a vulnerable Netlogon secure channel connection to a domain controller using Microsoft’s Netlogon Remote Protocol (MS-NRPC). An attacker who successfully exploited the vulnerability could run a specially crafted application on a device on the network. To exploit the vulnerability, an unauthenticated attacker would be required to use MS-NRPC to connect to a domain controller to obtain domain administrator access. Microsoft is addressing the vulnerability in a phased two-part rollout. These updates address the vulnerability by modifying how Netlogon handles the usage of Netlogon secure channels.
Affected products
- Windows Server 2008 R2 for x64-based Systems Service Pack 1
- Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)
- Windows Server 2012
- Windows Server 2012 (Server Core installation)
- Windows Server 2012 R2
- Windows Server 2012 R2 (Server Core installation)
- Windows Server 2016
- Windows Server 2016 (Server Core installation)
- Windows Server 2019
- Windows Server 2019 (Server Core installation)
- Windows Server, version 1903 (Server Core installation)
- Windows Server, version 1909 (Server Core installation)
- Windows Server, version 2004 (Server Core installation)
Rapid7 analysis
Vulnerabilities affecting authentication mechanisms or cryptographic implementations are often severe as a matter of course. News outlet ZDNet characterizes Zerologon in particular as “one of the most severe vulnerabilities ever reported to the company [Microsoft].” It’s difficult to disagree; exploitation by advanced and commodity threat actors is likely to occur very quickly—we would expect to see activity within a day or two—and the vulnerability offers ransomware groups an opportunity to leverage a foothold on the network to infect other hosts with relative ease.
Zerologon arises from a flaw in the cryptographic implementation of the Netlogon protocol, specifically in its usage of AES-CFB8 encryption. Technically, a null Initialization Vector (IV) is the crux of the problem: Secura’s paper notes that “the ComputeNetlogonCredential function…defines that this IV is fixed and should always consist of 16 zero bytes. This violates the requirements for using AES-CFB8 securely: its security properties only hold when IVs are random.”
In AES-CFB8, when a null IV is combined with a chosen plaintext, given a random key, the ciphertext can be predictable/controllable: “[…] for 1 in 256 keys, applying AES-CFB8 encryption to an all-zero plaintext will result in all-zero ciphertext.” The consequence of this is that an attacker can bypass Netlogon authentication using CVE-2020-1472 and impersonate any computer account. Once authenticated, the attacker can leverage Netlogon functionality to set an empty password (among other things) for any computer in the domain, including the domain controller.
It’s worth noting that the password is changed only in Active Directory, so the local registry-backed password is out of sync with the domain’s—causing a potential lockout scenario. The attacker can address this temporary hurdle by manually restoring the value to the original from Active Directory after recovering it from the NTDS.dit file, such as by using Impacket’s tool.
A number of researchers have published detection information and alerting guidance. Exploitation of CVE-2020-1472 that results in a password change will show as event ID 4742, Password last set change, performed by Anonymous Logon. To detect DCSync usage, look for event ID 4662 containing the GUID {1131f6ad-9c07-11d1-f79f-00c04fc2dcd2}, which is the DS-Replication-Get-Changes-All extended right required for replication. Any replication from a non Domain Controller is suspicious. (Source: NCC Group).
Guidance
Organizations that have not already applied Microsoft’s August 11, 2020 security updates should patch CVE-2020-1472 on an emergency basis. Microsoft customers who have successfully updated can deploy Domain Controller (DC) enforcement mode—either immediately or after the Q1 2021 update. Microsoft has guidance here on how to manage changes in Netlogon secure channel connections associated with this vulnerability. Organizations are strongly advised to ensure that servers acting as domain controllers are not exposed to the public internet, and to apply the principle of least privilege to all systems and services.
CISA recommends that security teams use their patch validation script (developed by Microsoft) to detect unpatched domain controllers in their organization’s environment. The script is written in PowerShell and is designed to be run on a domain controller. Please consult the script’s README.md for a full list of requirements.
References
- https://www.secura.com/blog/zero-logon
- https://www.secura.com/pathtoimg.php?id=2055
- https://blog.rapid7.com/2020/09/14/cve-2020-1472-zerologon-critical-privilege-escalation/
- https://www.zdnet.com/article/zerologon-attack-lets-hackers-take-over-enterprise-networks/
- https://github.com/SecuraBV/CVE-2020-1472
- https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2020-1472



