Join our Newsletter — 33% off our NHI Course
Home› Guides› noPac (sAMAccountName Spoofing) Defence Guide: patch, harden and…
Guide Identity Visibility, Posture & Threat Detection

noPac (sAMAccountName Spoofing) Defence Guide: patch, harden and detect it in Active Directory

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 14 min read
On this page

noPac turns any ordinary domain user into a domain administrator in minutes when domain controllers are unpatched and users can create computer accounts. The name covers two Active Directory flaws disclosed together in November 2021, CVE-2021-42278 and CVE-2021-42287, which chain a computer account rename with a Kerberos lookup weakness so that the domain controller issues a ticket for itself to the attacker. Both CVEs are in the CISA Known Exploited Vulnerabilities catalogue with known ransomware use. This guide is for AD administrators and Windows SOC analysts: it explains the chain at defence level, confirms the Microsoft updates and their enforcement phases, shows how to remove the precondition with ms-DS-MachineAccountQuota, and lists the events that reveal an attempt. It does not cover exploit tooling.

Key takeaways

  • Two flaws, one chain: CVE-2021-42278 let a non-administrator give a computer account a name without the trailing $, and CVE-2021-42287 let the KDC resolve that name to a domain controller when issuing a service ticket.
  • Patching closes it, enforcement proves it: the November 9, 2021 updates (KB5008102 and KB5008380) fix both CVEs, and the KDC moved to Enforcement mode on all domain controllers with the October 11, 2022 updates.
  • Remove the precondition anyway: setting ms-DS-MachineAccountQuota to 0 stops ordinary users creating computer accounts, which noPac, Certifried and several relay attacks all rely on.
  • Rename events are the signal: event 4781 and the SAM Account Name field of 4742 show a computer account renamed to a name without $, and KDC event 38 flags a ticket whose requestor no longer matches Active Directory.
  • Every domain controller counts: a single unpatched or rebuilt-from-old-media domain controller keeps the forest exposed, so verify build levels across all writable and read-only DCs, not a sample.

What noPac is

noPac is the community name for chaining CVE-2021-42278 and CVE-2021-42287. Microsoft treats them as two separate fixes, published in two support articles, but defenders need to think of them as one exposure because the impact only appears when both are present and a user can control a computer account.

At defence level the chain works like this. A computer account sAMAccountName normally ends with a single dollar sign, for example DC01$. Before the fix, a user who controlled a computer account (usually one they had just created using the default machine account quota) could rename it to the bare name of a domain controller, such as DC01. A Kerberos ticket-granting ticket obtained under that name then outlived the account's name being changed back. When the KDC later processed a service ticket request based on that TGT and could not find an account called DC01, it searched again with a $ appended, found the real domain controller, and issued a ticket carrying the domain controller's privileges. From there an attacker can replicate directory secrets, which is full domain compromise.

Three conditions are needed, and each is a control point:

  • A writable computer account: created through the default quota, or an existing one where the user holds write rights over sAMAccountName and servicePrincipalName.
  • A domain controller without the KB5008102 hardening: so the rename to a name without $ is allowed.
  • A KDC without the KB5008380 PAC changes in force: so the ticket requestor is not checked against the account in the service ticket.

In ATT&CK terms the chain is T1068 Exploitation for Privilege Escalation, using account changes that fit T1098 Account Manipulation, and ends in abuse of forged or misissued tickets covered by T1558 Steal or Forge Kerberos Tickets. For the Kerberos ticket flow itself, see the Kerberos Security Guide.

CVE-2021-42278 and CVE-2021-42287

CVEComponentWeaknessMicrosoft articleFirst fixedKEV
CVE-2021-42278Security Accounts Manager (SAM) on domain controllersNon-administrators could create or rename a computer account whose sAMAccountName did not end with a single $, or whose type flags did not match its object classKB5008102: Active Directory Security Accounts Manager hardening changesNovember 9, 2021 updatesAdded 2022-04-11, known ransomware use
CVE-2021-42287Kerberos Key Distribution Center (KDC)The KDC did not confirm that the account which requested a TGT was the account named in the resulting service ticketKB5008380: Authentication updates (CVE-2021-42287)November 9, 2021 updates, enforced October 11, 2022Added 2022-04-11, known ransomware use

KB5008102 adds two validation checks for computer accounts created or modified by users who are not administrators for machine accounts: the sAMAccountType must match the UserAccountControl type flags (UF_WORKSTATION_TRUST_ACCOUNT or UF_SERVER_TRUST_ACCOUNT for computers), and a computer account with UF_WORKSTATION_TRUST_ACCOUNT must have a sAMAccountName ending in a single $. A failed name check returns 0x523 (ERROR_INVALID_ACCOUNTNAME); other failures return ACCESS_DENIED. Validation on existing objects happens only when a non-administrator modifies sAMAccountName or UserAccountControl, so legacy objects are not rewritten.

KB5008380 adds information about the original requestor to the PAC of every TGT, including accounts that previously opted out of PACs, and makes the KDC check that the TGT requestor matches the account in the service ticket.

Patching and enforcement

KB5008102 has no staged enforcement: its checks apply as soon as the update is installed. KB5008380 was rolled out in three phases, controlled by the PacRequestorEnforcement REG_DWORD under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Kdc (no restart needed).

PhaseUpdate dateBehaviourPacRequestorEnforcement
Initial deploymentNovember 9, 2021Protections added; Deployment mode by default, accounts without the new PAC are not checked further1 = Deployment (default when unset), 2 = Enforcement, 0 = Disabled (not recommended)
Second deploymentJuly 12, 2022Value 0 removed; setting 0 behaves as 11 or 2
EnforcementOctober 11, 2022Enforcement mode on all domain controllers; authentication is denied if the new PAC is missingDeprecated and no longer read

Microsoft warns that mixing 0 and 2 in one forest can cause intermittent failures. Today the practical position is simple: any domain controller on a cumulative update from October 2022 or later is in Enforcement, and a domain controller older than that is a priority finding regardless of noPac.

Rollout and verification steps

  1. Inventory every DC: list all writable and read-only domain controllers from the Domain Controllers OU and from the sites and services configuration, then compare the two lists. Include DCs in disaster recovery sites and any built from old images.
  2. Confirm build levels: check each DC's installed cumulative update against the current monthly release. Treat any DC without updates from November 2021 as exposed to noPac, and any without October 2022 updates as outside Enforcement.
  3. Remove leftover registry overrides: a PacRequestorEnforcement value has no effect after October 2022, but its presence shows where someone once delayed enforcement and is worth reviewing in change records.
  4. Review KDC events 35 to 38: before and after patching, collect them from all DCs. Events 35, 36 and 37 point to a KDC that lacks the update or a ticket built without the new PAC; event 38 is the one to investigate as a possible attack.
  5. Rollback: there is no supported rollback to pre-enforcement behaviour. If authentication breaks after a DC update, fix the failing component (often a non-Windows KDC or third-party Kerberos implementation, or an unpatched trusted domain) rather than removing the update.

Patch cadence for domain controllers belongs in the wider programme: see the Active Directory Security Checklist for the full DC hardening baseline.

Hardening machine account quota

By default, authenticated users can join up to 10 machine accounts to the domain, controlled by ms-DS-MachineAccountQuota on the domain naming context object. Members of Administrators and Domain Admins, and anyone with delegated create and delete rights on a container, are not limited by the quota. Patching closes noPac, but the quota is the precondition that makes this class of attack cheap, and the same precondition appears in Certifried (CVE-2022-26923), where a user-created computer account was used to obtain a certificate that impersonated a domain controller. Setting the quota to 0 is the hardening step Microsoft-focused defenders now treat as standard.

ApproachWhat it doesWhen to use itTrade-off
Quota 0, delegated join accountsOrdinary users cannot create computer accounts; joins use a dedicated group with create rights on a specific OUDefault choice for most organisationsJoin processes and imaging tools must be moved to the delegated group first
Quota 0, pre-staged computer objectsHelpdesk or provisioning creates the object, users join to itTightly controlled estates, regulated environmentsMore operational effort per device
Quota left at 10Any user can create up to 10 computer accountsNot recommendedKeeps a precondition for noPac-style, Certifried-style and resource-based constrained delegation attacks
  1. Find current dependants: query computer objects for ms-DS-CreatorSID, which records who created each account under the quota, and group by creator to see which users and service accounts rely on it.
  2. Create the delegation: a group with create and delete computer object rights scoped to the target OU, used by imaging, Autopilot hybrid join connectors or helpdesk accounts.
  3. Set the quota to 0 through change control: using ADSI Edit on the domain object, or your directory change tooling, in each domain of the forest.
  4. Watch for failures: failed joins in the first weeks show which process was missed; add it to the delegated group rather than restoring the quota.

The MachineAccountQuota Guide covers the dependency analysis, the "Add workstations to domain" user right and change control in depth. Computer accounts created through the quota are non-human identities that rarely get an owner: the guide How to find stale user and computer accounts in Active Directory helps clean up the ones that already exist.

Detection events

Patched domain controllers block the rename, so detection now serves two purposes: catching attempts (which show an attacker already holds a domain account) and catching DCs that are silently unpatched. Enable Audit Computer Account Management, Audit User Account Management and Audit Kerberos Authentication Service on domain controllers through Advanced Audit Policy, and forward the System log as well as the Security log.

Event IDLog and sourceWhat it showsWhat to look for
4741Security, Audit Computer Account ManagementA computer account was createdCreation by a standard user (privilege SeMachineAccountPrivilege), Password Last Set <never>, no DNS host name or SPNs, Primary Group ID other than 515
4742Security, Audit Computer Account ManagementA computer account was changedSAM Account Name changed to a value without a trailing $, SPN list cleared, Primary Group ID other than 515, 516 or 521
4781Security, Audit User Account Management (computer accounts logged only on DCs)An account name was changed, with Old Account Name and New Account NameNew name equal to a DC name without $, or a rename followed by a rename back within minutes
4768Security, Audit Kerberos Authentication ServiceA TGT was requestedAccount Name without $ that matches a domain controller's name, from a client address that is not that DC
16990System, Directory-Services-SAMNon-administrator blocked from creating an account with mismatched type flagsAny occurrence: a blocked attempt or a broken provisioning tool
16991System, Directory-Services-SAMNon-administrator blocked from creating or renaming a computer account without a single trailing $Any occurrence: the attempted name is in the event text
35, 36, 37System, Kerberos-Key-Distribution-CenterTickets missing PAC attributes or requestor informationA KDC that lacks the update; event 37 can also appear after some password operations
38System, Kerberos-Key-Distribution-CenterTicket requestor inconsistent with Active Directory; lists both SIDsPossible rename attack: investigate immediately

Detection logic, described

  • Rename to a DC name: join 4781 or 4742 where the new sAMAccountName does not end in $ against the current list of domain controller names. Any match is high severity.
  • Rename and revert: the same Target Security ID renamed twice within a short window (minutes) by the same Subject Logon ID.
  • Quota creation then change: a 4741 by a non-administrative account followed by a 4742 on that object from the same Logon ID.
  • Blocked attempts: any 16990, 16991 or KDC 38 raises an alert for triage, because legitimate tools rarely trigger them after initial cleanup.

Correlate the Subject Logon ID with 4624 logon events to find the source host. For wider AD monitoring coverage, see the Active Directory Security Monitoring and Event IDs Guide and the Kerberos and NTLM Event Detection Guide. If an alert fires, follow the Active Directory Domain Compromise Response Playbook: treat any successful chain as full domain compromise, including a double krbtgt reset.

Metrics that show it is working

  • DC patch coverage: percentage of domain controllers on a cumulative update from the last 60 days (target 100).
  • Machine account quota: number of domains in the forest with ms-DS-MachineAccountQuota above 0 (target 0).
  • Quota-created accounts: count of enabled computer objects with ms-DS-CreatorSID set and no recent logon, trending down.
  • Audit coverage: percentage of DCs forwarding 4741, 4742, 4781 and KDC System events to the SIEM (target 100).
  • Alert triage time: median time from a 16991 or KDC 38 event to analyst review.

Common failure patterns

  • A forgotten domain controller: a DR site DC or one restored from an old backup misses updates and keeps the chain open even when the rest of the estate is patched.
  • Quota left at the default after patching: teams close the CVEs and leave the quota at 10, so the next computer account attack (Certifried was disclosed six months later) has its precondition ready.
  • Only the Security log collected: events 16990, 16991 and KDC 35 to 38 are in the System log, which many SIEM pipelines drop from domain controllers.
  • Delegated write rights on computer objects: setting the quota to 0 does not help if broad groups hold write access to sAMAccountName on existing computer accounts; review ACLs with the Active Directory ACL and Delegation Hygiene Guide.
  • Third-party Kerberos left behind: non-Windows KDCs or appliances in trust relationships that do not produce the new PAC cause authentication failures after enforcement, and pressure to roll back.

Framework mapping

FrameworkReferenceHow it applies
MITRE ATT&CKT1068, T1098, T1558, T1078.002Privilege escalation through the KDC flaw, account manipulation by rename, ticket abuse, then use of domain accounts
NIST CSF 2.0ID.RA-01, PR.PS-02, PR.AA-05, DE.CM-09Identify the vulnerable DCs, keep them patched, restrict who can create computer accounts, monitor directory changes
NIST SP 800-53 Rev. 5SI-2, RA-5, AC-2, AC-6, CM-6, AU-6Flaw remediation, scanning, account management, least privilege on account creation, configuration of the quota, log review
CIS Controls v8.17.3, 8.2Automated operating system patch management; collect audit logs
ISO/IEC 27001:2022 Annex AA.8.8, A.8.15, A.8.16Management of technical vulnerabilities, logging, monitoring activities

Practitioner checklist

  • List every writable and read-only domain controller in the forest and confirm each has a current cumulative update.
  • Confirm no domain controller predates the October 11, 2022 Enforcement updates, and review any leftover PacRequestorEnforcement values.
  • Set ms-DS-MachineAccountQuota to 0 in every domain after moving joins to a delegated group or pre-staged objects.
  • Review computer objects created under the quota (ms-DS-CreatorSID) and disable those with no owner or recent use.
  • Check ACLs for broad write access to sAMAccountName and servicePrincipalName on computer objects.
  • Enable Audit Computer Account Management, Audit User Account Management and Audit Kerberos Authentication Service on all DCs.
  • Forward DC System logs as well as Security logs, so 16990, 16991 and KDC 35 to 38 reach the SIEM.
  • Build alerts for renames to DC names without $, rename and revert sequences, and any KDC event 38.
  • Read the related Certifried guidance and confirm certificate mapping enforcement is also complete.

Standards and references

Related NHI Mgmt Group resources: MachineAccountQuota Guide · Kerberos PKINIT and Certificate Mapping Guide · Active Directory Security Monitoring and Event IDs Guide · Kerberos Security Guide

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.