BitLocker Password Recovery (my case)
Overview
Recovered a 64GB BitLocker-encrypted USB. I remember the password followed a known pattern (kingstonXXXX) but I forgot the 4 digits. I moved from trying to brute force with Windows tools to offline GPU cracking with BitCracker.
Recovered Password: kingston[REDACTED]
NOTE: I'm aware this was a straightforward brute-force case with only 10,000 possible combinations. The real value here isn't the complexity of the crack itself, but rather the methodology.
Table of Contents
Initial Approach
Attempt 1: Python subprocess & manage-bde
I was using a manage-bde script, ran all 10k cases, didn't work, idk why.
Disk Imaging
This was the hardest part. Windows locks raw disk access, and WSL couldn't see the partition I needed.
Problem 1: "Invalid argument" (Python)
- Error:
[Errno 22] Invalid argument
- Cause: Python's default buffering messed with the physical sectors.
- Fix: Switched to
buffering=0 and used 16MB chunks.
Problem 2: "Drive is Locked" (Python)
- Error:
This drive is locked by BitLocker Drive Encryption.
- Cause: Accessing
\\.\D: (Logical Volume) triggers Windows protection.
- Fix: Accessed
\\.\PhysicalDriveX directly to bypass the file system.
Problem 3: WSL failure
- Scenario: Used
ddrescue in WSL to image /dev/sdb.
- Issue:
lsblk showed sdb as only 186MB.
- Cause: BitLocker To Go creates a small "Reader Partition" (186MB) for unencrypted access. WSL only saw this stub, not the actual 64GB encrypted partition.
- Fix: I had to go back to Windows and use a Python script targeting the Physical Drive to grab the headers.
The Solution
Hardware: NVIDIA RTX 3060 Laptop
Software: WSL (Ubuntu 24.04), BitCracker, Python 3
Step 1: Find the Physical Drive (Windows)
Get-PhysicalDisk | Format-Table DeviceID, FriendlyName, Size, MediaType
Found my USB as \\.\PhysicalDrive1.
Step 2: Create Disk Image (Windows)
I wrote a script to read the raw disk. I grabbed 35GB to be safe (overkill, but guaranteed I got the signature).
Script: copydrive.py
import sys
import os
# SETTINGS
DISK_NUMBER = 1
OUTPUT_FILE = "drive_image_full.img"
SIZE_MB = 35840 # 35GB
def image_disk():
device_path = f"\\\\.\\PhysicalDrive{DISK_NUMBER}"
print(f"Target: {device_path}")
confirm = input("Type 'yes' to confirm: ")
if confirm.lower() != 'yes':
return
try:
# Open raw device with no buffering, write with 16MB buffer
with open(device_path, "rb", buffering=0) as source:
with open(OUTPUT_FILE, "wb", buffering=16*1024*1024) as target:
bytes_to_read = SIZE_MB * 1024 * 1024
total_read = 0
chunk_size = 16 * 1024 * 1024
print("Reading raw data...")
while total_read < bytes_to_read:
read_size = min(chunk_size, bytes_to_read - total_read)
chunk = source.read(read_size)
if not chunk:
break
target.write(chunk)
total_read += len(chunk)
if total_read % (512 * 1024 * 1024) == 0:
print(f"Progress: {total_read/1024/1024/1024:.2f}GB", end="\r")
print(f"\nDone. Created {OUTPUT_FILE}")
except PermissionError:
print("\nAccess Denied. Run as Admin.")
except Exception as e:
print(f"\nError: {e}")
if __name__ == "__main__":
image_disk()
Step 3: Extract Hash (BitCracker)
Moved the image to WSL and ran the extractor.
cd ~/bitcracker/build
./bitcracker_hash -i /mnt/c/Users/user/drive_image_full.img -o output_hash
Output:
---------> BitCracker Hash Extractor <---------
Encrypted device /mnt/c/Users/user/drive_image_full.img opened, size 35840.00 MB
************ Signature #1 found at 0x3f0003 ************
Version: 8
Invalid version, looking for a signature with valid version...
************ Signature #2 found at 0xc04b0000 ************
Version: 2 (Windows 7 or later)
=====> VMK entry found at 0xc04b00bf
Encrypted with User Password (0xc04b00e0)
VMK encrypted with AES-CCM
======== UP VMK ========
UP Salt: 7db7b08bd529c49ac1eaafa886dc9baf
UP Nonce: c0ed94864bd6db0103000000
UP MAC: 35b8e28ffaa978731ca5c75046d86138
UP VMK: c8724624e9c4999464e0d769d4a74557f5a7e416de53609a26b4ff0ee08f0be1394b9cdce874fe7a4d5af0a0
=====> VMK entry found at 0xc04b019f
Encrypted with Recovery Password (0xc04b01c0)
Searching for AES-CCM (0xc04b01dc)...
Offset 0xc04b026f.... found! :)
======== RP VMK #0 ========
RP Salt: 4ad25ff3cc613caaaf2eb488022655b1
RP Nonce: c0ed94864bd6db0106000000
RP MAC: f28a8ab46249f479fae97444dd9788e3
RP VMK: a79f08b155b38f65dbe695a3da7c0abbbdfbd60f172b4c5171510c3e98a4a167554e5c348b807130f517e8d9
************ Signature #3 found at 0xc04c0000 ************
Version: 2 (Windows 7 or later)
=====> VMK entry found at 0xc04c00bf
Can't define a key protection method for values (0,20)... skipping!
=====> VMK entry found at 0xc04c019f
Encrypted with Recovery Password (0xc04c01c0)
Searching for AES-CCM (0xc04c01dc)...
Offset 0xc04c026f.... found! :)
This VMK has been already stored...quitting to avoid infinite loop!
User Password hash:
$bitlocker$0$16$7db7b08bd529c49ac1eaafa886dc9baf$1048576$12$c0ed94864bd6db0103000000$60$35b8e28ffaa978731ca5c75046d86138c8724624e9c4999464e0d769d4a74557f5a7e416de53609a26b4ff0ee08f0be1394b9cdce874fe7a4d5af0a0
It found 3 signatures. I ignored #1 and #3 and used the User Password hash from Signature #2.
echo '$bitlocker$0$16$7db7b08bd529c49ac1eaafa886dc9baf$1048576$12$c0ed94864bd6db0103000000$60$35b8e28ffaa978731ca5c75046d86138c8724624e9c4999464e0d769d4a74557f5a7e416de53609a26b4ff0ee08f0be1394b9cdce874fe7a4d5af0a0' > hash_user_pass.txt
Step 4: Generate Wordlist
Generated a list of 10,000 candidates based on the known pattern.
python3 -c "print('\n'.join([f'kingston{str(i).zfill(4)}' for i in range(10000)]))" > wordlist.txt
Result: Creates wordlist.txt with entries:
kingston0000
kingston0001
kingston0002
...
kingston9999
Step 5: Crack
Ran it against the GPU.
Performance Tuning
I had to play with the settings to get the speed up.
Attempt 1: Baseline
- Used default settings. Only utilized 1 GPU block.
- Speed: ~50 pwd/sec
- Result: Too slow.
Attempt 2: Aggressive
- Maxed out threads and blocks.
- Result: Segmentation fault (core dumped). Ran out of memory.
Attempt 3: High Blocks
- Lowered blocks slightly.
- Result: Integer overflow error in BitCracker. It's a known bug with certain combos.
Attempt 4: The Sweet Spot
./bitcracker_cuda -f hash_user_pass.txt -d /mnt/c/Users/user/wordlist.txt -t 256 -b 64 -g 0 -u
Result:
---------> BitCracker: BitLocker password cracking tool <---------
====================================
Selected device: GPU NVIDIA GeForce RTX 3060 Laptop GPU (ID: 0)
====================================
Compute capability: 8.6
Clock rate: 1282 MHz (1.28 GHz)
Memory Clock Rate (KHz): 6001000
Memory Bus Width (bits): 192
Peak Memory Bandwidth (GB/s): 288.048000
Multiprocessor count: 30
Total global mem: 6441926656 bytes
Free memory: 5366611968 bytes
For this session, BitCracker requires at least 2415919104 bytes of memory
====================================
Retrieving Info
====================================
Reading hash file "hash_user_pass.txt"
$bitlocker$0$16$7db7b08bd529c49ac1eaafa886dc9baf$1048576$12$c0ed94864bd6db0103000000$60$35b8e28ffaa978731ca5c75046d86138c8724624e9c4999464e0d769d4a74557f5a7e416de53609a26b4ff0ee08f0be1394b9cdce874fe7a4d5af0a0
====================================
Attack
====================================
Type of attack: User Password
CUDA Threads: 1024
CUDA Blocks: 64
Psw per thread: 256
Max Psw per kernel: 16777216
Dictionary: /mnt/c/Users/user/wordlist.txt
Strict Check (-s): No
MAC Comparison (-m): No
CUDA Kernel execution:
Effective passwords: 10000
Passwords Range: kingston0000 ..... kingston9999
Time: 24.844412 sec
Passwords x second: 402.50 pw/sec
================================================
CUDA attack completed
Success!
- CUDA Threads: 1024
- CUDA Blocks: 64
- Speed: ~400 pwd/sec (8x improvement from baseline)
- Total Time: 24.8 seconds for 10,000 passwords
- Password Found:
kingston9274
Tools Used
- BitCracker The cracking tool.
- Python: For the disk imaging script.
- WSL (Ubuntu): To run BitCracker.