Skip to main content
Mallory
HighCISA KEVExploited in the wildPublic exploit

NoPac / sAMAccountName Spoofing in Active Directory Domain Services

IdentifiersCVE-2021-42278CWE-20Also known asnopac

CVE-2021-42278 is an Active Directory Domain Services elevation-of-privilege vulnerability in Microsoft Windows Server, commonly referred to as the sAMAccountName Spoofing component of the NoPac attack chain. The flaw allows manipulation of an account's sAMAccountName in a way that can be abused against Active Directory/Kerberos workflows. In the provided reporting, CVE-2021-42278 is repeatedly described together with CVE-2021-42287, where an attacker renames or spoofs a computer account and then leverages Kerberos behavior to obtain a ticket associated with a domain controller computer account. When chained with CVE-2021-42287, this can let a low-privileged domain user impersonate a domain controller and effectively escalate to domain administrator-level privileges.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

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

By itself, CVE-2021-42278 is an elevation-of-privilege issue in Active Directory. In practical exploitation described in the supplied sources, it is primarily impactful when combined with CVE-2021-42287. The chain can allow an attacker with only low-privileged domain credentials to obtain a Kerberos service ticket for a domain controller computer account, impersonate a domain controller, and escalate to full domain compromise. This enables takeover of the Active Directory environment, including administrative control over the domain controller and downstream lateral movement, credential access, and ransomware deployment.

Mitigation

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

If immediate patching is not possible, reduce exploitability by setting the default MachineAccountQuota for standard users to 0 where operationally feasible, since the provided reporting identifies a machine account quota greater than zero as a requirement in observed exploitation. Monitor domain controller security logs for suspicious account creation, password reset, account change, and rename activity, especially Event IDs 4741, 4724, 4742, 4781, 4768, 4673, and 5156 as referenced in the supplied material. Detect sequences where a renamed computer account rapidly requests a Kerberos TGT, and investigate suspicious activity originating from recently compromised edge systems such as VPN appliances.

Remediation

Patch, then assume compromise.

Apply Microsoft's security updates released for CVE-2021-42278 and the related CVE-2021-42287 on all domain controllers. The supplied content specifically emphasizes verifying that every domain controller is patched, because successful exploitation requires at least one unpatched domain controller. Organizations should also review Active Directory hardening guidance and validate that post-patch behavior is consistent across the domain.
PUBLIC EXPLOITS

Exploits

6 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos (5 hidden).

VALID 6 / 11 TOTALView more in app
noPacMaturityPoCVerified exploit

This 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.

waterrrDisclosed Dec 13, 2021pythonnetwork
noPacMaturityPoCVerified exploit

This 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.

cube0x0Disclosed Dec 11, 2021csharpnetwork
PachineMaturityPoCVerified exploit

This repository contains a Python exploit (pachine.py) for CVE-2021-42278, a privilege escalation vulnerability in Microsoft Active Directory. The exploit leverages a flaw in the way sAMAccountName is handled during Kerberos authentication, allowing an attacker with domain user credentials to create a machine account with a name matching a domain controller (minus the trailing '$'), obtain a TGT, rename the account, and then impersonate privileged users (such as the domain administrator) via S4U2Self. The resulting Kerberos ticket can be used for pass-the-ticket attacks, enabling remote code execution as SYSTEM on the domain controller. The repository is structured with a single main code file (pachine.py), a README with detailed usage instructions and examples, and standard project files (.gitignore, LICENSE). The exploit requires network access to the DC and valid domain credentials, and is operational with a functional payload that automates the attack chain. No hardcoded endpoints are present, but the tool requires the attacker to specify the target DC's FQDN or IP address.

ly4kDisclosed Dec 13, 2021pythonnetwork
noPacMaturityPoCVerified exploit

This 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+).

TryA9ainDisclosed Dec 22, 2022csharpnetwork
sam-the-adminMaturityPoCVerified exploit

This 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.

safebufferDisclosed Dec 11, 2021pythonnetwork
noPacMaturityPoCVerified exploit

This 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.

RidterDisclosed Dec 13, 2021pythonnetwork
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

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

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, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence1

Every observed campaign linking this CVE to a named adversary.

Associated malware2

Malware families riding this exploit, with evidence and IOCs.

Detection signatures1

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity

Community discussion across Reddit, Mastodon, and other social sources.