Skip to main content

Crate ms_rodc

Crate ms_rodc 

Source
Expand description

ms-rodc — Read-Only Domain Controller audit primitives.

§Why RODCs need their own audit surface

An RODC has:

  • Its own per-RODC krbtgt account (krbtgt_NNNNN) with its own key. A ticket forged with the domain krbtgt won’t validate at an RODC and vice-versa, but forging a TGT with a per-RODC krbtgt key is often sufficient to authenticate to services that trust the RODC.
  • A Password Replication Policy (PRP) — the set of accounts whose secrets the RODC is allowed to cache locally. Two attributes drive it:
    • msDS-RevealOnDemandGroup (allow list)
    • msDS-NeverRevealGroup (deny list)
  • A revealed set tracking what has actually been cached:
    • msDS-RevealedList (constructed, per-RODC list of principals whose secrets are cached)
    • msDS-RevealedUsers (per-user link to revealing RODCs — inverse)

Silver-lining detection: if a Tier-0 account (Domain Admins, DA-shaped service accounts) shows up in an RODC’s msDS-RevealedList, physical compromise of that RODC hands the attacker a live secret. If the same account is missing from msDS-NeverRevealGroup, that hole was policy, not accident.

§What this crate does

§What this crate does not do

  • No LDAP transport (bring your own — ldap3, adhammer’s raw client).
  • No ticket forgery for the per-RODC krbtgt key — that path lives in ms-pac-forge (once the caller has extracted the per-RODC krbtgt key via DCSync or SAMR).
  • No Kerberos AP-REQ path to distinguish where a ticket was issued — a separate RODC-scoped Kerberos client is future work.

Structs§

RevealAudit
Auditor: given a set of RODC objects and a per-principal tier lookup, return every (rodc, principal) pair whose presence in the RODC’s msDS-RevealedList warrants attention.
RevealFinding
A single audit finding produced by RevealAudit.
RodcObject
A normalized RODC computer object as consumed from AD.

Enums§

RevealTier
Classification the caller applies to a principal to decide the severity of its presence on an RODC.

Constants§

KRBTGT_AUDIT_ATTRS
Attributes commonly requested when auditing a krbtgt account (either domain-wide or per-RODC).
PRIMARY_GROUP_RID_DC
Well-known primary-group RID for a writable DC.
PRIMARY_GROUP_RID_RODC
Well-known primary-group RID that identifies an RODC computer account. A DC has primaryGroupID == 516 (Domain Controllers); an RODC has primaryGroupID == 521 (Read-Only Domain Controllers).
RODC_AUDIT_ATTRS
Attributes commonly requested when auditing an RODC.

Functions§

is_per_rodc_krbtgt_sam
Cheap sAMAccountName-shape check. Returns the numeric suffix if sam looks like a per-RODC krbtgt (krbtgt_NNNNN — Microsoft always zero-pads the 5-digit form on RODC provisioning, but we accept any numeric tail for tolerance).
ldap_filter_krbtgt_all
LDAP filter matching every krbtgt account (domain-wide krbtgt plus every per-RODC krbtgt_NNNNN). Combined with msDS-KeyVersionNumber this drives krbtgt-rotation audits.
ldap_filter_per_rodc_krbtgt
LDAP filter matching a specific per-RODC krbtgt by its numeric suffix.
ldap_filter_rodc_computers
LDAP filter matching every RODC computer object in a domain.
per_rodc_krbtgt_dn
Recover a per-RODC krbtgt full DN under the domain’s CN=Users container. domain_dn should be the full defaultNamingContext (e.g. DC=corp,DC=local).
per_rodc_krbtgt_sam
Recover a per-RODC krbtgt sAMAccountName from a numeric suffix (matches what Install-ADDSReadOnlyDomainControllerAccount writes).