ms-nrpc 0.1.0

MS-NRPC (Netlogon) secure-channel setup + read-only Zerologon (CVE-2020-1472) detection. Defensive-only: destructive exploit/restore paths are deliberately excluded
Documentation

ms-nrpc

Crates.io Docs.rs License: MIT

Pure-Rust MS-NRPC (Netlogon) secure-channel setup plus a read-only Zerologon (CVE-2020-1472) probe. For defenders, IR analysts, and AD auditors who need to fingerprint DC exposure over ncacn_ip_tcp without shipping a DC-bricking primitive on crates.io. Part of the icedracon offensive-AD Rust ecosystem.

Status

0.1.0-dev — pre-alpha, expect breaking changes before 0.1.0. Defensive scope is frozen: destructive Zerologon (the NetrServerPasswordSet2 all-zero authenticator write and the corresponding restore paths) will not be added here — that surface lives inside adhammer as an internal, gated module per the 2026-08-08 triage.

What it does

Implements the two Netlogon opnums needed to negotiate the secure channel: NetrServerReqChallenge (opnum 4) and NetrServerAuthenticate3 (opnum 26), with hand-rolled NDR encoders on top of ms-ndr and dcerpc. Ships the AES-128-CFB8 credential cipher (zero-IV, per MS-NRPC 3.1.4.3) and the HMAC-SHA256 session-key derivation from MS-NRPC 3.1.4.3.1, plus the EMPTY_NT_OWF constant and the trailing-NTSTATUS reader. detect::detect_zerologon retries the all-zero challenge/credential handshake up to max_attempts times (the CVE requires ~256 tries on average because one client challenge byte fails to encrypt to a zeroed server credential) and reports Vulnerable { attempts } on the first STATUS_SUCCESS — no writes, no password change, no state left on the DC.

Usage

use ms_nrpc::detect::{detect_zerologon, Zerologon};

# async fn run() -> dcerpc::Result<()> {
match detect_zerologon("10.0.0.10", "DC01", 2000).await? {
    Zerologon::Vulnerable    { attempts } => println!("VULN after {attempts} tries"),
    Zerologon::NotVulnerable { attempts } => println!("clean after {attempts} tries"),
}
# Ok(()) }

The offline test suite (cargo test) exercises the NDR layout and the AES-CFB8 / HMAC-SHA256 math against known-answer fixtures without touching the network.

What works / what does not (this version)

  • ✅ Working: NetrServerReqChallenge + NetrServerAuthenticate3 encoders, AES-128-CFB8 credential cipher, HMAC-SHA256 session-key derivation (MS-NRPC 3.1.4.3.1), detect_zerologon async probe, offline NDR + KAT tests.
  • ⚠ Deliberately absent: NetrServerPasswordSet2 encoding; any exploit function that zeroes a DC machine-account password; any restore path. Use the private adhammer copy for authorized IR and recovery.

Related icedracon crates

  • dcerpc — MS-RPC over ncacn_ip_tcp, the transport ms-nrpc binds Netlogon on.
  • ms-ndr — NDR 20 encoding the opnum stubs are built with.
  • ms-pac-forge — once a machine-account cred is recovered another way, ms-pac-forge drives Golden/Silver ticket construction from the same Kerberos-auth cluster.
  • credssp — RDP/WinRM NLA pass-through, adjacent credential-auth surface.
  • ms-gkdi — LAPS-v2 + gMSA + dMSA key derivation.

License

MIT © 2026 zevs