Mounting Encrypted VHD Drives
Related Sites:
sudo modprobe nbd
sudo qemu-nbd -c /dev/nbd0 backup.vhd

Provide the password 123456789! then we can list out the /dev/mapper/ directory:


Make a directory to mount it into:
List out the mounted drive:

We now have VHD mapped out and find backup copies of SAM and SYSTEM and we can use secretsdump to dump hashes.
Unmounting the Drive
If you are still having issues unmounting, restart the device
From Linked Medium Article: Mounting Bit-locker encrypted vhd files in Linux
Below is the article from this Medium article:
BitLocker is a full volume encryption feature included with Windows with natively uses AES 128bit or 256bit keys. It stores is the keys on the TPM.
On the other hand Linux distros provide encryption based on LUKS (Linux Unified Key Setup) which doesnโt depend on TPM in any way. LUKS encrypts the full drive including the partition header and BitLocker only acts on partition level. From Cryptsetup version 2.3.0 onward BitLocker encryption format is supported.
So following packages are required on the Linux distro of your choice: -
qemu-img(in RHEL, Fedora)/qemu-utils(in Debian)crytpsetupwith minimum version of 2.3ntfs-3g-devel(in RHEL, Fedora)/ntfs-3g-dev(in Debian) (optional) needed only in case the NTFS volume is unclean
Once we have the packages ready, we can start by inserting the nbd modules in the kernel
After that we can have mount the vhd or vhdx file as follows.
If mounting multiple vhd files we need to increment the /dev/nbd0 to /dev/nbd1 and so on. After running this our vhd files is mounted under /dev/nbd0 . We need to do a $ lsblk to identify exactly which partition is the Bitlocker encrypted partition (size of partition is useful for distinguishing). In my case the partition is /dev/nbd0p2 the second partition on the disk. We need to run Cryptsetup and provide a label for mounting the Bitlocker partition
Now my partition is visible as /dev/mapper/my_label . It can be mounted normally now.
If we have NTFS related problems in the drive we can run ntfsfix before mounting the drive to fix the issues
To close the BitLocker partition properly we need to first umount then use cryptsetup bitlkClose for closing the partition
Last updated