blog.elcomsoft.com-Understanding BitLocker TPM Protection
blog.elcomsoft.com-Understanding BitLocker TPM Protection
blog.elcomsoft.com/2021/01/understanding-bitlocker-tpm-protection
January 5, 2021
What is TPM
Trusted Platform Module (TPM) is a standard for a secure cryptoprocessor, a dedicated
microcontroller designed to secure hardware through integrated cryptographic keys. On
a physical level, the TPM might be implemented as a built-in chip, an additional module
one can install into a slot on the desktop motherboard, or as a virtual emulator (the Intel
PTT technology).
1/10
The platform consists of a secure cryptoprocessor and a small amount of built-in
memory. The main functions of TPM are the generation, storage and secure
management of cryptographic keys; in particular, the BitLocker keys. The operating
system must provide APIs for developers for accessing the TPM, and uses TPM to
manage encryption keys.
In this article, I will talk about the role of TPM in BitLocker encryption.
When Windows developers were designing the disk encryption scheme, they attempted
to counter the following threats:
The top priority, however, was that the protection was as transparent and as unobtrusive
to the user as possible. Ideally, the user would never notice the encryption; this goal has
been achieved. For those who need extra protection against additional threats, the
developers allowed specifying a pre-boot PIN code or adding other types of protectors
(e.g. a physical smartcard or USB drive).
2/10
BitLocker makes use of symmetric encryption. By default, AES-128 is used to encrypt
data in either XTS (new) or CBC (legacy) mode. The data is encrypted with VMK
(Volume Master Key), which in turn can be obtained in one of the following ways:
1. Decrypted with the user’s encryption password, if this protector is enabled for a
given volume.
2. Decrypted with a Recovery Key. The Recovery Key is generated automatically
once the encryption is enabled for the first time. The key is then either stored to a
file, uploaded to the user’s Microsoft Account of saved in Active Directory.
3. (You are here) Extracted from the TPM module when certain conditions are met.
The basic principle of TPM is very similar to blockchain. During the boot, the system
builds chain of trust, which is stored in PCR (Platform Configuration Register) registers.
1. Power on. SRTM (Static root of trust for measures) is the first trusted module is
loaded. This module is stored in the computer’s ROM, and cannot be altered. A
vulnerability in this module breaks the entire protection scheme, which was clearly
demonstrated by the developers of the checkm8 exploit for iOS devices. SRTM
inserts the first record into the chain of trust by calculating the hash value of the
computer’s BIOS. The hash is stored in a PCR register.
3/10
2. UEFI BIOS loads. The BIOS analyzes the computer’s configuration including the
hard drive partitioning, the MBR (Master Boot Record), bootloader and many other
parameters including firmware checksums of certain components (e.g. fingerprint
readers or smartcard readers). Notably, the value of the previous PCR register is
used to calculate new hash values, which means that any modification of a single
PCR register breaks the entire chain.
3. After filling out several PCR registers, BIOS loads the bootloader from the MBR.
The bootloader inserts a few more records.
4. Finally, the OS kernel starts. The kernel keeps adding to the chain of trust.
As you can see, once the OS is finally loaded, the PCR registers contain the entire chain
of trust. Note that the TPM module does not allow modifying PCR registers; one cannot
alter existing records, only add new ones.
BitLocker encryption
Once the user enables BitLocker on a disk volume, Windows generates a random
volume master key (VMK) as well as a recovery key. The master key is then stored in
the TPM module; it is also encrypted with the recovery key. The encrypted VMK is then
saved in the disk header. Once the computer is rebooted, the following happens:
As you can see, if the computer is powered off, the only way to obtain the VMK is by
launching the original OS in its original configuration. Altering a single component will
trigger the prompt for Recovery Key.
4/10
Bypassing TPM
Most often than not, you are analyzing a ‘cold’ system. If this is the case, make sure to
capture the disk image before everything else. You can use Elcomsoft System Recovery
to do that. Before taking the image, you’ll be able to see the list of disk partitions along
with their encryption settings. If the tool reports that the disk is encrypted with BitLocker
but the password hash cannot be extracted, you’ll have to either use the Recovery Key
or attempt to extract the VMK from TPM.
While you may prefer live system analysis to capturing the encryption key and
decrypting the disk image, offline analysis is significantly more forensically sound even if
labor-intensive.
5/10
A similar attack is available for older systems running Windows 7 and Windows 8 if they
are equipped with a FireWire or Thunderbolt port or a PC Card slot. If this is the case,
you can attempt capturing the memory dump with the infamous Inception tool (yes, it’s
“that Python tool”). A memory dump made with Inception can be loaded into Elcomsoft
Forensic Disk Decryptor and scanned for the master key. The VMK be then used to
either completely decrypt the disk image or mount it for faster analysis.
6/10
Seunghun Han released two tools: Napper for TPM and Bitleaker. The first tool can be
used to test the computer’s TPM chip for the “Bad Dream” vulnerability, while the second
tool is the actual exploit one can run if the TPM module has the unpatched vulnerability.
The second tool requires manually creating a Live CD with Ubuntu, compiling and
installing Bitleaker according to the manual. You will need to disable Secure Boot to run
the tool. The alternative way would be signing the modified bootloader and kernel with
your signature and adding the public key to BIOS; this, however, defies the purpose as it
alters the content of PCR registers.
For TPM 1.2, he used the DSLogic Plus logic analyzer with USB interface. However, he
found it to be far from perfect for sniffing TPM traffic as he had to solve synchronization
problems and even patch the firmware. However, he was able to successfully extract the
VMK from the TPM module.
Sniffing TPM 2.0 was way easier with a cheap FPGA Lattice ICEStick and a specal
firmware designed for sniffing TPM modules.
All he needed to do was soldering the pins, enabling the sniffer and obtaining the master
key. More on that in Denis’ original article. Note that desktop motherboards with add-on
TPM chips are even easier to sniff with no soldering required.
This method works in BitLocker’s default configuration. If the user enables pre-boot
authentication with a PIN code, the PIN code will be required to make TPM release the
VMK. This method will not work for Intel PTT as there is no physical access to the
module’s interface.
7/10
Connecting to the TPM chip:
Conclusion
Combined with TPM, BitLocker enables secure protection against unauthorized access.
Despite the fact that the TPM chip itself does not do encryption, gaining access to the
encryption key is not an easy task. I described a number of methods that can be used to
extract the encryption keys from the TPM module. Even if you never use any of them,
they are certainly worth being part of your arsenal.
REFERENCES:
8/10
Elcomsoft Forensic Disk Decryptor
Elcomsoft Forensic Disk Decryptor offers forensic specialists an easy way to obtain
complete real-time access to information stored in popular crypto containers. Supporting
desktop and portable versions of BitLocker, FileVault 2, PGP Disk, TrueCrypt and
VeraCrypt protection, the tool can decrypt all files and folders stored in crypto containers
or mount encrypted volumes as new drive letters for instant, real-time access.
Reset passwords to local Windows accounts and Microsoft Account and perform a wide
range of administrative tasks. Assign administrative privileges to any user account, reset
expired passwords or export password hashes for offline recovery, and create forensic
disk images. Elcomsoft System Recovery is ready to boot thanks to the licensed
Windows PE environment, allowing administrators to access locked computers.
NEWEST ARTICLES
9/10
Pushing the Boundaries: Low-Level Extraction of iOS 16.4 with Keychain
Decryption
ELCOMSOFT NEWS
PRESS RELEASES
10/10