Expand description
ms-fve — BitLocker (msFVE-RecoveryInformation) primitives in pure Rust.
§What ships in AD
When a domain-joined machine has BitLocker enabled with the “back up recovery info to AD DS” policy, Windows creates a child object under the computer account:
CN=<datetime>{<guid>},CN=<COMPUTER>,OU=…,DC=corp,DC=local
objectClass: msFVE-RecoveryInformation
msFVE-RecoveryPassword: 123456-234567-345678-456789-567890-678901-789012-890123
msFVE-RecoveryGuid: <16 raw bytes>
msFVE-VolumeGuid: <16 raw bytes>
msFVE-KeyPackage: <opaque BEK/FVEK export blob>Any principal with RIGHT_DS_READ_PROPERTY on that leaf can read the
plaintext recovery password. Historically this defaulted to Domain Admins
- Backup Operators, but delegation on the parent computer OU can silently grant it to help-desk groups — an under-audited privilege because the attribute isn’t in the default LDAP filter set.
§What this crate does
RecoveryPassword— parse a 48-digit / 55-char BitLocker recovery password and validate its per-block divisibility checksum (each 6-digit block must be divisible by 11; the mid-block value / 11 encodes the key material). Rejects typos, OCR errors, and pasted-with-noise strings without hitting a DC.RecoveryInformation— a decodedmsFVE-RecoveryInformationobject (recovery_guid,volume_guid,password, optionalkey_package).ldap_filter_recovery_info_all/ldap_filter_recovery_info_for— ready-to-use LDAP filters for enumeration and per-computer lookup.is_bitlocker_leaf_dn— cheap DN-shape check for iterating a subtree without an extraobjectClassroundtrip.
§What this crate does not do
- No LDAP transport. Callers wire whatever LDAP client they already have
(
ldap3, adhammer’s raw LDAP, msldap-ext). - No key-package decryption. The
msFVE-KeyPackageblob is a proprietary BEK/FVEK export that the OS re-parses to unlock the volume; unlock is done by the Windows FVE stack, not by AD tooling.
§Example
use ms_fve::RecoveryPassword;
let pw = RecoveryPassword::parse("135795-258016-380237-502458-132000-122221-244442-366663")
.expect("well-formed recovery password");
assert_eq!(pw.blocks().len(), 8);
// Round-trip the canonical hyphenated form.
assert_eq!(
pw.to_string(),
"135795-258016-380237-502458-132000-122221-244442-366663"
);Structs§
- Recovery
Information - A decoded
msFVE-RecoveryInformationobject. Field names match the attribute names on the AD leaf so bindings fromldap3/ raw LDAP are mechanical. - Recovery
Password - A BitLocker recovery password — eight 6-digit blocks, hyphen-separated.
Enums§
- Object
Error - Errors returned by
RecoveryInformation::from_ldap_attrs. - Password
Error - Errors returned by
RecoveryPassword::parse.
Constants§
- RECOVERY_
INFO_ ATTRS - Attribute names commonly requested when enumerating BitLocker leaves.
Passing this to the LDAP search’s
attrsparameter yields exactly whatRecoveryInformation::from_ldap_attrsneeds.
Functions§
- is_
bitlocker_ leaf_ dn - Cheap shape check: does
dnlook like amsFVE-RecoveryInformationleaf? Windows names theseCN=<UTC-datetime>{<guid>},.... Useful when iterating a subtree without an extra per-objectobjectClassfetch. - ldap_
filter_ recovery_ info_ all - LDAP filter matching every BitLocker recovery leaf across the directory.
Pair with a subtree search under
DC=corp,DC=localto enumerate. - ldap_
filter_ recovery_ info_ for - LDAP filter matching every recovery leaf for a specific computer, given
its DN. Use with a one-level search under
computer_dn.