# Detecting Timeroasting the Hard Way

Unauthenticated MS-SNTP lets anyone request a DC-signed MAC for any computer/trust account RID, enabling offline password cracking of machine accounts.

- Payout: Research
- Severity: medium
- Program: Microsoft
- Write-up by: Huntress
- Disclosed: 2026-11-19
- Write-up quality: 9/10
- Original: https://www.huntress.com/blog/detecting-timeroasting
- Library page: https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-detecting-timeroasting
- Tags: area:devices domain:network impact:data-leak impact:internal-access kind:research platform:threat-intel sev:medium tech:windows technique:reverse-engineering technique:source-review vuln:auth-bypass vuln:info-disclosure

**Target:** Windows domain controller w32time/netlogon MS-SNTP (UDP/123)
**Root cause:** MS-SNTP signs a time response with a MAC keyed on the named account's password-derived key, with no authentication required; the client names any account by RID and the DC signs for it.
**Steps:**
1. Send an NTP request to DC UDP/123 with a 68-byte (legacy MD5) or 120-byte (extended) authenticator, KeyIdentifier at offset 48 set to target RID little-endian, MAC zeroed.
2. For extended form set Flags byte at offset 53 to 0x01 (USE_OLDKEY_VERSION) to get a 120-byte reply with real HMAC-SHA512; the current-key (flags=0) extended request times out.
3. DC replies with MAC computed over the 48-byte NTP response using the account's password-derived key.
4. Sweep RIDs to collect MACs for computer/trust accounts (user accounts return an error and no reply).
5. Crack offline: NThash=MD4(UTF-16LE(pw)); K=SP800-108 CTR HMAC-SHA512 with label `sntp-ms\0`, LE32(RID) context, L=512; checksum=HMAC-SHA512(K, response[0:48]).
**How found:** Read the protocol spec then reversed w32time.dll and netlogon.dll in radare2; found signing delegated to Netlogon via logoncli.dll imports, located NlGetKDFKey and NlComputeHMACMessageSignatureFromKey, and pinned the exact KDF label, endianness and hash by disassembly, then validated against live DC output.
**Exploitation:** Unauthenticated attacker sweeps RIDs against a DC over UDP/123, collects password-derived MACs for computer and trust accounts, and cracks them offline with no lockout or authentication event. Only weak/non-rotated machine secrets fall.
**Escalation:** Targeted variant: a domain admin renames a user account to a machine-looking account ($ suffix, workstation trust UAC) so the DC signs for it, then reverts.
**Insight:** When a spec leaves crypto parameters ambiguous, grep the implementing DLL for the KDF label; if absent, follow the imported crypto functions to the DLL that actually computes it. Attacker-controlled fields that only flow as a key selector/RID (not length/index) are safe from memory corruption but still a signing oracle.

## Proof of concept (copied exactly from the original report)

**Suricata volumetric MS-SNTP sweep rule**

```
alert udp any any -> $DC_SERVERS 123 (msg:"MS-SNTP authenticated-NTP sweep to DC (Timeroast, either form)"; dsize:>56; byte_test:1,=,3,0,bitmask 0x07; threshold:type threshold, track by_src, count 25, seconds 60; classtype:attempted-recon; sid:5200010; rev:1;)
```

**Suricata old-key flag rule**

```
alert udp any any -> $DC_SERVERS 123 (msg:"MS-SNTP ExtendedAuthenticator USE_OLDKEY_VERSION"; dsize:120; content:"|01|"; offset:53; depth:1; classtype:attempted-recon; sid:5200002; rev:1;)
```

**Own-RID mismatch detection skeleton**

```
on UDP packet to DC:123 where len(payload) in {68, 120}   # 48 = plain NTP, ignore
  and (payload[0] & 0x07) == 3:                            # client mode 3, not a server reply
    requested_rid = le32(payload[48:52])                   # KeyIdentifier, little-endian
    own_rid       = ip_to_rid[src_ip]                      # enrichment: DHCP/DNS -> LDAP objectSid -> RID
    if own_rid is None:
        alert("authenticated MS-SNTP from a host with no RID mapping")   # triage, not a verdict
    elif requested_rid != own_rid:
        alert("host asked the DC to sign for a RID that is not its own") # the durable signal
```

