Drive Badger is able to automatically detect and decrypt Apple FileVault-encrypted APFS partitions, using either user password, or recovery key.
See keys-filevault-demo repository. It contains a sample filevault.keys
file.
You can configure multiple such repositories - each such repository should:
/opt/drivebadger/config/keys-filevault-yourchosenname
local directory on your Drive Badger persistent partitionfilevault.keys
file with proper contents (see below)Local directory doesn't need to contain .git
subdirectory, in fact it can be just "floating" directory (created by hand or script, without repository). However if it does, then you can update it automatically using /opt/drivebadger/update.sh
(in just 1 step for all repositories).
If you have decryption keys associated (directly or indirectly) with particular drive serial numbers, you can save such keys in keys directory.
If you have any additional useful information about particular keys, allowing you to split them in some way (eg. into cities, buildings, floors, company departments, employee specialties) into smaller groups, you can try:
filevault.keys
file formatfilevault.keys
file can contain:
#
sign (without leading spaces)Example filevault.keys
file:
# macbook pro, recovery key
ABCD-1234-5678-90AB-CDEF-1234
# mac mini, user password
MyFancyPassword
APFS partition has different structure than most other partition types: it has multiple separate filesystems (usually 4 or 5) stored as single partition, with a single UUID. All these filesystems are then mounted and seen as consecutive layers of the same logic filesystem. Drive Badger tries to exfiltrate only 1 or 2 of such filesystems: those containing user data.
Similar to other partition types (except only Bitlocker), APFS partitions are detected by systemd
/udevd
during system boot phase. Drive Badger relies on that, and just iterates over all detected partition UUIDs, trying to mount and exfiltrate them one by one. For APFS this behavior is however a bit different:
filevault.keys
filesWhen a matching key is found, it's saved in keys directory - so it can be easily reused.