Skip to main content
Mallory
HighExploited in the wildCISA KEVPublic exploitVulnerability

CVE-2021-42287: Active Directory Kerberos Domain Controller Impersonation (noPac component)

Published Nov 10, 2021 · Updated 13 days ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 days1 mention · peak 1 in a dayToday
CVSS8.8High · v3.1
EPSS77.2%100th percentile
CISA KEVYesAdded Apr 11, 2022
In the wildActivePer CISA KEV
Vendor
Microsoft Corporation
IdentifiersCVE-2021-42287CWE-269

CVE-2021-42287 is an elevation-of-privilege vulnerability in Microsoft Windows Active Directory Domain Services involving Kerberos account resolution and Privilege Attribute Certificate (PAC) validation. When processing a service-ticket request, a vulnerable Key Distribution Center can resolve a nonexistent account name to a computer account by appending a trailing dollar sign, without adequately binding the requesting identity to the resolved account. Chained with the sAMAccountName spoofing vulnerability CVE-2021-42278, this behavior enables domain-controller impersonation and escalation from a low-privileged domain account to domain-administrator privileges. The combined attack is known as noPac or sam-the-admin.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation of the noPac chain can compromise an entire Active Directory domain. Resulting privileges can enable credential extraction through DCSync, unauthorized permission and account changes, lateral movement, persistent privileged access, sensitive-data theft, and deployment of malware or ransomware across domain systems.

Mitigation

If you can’t patch tonight, do this now.

Restrict ordinary users' ability to create or join computer accounts, including setting MachineAccountQuota to zero where operationally appropriate, and limit delegated permissions to modify computer-account names. These restrictions reduce exposure to the common noPac chain but do not replace patching, particularly if an attacker already controls a suitable computer account. Monitor unexpected computer-account creation and rapid sAMAccountName changes, especially names resembling domain controllers without a trailing dollar sign, and correlate these changes with suspicious Kerberos ticket activity.

Remediation

Patch, then assume compromise.

Apply Microsoft security updates addressing CVE-2021-42287 and CVE-2021-42278 to every domain controller, including applicable subsequent fixes or superseding cumulative updates. Microsoft initially released fixes on November 9, 2021, with a related out-of-band update on November 14, 2021. Follow the PAC authentication-hardening and enforcement guidance in KB5008380. The CVE-2021-42287 fix introduces PAC_REQUESTOR_SID information and validation during service-ticket processing. Leaving a domain controller unpatched can preserve an exploitable path.

Public exploits

Exploits

6 exploits validated by Mallory's analysis. Hidden: 5 rejected by Mallory's analysis as not a working exploit.

View more in app →
sam-the-adminThis repository is a Python-based exploit chain targeting Microsoft Active Directory environments vulnerable to CVE-2021-42278 and CVE-2021-42287. The main script, 'sam_the_admin.py', orchestrates the attack by creating a new computer account, renaming its sAMAccountName to match a Domain Controller, obtaining a Kerberos TGT as the DC, and then using S4U2self/S4U2proxy to impersonate a Domain Admin. The exploit leverages impacket and related libraries for LDAP and Kerberos operations. After successful exploitation, the attacker can use impacket-smbexec to obtain a shell or impacket-secretsdump to extract secrets from the DC. The code is modular, with helper scripts in the 'utils' directory handling LDAP, Kerberos, and SAMR operations. The exploit is operational and provides a practical attack path for privilege escalation from a standard domain user to Domain Admin in unpatched environments.safebuffer · Disclosed Dec 11, 2021 · python · networkOperationalnoPacThis repository is a C# implementation of the 'noPac' exploit, targeting the combination of CVE-2021-42287 and CVE-2021-42278 in Microsoft Active Directory Domain Controllers. The exploit enables a low-privileged domain user to escalate privileges to Domain Admin by abusing flaws in the Kerberos protocol and Active Directory object management. The codebase is structured as a Visual Studio solution with a main entry point in 'noPac/Program.cs'. Supporting libraries handle ASN.1 parsing, Kerberos protocol operations, LDAP manipulation, cryptographic operations, and ticket forging. The exploit works by creating a new machine account, manipulating its attributes via LDAP, requesting Kerberos tickets (TGTs) for the new account, and then leveraging S4U (Service for User) functionality to impersonate privileged accounts. The tool communicates with Domain Controllers over standard ports (TCP 88 for Kerberos, TCP 389 for LDAP, and TCP 464 for kpasswd). The repository is mature and operational, providing a full exploit chain rather than just a proof of concept. It is not part of a larger exploitation framework but is a standalone tool. The README and code comments credit prior research and tools such as Rubeus and SharpMad, and recommend patching Domain Controllers to mitigate the vulnerabilities.cube0x0 · Disclosed Dec 11, 2021 · csharp · networkOperationalnoPacThis repository is a Python-based exploit for chaining CVE-2021-42278 and CVE-2021-42287 against Microsoft Active Directory Domain Controllers. The main exploit logic is in 'exp.py', which automates the attack chain: it creates a new computer account, renames it to impersonate the DC, obtains Kerberos tickets as a privileged user, and then uses these tickets to either execute commands (via 'smbexec.py') or dump password hashes (via 'secretsdump.py'). Supporting modules in the 'utils' directory handle Kerberos ticket requests, LDAP operations, and computer account management. The exploit is operational and provides both shell access and credential dumping capabilities if the target is vulnerable. The attack is performed over the network and targets the DC's IP address, requiring valid domain credentials and network access to the DC. The repository is structured with a clear separation between the main exploit, supporting scripts, and utility modules.waterrr · Disclosed Dec 13, 2021 · python · networkOperationalnoPacThis repository is a C# implementation of the 'noPac' exploit, which targets a combination of two critical Active Directory vulnerabilities: CVE-2021-42278 (sAMAccountName spoofing) and CVE-2021-42287 (KDC confusion). The exploit allows an attacker with domain user credentials to escalate privileges to domain admin by manipulating machine accounts and Kerberos tickets. The codebase is structured as a Visual Studio solution with a main entry point in 'noPac/Program.cs', and supporting libraries for Kerberos protocol manipulation, ASN.1 parsing, cryptography, and ticket forging. The exploit works by creating or modifying a machine account, requesting a TGT as that account, and then leveraging the vulnerabilities to obtain a TGT for the domain controller. The attacker can then use Pass-the-Ticket (PTT) to inject the ticket and gain access to domain resources as a privileged user. The repository is operational and provides a working exploit, not just a proof of concept. It is not part of a larger exploitation framework, but is a standalone tool. The code is well-structured and modular, with clear separation between Kerberos protocol logic, cryptographic operations, and exploit orchestration. The README provides detailed usage instructions and example commands, as well as environmental requirements (Windows, .NET 4.0+).TryA9ain · Disclosed Dec 22, 2022 · csharp · networkOperationalnoPacThis repository is a standalone Go implementation of the noPac Active Directory exploit chain targeting CVE-2021-42278 and CVE-2021-42287. It is not part of a larger exploit framework. The repository is small and focused: `main.go` orchestrates argument parsing, client setup, exploitation flow, and optional shell launch; `exploit.go` contains the core abuse primitives; `recon.go` performs LDAP reconnaissance needed to identify MachineAccountQuota and optionally discover a domain controller; `utils.go` provides random name/password generation and UTF-16LE encoding for LDAP password changes. `README.md` documents usage and flags. Core capability: the tool authenticates as a low-privileged domain user, connects to LDAP/LDAPS and SMB on the target/DC, binds to the SAMR RPC interface over the SMB named pipe `samr`, creates a new computer account, resets its password via LDAP `unicodePwd`, changes the computer object's `sAMAccountName` to match the domain controller hostname, requests a Kerberos TGT for that spoofed identity, restores the original machine name, and then requests an S4U2self service ticket for `cifs/<dcfqdn>` while impersonating an arbitrary user. The resulting Kerberos tickets are saved as ccache files and can be reused. If the `-shell` flag is set, the tool launches `impacket-smbexec` with Kerberos authentication to obtain remote command execution over SMB as the impersonated account. Fingerprintable network behavior includes LDAP on TCP/389 or LDAPS on TCP/636, SMB on TCP/445, SAMR RPC over the `samr` named pipe, LDAP searches for `ms-DS-MachineAccountQuota` and domain controller computer objects, and Kerberos ticket requests against the domain controller. The exploit writes local ccache files named after the spoofed machine and impersonated user. There is no cleanup logic implemented, which aligns with the README note that cleanup is absent. Overall, this is a real, operational exploit for AD privilege escalation/impersonation rather than a detector or placeholder PoC.xLTJ · Disclosed Jul 7, 2026 · go · markdown · network · webOperationalnoPacThis repository is a Python-based exploit toolkit targeting Microsoft Active Directory environments vulnerable to CVE-2021-42278 and CVE-2021-42287. The main exploit script is `noPac.py`, which chains these vulnerabilities to escalate privileges from a standard domain user to Domain Admin by manipulating computer account attributes and abusing Kerberos delegation (S4U2Self/S4U2Proxy). The toolkit allows attackers to: - Add or rename computer accounts in the domain (abusing MachineAccountQuota or CreateChild permissions) - Request Kerberos service tickets as privileged users (impersonation) - Dump domain hashes (NTDS.dit) using secretsdump techniques - Obtain a remote shell on the domain controller via SMB (smbexec) The repository includes supporting modules for LDAP/Kerberos operations, computer account management, hash dumping, and remote command execution. There is also a `scanner.py` script for vulnerability detection. The exploit is operational and provides real post-exploitation capabilities, including hash extraction and shell access. The code is modular, leveraging Impacket and ldapdomaindump libraries, and is intended for use in penetration testing or red teaming against unpatched Windows AD environments.Ridter · Disclosed Dec 13, 2021 · python · networkPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Microsoft CorporationWindows Server 2004operating_system
Microsoft CorporationWindows Server 2008operating_system
Microsoft CorporationWindows Server 2008 R2operating_system
Microsoft CorporationWindows Server 2008 Sp2operating_system
Microsoft CorporationWindows Server 2012operating_system
Microsoft CorporationWindows Server 2012 R2operating_system
Microsoft CorporationWindows Server 2016operating_system
Microsoft CorporationWindows Server 2019operating_system
Microsoft CorporationWindows Server 2022operating_system
Microsoft CorporationWindows Server 20h2operating_system
FAQ

Frequently asked questions

Is CVE-2021-42287 exploited in the wild?
Yes. As of Nov 9, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Apr 11, 2022.
Is there a public exploit for CVE-2021-42287?
Yes. Mallory tracks 6 public exploits or proofs of concept for CVE-2021-42287, the earliest disclosed Dec 11, 2021.
Is there a patch for CVE-2021-42287?
Apply Microsoft security updates addressing CVE-2021-42287 and CVE-2021-42278 to every domain controller, including applicable subsequent fixes or superseding cumulative updates. Microsoft initially released fixes on November 9, 2021, with a related out-of-band update on November 14, 2021.
What products are affected by CVE-2021-42287?
Microsoft Corporation Windows Server 2004, Microsoft Corporation Windows Server 2008, Microsoft Corporation Windows Server 2008 R2, Microsoft Corporation Windows Server 2008 Sp2, Microsoft Corporation Windows Server 2012, and 5 more.
How severe is CVE-2021-42287?
CVE-2021-42287 has a CVSS v3.1 score of 8.8 (High) and an EPSS score of 77.2% (100th percentile) as of Nov 9, 2026.
Activity feed

Recent activity

27 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.

View more in app →
+20 more in the timeline. Sign up to see them
Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidence3Every report linking this CVE to a named adversary.
Associated malware6Malware families linked to this CVE, with evidence and IOCs.
Detection signatures3YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activity2Community discussion across Reddit, Mastodon, and other social sources.