1. Resources
  2. Detection rules
  3. sAMAccountName Spoofing (noPac)

sAMAccountName Spoofing (noPac) detection rules

An attacker renames a computer account to a domain controller's name without the trailing $, then abuses KDC name lookup to get tickets as that DC (CVE-2021-42278 and CVE-2021-42287). The rename is logged as event 4781.

Platform
Active Directory
Severity
Critical
Log source
Windows Security event log, Windows System event log (domain controllers)
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Control of a computer account, and domain controllers without the November 2021 security updates for the full privilege escalation.
Impact
On unpatched domain controllers, any domain user can obtain service tickets as a domain controller and then run DCSync, which is full domain compromise.
Response
Disable the renamed computer account and the user who renamed it, and handle it as a domain compromise if any domain controller lacked the November 2021 updates.
Mitigation
Install the November 2021 or later cumulative updates on every domain controller, and set ms-DS-MachineAccountQuota to 0.
Event IDs
478116991
Threat groups
Akira

How the attack works

CVE-2021-42278 allowed a computer account's sAMAccountName to be set to a value without the trailing $, and CVE-2021-42287 made the KDC retry a failed account lookup with $ appended. Combined (known as noPac), they let any user who controls a computer account rename it to a domain controller's name, obtain a TGT for that name, rename the account back, and then receive a service ticket that the KDC issues for the real domain controller account.

The November 2021 updates close both issues: KB5008102 stops non-administrators from giving a computer account a name that does not end in a single $, and KB5008380 adds the requestor to the PAC so the KDC can validate it. Every rename is still logged on the domain controller in event 4781, so a computer account losing its $ stands out whether or not the attempt succeeds. Patched domain controllers also log blocked attempts in the System log (Directory-Services-SAM event 16991). A second rule on this page matches that event.

What an attacker needs

  • Control of a computer account, either one created through ms-DS-MachineAccountQuota or write access to the sAMAccountName and servicePrincipalName of an existing one.
  • Domain controllers without the November 2021 security updates, for the full privilege escalation.

Impact

On unpatched domain controllers, any domain user can obtain service tickets as a domain controller and then run DCSync or administer the domain controllers, which is full domain compromise.

Detection rules

Computer Account Renamed to a Name Without a Trailing Dollar Sign

Detects an account rename (4781) where the old name ended in $ and the new name does not. Computer account names end in $; removing it is the first step of sAMAccountName spoofing (CVE-2021-42278), where the account is renamed to a domain controller's name so the KDC confuses the two. Requires Audit User Account Management.

LevelHighStatusExperimentalLog sourceWindows Security event log
title: Computer Account Renamed to a Name Without a Trailing Dollar Sign
id: 08a5a9f7-28ae-42d4-8a15-2d6640c8268d
status: experimental
description: >-
  Detects an account rename (4781) where the old name ended in $ and the new
  name does not. Computer account names end in $; removing it is the first step
  of sAMAccountName spoofing (CVE-2021-42278), where the account is renamed to
  a domain controller's name so the KDC confuses the two.
  Requires Audit User Account Management.
references:
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4781
  - https://support.microsoft.com/en-us/topic/kb5008102-active-directory-security-accounts-manager-hardening-changes-cve-2021-42278-5975b463-4c95-45e1-831a-d120004e258e
author: Forestall
date: 2026-11-10
tags:
  - attack.credential-access
  - attack.t1558
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 4781
    OldTargetUserName|endswith: '$'
  filter_name_keeps_dollar:
    NewTargetUserName|endswith: '$'
  condition: selection and not filter_name_keeps_dollar
falsepositives:
  - Renaming of a user account whose name intentionally ended in $. Such accounts are rare; document them and exclude by TargetSid.
level: high

False positives

  • Renaming of a user account whose name intentionally ended in $. Such accounts are rare; document them and exclude by TargetSid.

SAM Blocked a Computer Account Name Without a Trailing Dollar Sign

Detects event 16991 of the source Directory-Services-SAM in the System log of a domain controller. The Security Accounts Manager writes it when it blocks a non-administrator from creating or renaming a computer account with a sAMAccountName that does not end with a single dollar sign, the validation that the November 9, 2021 updates added for CVE-2021-42278. Renaming a computer account to a name without the dollar sign is the first step of sAMAccountName spoofing, so on an updated domain controller this event is the trace of an attempt that was refused, where event 4781 would show one that went through. The event text holds the attempted sAMAccountName. Compare it with the names of your domain controllers. Microsoft's article gives the event text and does not name the event data fields, so the rule matches the event ID and the provider only. The validation applies to users who do not have administrator rights for machine accounts, so a change by an administrator is neither blocked nor logged here. Collect the System log of every domain controller.

LevelHighStatusExperimentalLog sourceWindows System event log (domain controllers)
title: SAM Blocked a Computer Account Name Without a Trailing Dollar Sign
id: a37fc4f0-85b8-429c-98a3-47e973bfe42e
status: experimental
description: >-
  Detects event 16991 of the source Directory-Services-SAM in the System log
  of a domain controller. The Security Accounts Manager writes it when it
  blocks a non-administrator from creating or renaming a computer account
  with a sAMAccountName that does not end with a single dollar sign, the
  validation that the November 9, 2021 updates added for CVE-2021-42278.
  Renaming a computer account to a name without the dollar sign is the first
  step of sAMAccountName spoofing, so on an updated domain controller this
  event is the trace of an attempt that was refused, where event 4781 would
  show one that went through. The event text holds the attempted
  sAMAccountName. Compare it with the names of your domain controllers.
  Microsoft's article gives the event text and does not name the event data
  fields, so the rule matches the event ID and the provider only. The
  validation applies to users who do not have administrator rights for
  machine accounts, so a change by an administrator is neither blocked nor
  logged here. Collect the System log of every domain controller.
references:
  - https://support.microsoft.com/en-us/topic/kb5008102-active-directory-security-accounts-manager-hardening-changes-cve-2021-42278-5975b463-4c95-45e1-831a-d120004e258e
  - https://attack.mitre.org/techniques/T1558/
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1558
logsource:
  product: windows
  service: system
detection:
  selection:
    Provider_Name|contains: Directory-Services-SAM
    EventID: 16991
  condition: selection
falsepositives:
  - A provisioning or domain join tool that creates computer accounts with a name that lacks the dollar sign. Such a tool fails every time on an updated domain controller. Fix the tool, and confirm the caller before closing the alert.
level: high

False positives

  • A provisioning or domain join tool that creates computer accounts with a name that lacks the dollar sign. Such a tool fails every time on an updated domain controller. Fix the tool, and confirm the caller before closing the alert.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Computer account renamed to a domain controller name, given a ticket under that name and renamed again

Detection hypothesisSequence of eventsJoins two logsNeeds your own lists

The technique needs a fixed order of steps within minutes. A computer account loses its trailing dollar sign and takes the name of a domain controller, a ticket-granting ticket is requested under that name, the account is renamed again, and a service ticket is then requested by the name that no longer exists. The rule on this page reports the first rename. The rest of the chain shows that the attempt was carried through.

  1. A rename: event 4781 whose OldTargetUserName ends with a dollar sign and whose NewTargetUserName does not. Keep TargetSid, the new name and SubjectUserName, and compare the new name with your list of domain controller names without the trailing dollar sign.
  2. Within 10 minutes, a ticket-granting ticket is requested for the new name: event 4768 whose TargetUserName equals it. Keep IpAddress and Status.
  3. A second event 4781 for the same TargetSid changes the name again.
  4. After that rename, event 4769 whose TargetUserName is the name from the first step followed by the domain (account@DOMAIN). No account holds that name any more, so the ticket in use is the one from the second step. Read ServiceName and Status.

Events478147684769

LimitsDomain controllers with the November 2021 updates refuse the escalation, so the chain then shows an attempt and not a compromise. Event 4768 logs the bare name and event 4769 the name with the domain, so normalise before the join. The list of domain controller names is your own. The 10 minutes are a starting point.

Triage

  • Compare NewTargetUserName with the names of your domain controllers; a match is a strong indicator of noPac exploitation.
  • Identify who made the change (SubjectUserName) and whether the same user recently created the computer account (event 4741).
  • Look for a TGT request (4768) for the new name, service ticket requests (4769) around the same time, and the account being renamed back shortly afterwards.
  • Confirm the patch level of every domain controller; if any is unpatched, treat the domain as compromised.

Response

Once the attack is confirmed:

  1. Disable the renamed computer account and the user who renamed it, and isolate the host the change came from.
  2. If the new name matched a domain controller and any domain controller lacked the November 2021 updates at that time, handle it as a domain compromise. A service ticket in the name of a domain controller allows directory replication.
  3. Bring every domain controller to the current update level before the rest of the recovery, so that the same step cannot be repeated.
  4. Find the other computer accounts the same user created (event 4741) and remove them once the evidence is preserved.
  5. If every domain controller was updated and the attempt was blocked, the credentials of that user are still in an attacker's hands. Reset them and review what else the user did.

Mitigation

  • Install the November 2021 (or later) cumulative updates on every domain controller and confirm that PAC requestor enforcement from KB5008380 is active.
  • Set ms-DS-MachineAccountQuota to 0 and delegate computer creation to a dedicated group.
  • Restrict write access to sAMAccountName and servicePrincipalName on computer objects.

Frequently asked questions

Are we still at risk when every domain controller has the November 2021 updates?

The privilege escalation is closed. KB5008102 stops non-administrators from giving a computer account a name that does not end in a single $, and KB5008380 adds the requestor to the PAC so that the KDC can validate it. An alert still matters, because it shows that someone who controls a computer account tried the technique.

How do I know whether an attempt was blocked or went through?

Patched domain controllers log blocked attempts in the System log as Directory-Services-SAM event 16991. For a rename that went through, look for a ticket-granting ticket request (4768) for the new name, service ticket requests (4769) around the same time and the account being renamed back shortly afterwards.

Is there a harmless reason for an account name to lose its trailing $?

Rarely. Computer account names end in $, and the expected match is a user account whose name intentionally ended in $ and was then renamed. Such accounts are rare. Document them and exclude them by TargetSid.

Where does the attacker get the computer account that is renamed?

Usually by creating one. By default every domain user can create computer accounts through ms-DS-MachineAccountQuota. Write access to sAMAccountName and servicePrincipalName of an existing computer account works as well. Setting the quota to 0 and delegating computer creation to a dedicated group removes the easy route.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.