Skip to content

Commit b4a462d

Browse files
committed
Add NTDS BitLocker recovery information
1 parent 5422893 commit b4a462d

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

dissect/database/ese/ntds/objects/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
from dissect.database.ese.ntds.objects.msds_resourcepropertylist import MSDSResourcePropertyList
6969
from dissect.database.ese.ntds.objects.msds_shadowprincipalcontainer import MSDSShadowPrincipalContainer
7070
from dissect.database.ese.ntds.objects.msds_valuetype import MSDSValueType
71+
from dissect.database.ese.ntds.objects.msfve_recoveryinformation import MSFVERecoveryInformation
7172
from dissect.database.ese.ntds.objects.msimaging_psps import MSImagingPSPs
7273
from dissect.database.ese.ntds.objects.mskds_provserverconfiguration import MSKDSProvServerConfiguration
7374
from dissect.database.ese.ntds.objects.msmqenterprisesettings import MSMQEnterpriseSettings
@@ -174,6 +175,7 @@
174175
"MSDSResourcePropertyList",
175176
"MSDSShadowPrincipalContainer",
176177
"MSDSValueType",
178+
"MSFVERecoveryInformation",
177179
"MSImagingPSPs",
178180
"MSKDSProvServerConfiguration",
179181
"MSMQEnterpriseSettings",

dissect/database/ese/ntds/objects/computer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from typing import TYPE_CHECKING
44

5+
from dissect.database.ese.ntds.objects.msfve_recoveryinformation import MSFVERecoveryInformation
56
from dissect.database.ese.ntds.objects.user import User
67

78
if TYPE_CHECKING:
@@ -22,6 +23,12 @@ class Computer(User):
2223
def __repr_body__(self) -> str:
2324
return f"name={self.name!r}"
2425

26+
def fve_recovery_information(self) -> Iterator[MSFVERecoveryInformation]:
27+
"""Return the BitLocker recovery information objects associated with this computer."""
28+
for child in self.children():
29+
if isinstance(child, MSFVERecoveryInformation):
30+
yield child
31+
2532
def managed_by(self) -> Iterator[Object]:
2633
"""Return the objects that manage this computer."""
2734
self._assert_local()
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
from __future__ import annotations
2+
3+
from typing import TYPE_CHECKING
4+
from uuid import UUID
5+
6+
from dissect.database.ese.ntds.objects.top import Top
7+
8+
if TYPE_CHECKING:
9+
from dissect.database.ese.ntds.objects import Computer
10+
11+
12+
class MSFVERecoveryInformation(Top):
13+
"""Represents a msFVE-RecoveryInformation object in the Active Directory.
14+
15+
References:
16+
- https://learn.microsoft.com/en-us/windows/win32/adschema/c-msfve-recoveryinformation
17+
"""
18+
19+
__object_class__ = "msFVE-RecoveryInformation"
20+
21+
@property
22+
def volume_guid(self) -> UUID:
23+
"""Return the volume GUID associated with this recovery information."""
24+
return UUID(bytes_le=self.get("msFVE-VolumeGuid"))
25+
26+
@property
27+
def recovery_guid(self) -> UUID:
28+
"""Return the recovery GUID associated with this recovery information."""
29+
return UUID(bytes_le=self.get("msFVE-RecoveryGuid"))
30+
31+
@property
32+
def recovery_password(self) -> str:
33+
"""Return the recovery password associated with this recovery information."""
34+
return self.get("msFVE-RecoveryPassword")
35+
36+
@property
37+
def key_package(self) -> bytes | None:
38+
"""Return the key package associated with this recovery information, if any."""
39+
return self.get("msFVE-KeyPackage")
40+
41+
def computer(self) -> Computer:
42+
"""Return the computer object associated with this recovery information."""
43+
if (parent := self.parent()) is None:
44+
raise ValueError("msFVE-RecoveryInformation object has no parent computer")
45+
return parent

0 commit comments

Comments
 (0)