ms-nrpc 0.1.0-dev

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

STATUS: pre-alpha, defensive-only. Minimum MS-NRPC (Netlogon) surface needed to detect Zerologon (CVE-2020-1472) over ncacn_ip_tcp, and nothing more. Destructive Zerologon (NetrServerPasswordSet2 with the all-zero authenticator, and the corresponding restore paths) is deliberately excluded — it lives inside adhammer as an internal module per triage 2026-08-08, so the crates.io copy stays useful to defenders without shipping a ready-made DC-bricking primitive.

What is here

  • secure_channel — NDR encoders for NetrServerReqChallenge (opnum 4) and NetrServerAuthenticate3 (opnum 26), plus:
    • AES-128-CFB8 with a zero IV (the Netlogon credential cipher).
    • HMAC-SHA256 session-key derivation per MS-NRPC 3.1.4.3.1.
    • The EMPTY_NT_OWF constant and the trailing-NTSTATUS reader.
  • detect::detect_zerologon — read-only probe: bind Netlogon, retry the all-zero challenge / credential handshake up to max_attempts, and report Vulnerable { attempts } on the first STATUS_SUCCESS. Never writes.

What is not here (on purpose)

  • NetrServerPasswordSet2 encoding.
  • Any exploit function that sets the DC machine account password to empty.
  • Any restore function (restore_password, restore_password_cleartext).

If you need those for authorized IR / recovery, use them out of the private adhammer copy.

Usage sketch

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}"),
    Zerologon::NotVulnerable { attempts } => println!("clean ({attempts} tries)"),
}
# Ok(()) }

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

License

MIT.