Reading Windows Measured Boot Logs for Bootkit Traces
Where Windows keeps Measured Boot logs, how the TCG log and its SIPA events are built, how to decode and compare boots, and what BlackLotus leaves in them.
TL;DR. On a computer with a TPM, every stage of the boot hashes the next one before running it and records that measurement in the TCG event log. Windows saves a copy of that log at every boot in C:\Windows\Logs\MeasuredBoot\. Each file lists the boot applications that ran, the Secure Boot policy, and Windows' own boot settings (test signing, debugging, code integrity, memory integrity) as SIPA events. Collect the whole folder, decode each file, and compare boots: a bootkit that changes the boot path shows up as a new boot application, as Microsoft documents for BlackLotus. The logs are files, not proof by themselves, and they cannot judge firmware without reference values.
Measured Boot in one paragraph
Secure Boot decides what may run; Measured Boot records what did run. Before handing over control, the firmware and each loader hash the next component and extend the hash into a Platform Configuration Register (PCR) of the TPM. PCR values alone are hard to interpret, so the firmware also keeps an event log of every measurement, as the Linux kernel documentation puts it. Windows' boot manager and loader add their own events to the same log. Because the log records rather than blocks, it also covers what Secure Boot let through, which is exactly the case for a Secure Boot bypass.
Where the logs are
| Location | What |
|---|---|
C:\Windows\Logs\MeasuredBoot\<boot count>-0000000000.log | One log per boot, for example 0000000005-0000000000.log |
HKLM\SYSTEM\CurrentControlSet\Control\IntegrityServices\WBCL | The current boot's log, in the registry |
HKLM\SYSTEM\CurrentControlSet\Services\TPM\WBCLPath | Optional alternate folder for the files |
/sys/kernel/security/tpm0/binary_bios_measurements | Linux: the firmware's log for the current boot, readable by root |
The Windows paths come from TCGLogTools, the open-source PowerShell module Microsoft's BlackLotus guidance builds on, and from Microsoft's own troubleshooting article. Microsoft's guidance gives the requirements: Windows 8 or later with an enabled TPM, and one .log file per reboot. The Linux path is the one the Keylime attestation agent reads; the file only covers the current boot, so save a copy each time you need one.
Collect the whole folder. On a live host, from an elevated prompt:
robocopy C:\Windows\Logs\MeasuredBoot E:\case\FIN-WKS-07\C\Windows\Logs\MeasuredBoot /COPY:DAT /R:0 /W:0
From an image, copy the same folder read-only. On Linux, sudo cp /sys/kernel/security/tpm0/binary_bios_measurements ~/case/ keeps the current log.
The format
The TCG PC Client Platform Firmware Profile defines the log. The first record is an EV_NO_ACTION event in the old SHA-1 layout whose signature is the string Spec ID Event03. It tells a parser that the rest of the log is "crypto agile" and which digest algorithms follow. Every later record carries a PCR index, an event type, one digest per active PCR bank (SHA-1, SHA-256) and the event data.
The specification fixes the meaning of the low PCRs. The higher ones belong to the operating system:
| PCR | Contents | What to look at |
|---|---|---|
| 0 | Core firmware code, embedded option ROMs and drivers | Changes with firmware updates; changes without one deserve a question |
| 1 | Host platform configuration | |
| 2, 3 | UEFI driver and application code; their configuration | Add-in card firmware |
| 4 | UEFI boot manager code and boot attempts | Every boot application the firmware ran, with its path |
| 5 | Boot manager configuration and the GPT | Partition table |
| 7 | Secure Boot policy | SecureBoot, PK, KEK, db, dbx, and the db entry that validated each image |
| 11 to 14 | Operating system | Windows: 11 for BitLocker access control, 12 to 14 for its own boot events. shim: MOK lists in 14 |
Microsoft's BitLocker countermeasures page ties PCR 4 to the boot manager, 7 to Secure Boot state and 11 to BitLocker. Microsoft's Azure Attestation policy reads Windows' boot events from EV_EVENT_TAG records in PCRs 12, 13, 19 and 20. Shim's TPM notes list what it measures into PCRs 4, 7 and 14.
The event types a responder meets most:
| Type | Value | Meaning |
|---|---|---|
EV_NO_ACTION | 0x03 | Informative, not extended; includes the Spec ID Event03 header |
EV_SEPARATOR | 0x04 | Closes PCRs 0 to 7 before the operating system starts |
EV_EVENT_TAG | 0x06 | Reserved for operating system use; Windows writes its SIPA events here |
EV_EFI_VARIABLE_DRIVER_CONFIG | 0x80000001 | A UEFI variable such as SecureBoot, PK, KEK, db, dbx in PCR 7 |
EV_EFI_BOOT_SERVICES_APPLICATION | 0x80000003 | A boot application loaded from the boot device, with its device path |
EV_EFI_VARIABLE_AUTHORITY | 0x800000E0 | The db entry used to validate a loaded image, in PCR 7 |
SIPA events: Windows' own measurements
After the firmware hands over, Windows' boot manager and loader log their configuration as EV_EVENT_TAG events. TCGLogTools calls them SIPA events, after the structure names in the Windows wbcl.h header, and describes them as Windows-specific measurements for PCRs 12 to 14. Microsoft's Azure Attestation policy reads the same data under names such as EVENT_BOOTDEBUGGING. The ones that matter in a bootkit or rootkit case:
| SIPA event | What it records |
|---|---|
BootDebugging, OSKernelDebug | Whether the boot or kernel debugger was enabled |
TestSigning, FlightSigning | Whether test-signed or flight-signed code could load |
CodeIntegrity | Whether code integrity checks were on |
SafeMode, WinPE | Unusual boot modes |
LoadedModuleAggregation | Modules loaded by the Windows loader, with FilePath, Authenticode hash, signer and ImageValidated; Microsoft uses it to check that Defender's ELAM driver wdboot.sys loaded |
VBSHVCIPolicy, VBSVSMRequired | Memory integrity (HVCI) and virtualization-based security settings |
ApplicationSVN | The boot manager's security version number |
SIPolicy, BootRevocationList | Hash of the code integrity policy; the boot revocation list in use |
These are the same switches that BCDEdit sets (testsigning, nointegritychecks, debug), recorded at each boot. A TestSigning that turns on for a few boots, or an ELAM driver that stops appearing, is the kind of change the logs make visible.
Decode and compare
TCGLogTools (PowerShell, any Windows machine). After cloning the repository into a TCGLogTools folder, this lists the boot applications of every saved boot, following the same PCR 4 logic as Microsoft's sample script:
Import-Module .\TCGLogTools
Get-ChildItem E:\case\FIN-WKS-07\C\Windows\Logs\MeasuredBoot\*.log | ForEach-Object {
$log = ConvertTo-TCGEventLog -LogPath $_.FullName
$apps = foreach ($e in $log.Events.PCR4) {
if ($e.EventType -eq 'EV_EFI_BOOT_SERVICES_APPLICATION') {
foreach ($dp in $e.Event.DevicePath) {
if ($dp.Type -eq 'MEDIA_DEVICE_PATH' -and $dp.SubType -eq 'MEDIA_FILEPATH_DP') { $dp.DeviceInfo.PathName } } } }
'{0} {1}' -f $_.Name, ($apps -join ' > ')
}
On the live host, ConvertTo-TCGEventLog -LogBytes (Get-TCGLogContent -LogType SRTMCurrent) decodes the current boot. Group a decoded log by PCR or EventType to read the rest, or export it to JSON and diff two boots.
Microsoft's tools. The troubleshooting article documents two decoders: TBSLogGenerator.exe, installed with the Windows Hardware Lab Kit, and PCPTool.exe from the TPM Platform Crypto-Provider Toolkit, which has to be built first.
TBSLogGenerator.exe -LF C:\MeasuredBoot\0000000005-0000000000.log > C:\MeasuredBoot\0000000005-0000000000.txt
PCPTool.exe decodelog C:\MeasuredBoot\0000000005-0000000000.log > C:\MeasuredBoot\0000000005-0000000000.xml
Linux. tpm2_eventlog from tpm2-tools parses a binary TCG log given as its argument: tpm2_eventlog ~/case/binary_bios_measurements.
Then compare boots in order, and explain every change:
- Secure Boot state. The
SecureBootvariable in PCR 7 is01when Secure Boot is on. A boot with it off is a finding on its own. - Boot applications in PCR 4. On a normal Windows boot the chain ends at
\EFI\Microsoft\Boot\bootmgfw.efi. New entries, such as a shim, a GRUB or a second loader, need an explanation. - Authorities in PCR 7. Which
dbcertificate validated each image. A loader validated by Microsoft's third-party UEFI CA on a Windows-only machine is unusual. - SIPA settings. Test signing, debugging, code integrity, memory integrity and the ELAM driver, boot by boot.
- Digests. A changed boot manager hash between two boots usually means a Windows update; a changed PCR 0 measurement usually means a firmware update. Match them with update history before calling them suspicious.
What BlackLotus leaves
Microsoft's guidance is specific: once BlackLotus is active, two more components appear as EV_EFI_BOOT_SERVICES_APPLICATION events, grubx64.efi and winload.efi. In ESET's description the firmware starts the Microsoft-signed shim that sits at bootmgfw.efi, shim starts the self-signed grubx64.efi it now trusts through an enrolled Machine Owner Key, and the bootkit starts the original boot manager, renamed winload.efi. Each of those loads is measured into PCR 4, so the decoded list grows from one Windows boot application to three, and the boot before the infection shows the difference.
Two more things are worth reading in the same logs:
- PCR 7 and PCR 14. Shim measures the certificate lists it uses, including the MOK list, so an attacker MOK can leave a trace there.
- The Secure Boot variable stays at
01. BlackLotus does not turn Secure Boot off, so any check that stops at "Secure Boot enabled" passes. Compare the memory integrity events too: the installer switches HVCI off in the registry, according to Microsoft.
The FinSpy UEFI bootkit and ESPecter replaced or patched bootmgfw.efi itself, so their measurement would show a different boot manager hash under the usual path; ESPecter also needs Secure Boot off, which the SecureBoot variable shows. See the ESPecter and FinSpy pages.
What the logs cannot prove
- They are files. An administrator can delete or edit them. Only a quote signed by the host's TPM binds a log to its PCR values, and an offline copy has none. A missing folder, or a gap in boot numbers, is a finding.
- Firmware measures itself. PCR 0 is extended by the firmware, so an implant that controls that code, such as MoonBounce or CosmicStrand, sits beneath the measurements. Without the vendor's reference values a changed PCR 0 digest says "different", not "malicious".
- No TPM, no log. Machines without an enabled TPM have no Measured Boot folder.
- The log stops early. It covers firmware, boot applications and the Windows loader's view of boot drivers, not drivers or code loaded later. Kernel rootkits and memory-only implants need other evidence; see BYOVD driver hunting.
Checking with rootkits.dev
The checker reads the files in your browser. Its measuredboot module takes Windows logs from C/Windows/Logs/MeasuredBoot/ and a saved Linux binary_bios_measurements, and lists one item per boot: the Secure Boot state, the boot applications in PCR 4, the db entries that authorized them, Windows' SIPA boot settings and the modules the boot loader loaded. It flags:
- Secure Boot. "Secure Boot was off during this boot", and "Secure Boot was on in the previous boot and off in this one".
- Boot applications. A boot application in
\EFI\Microsoft\Boot\other thanbootmgfw.efi: forgrubx64.efiandwinload.efi, the BlackLotus pair, "was started from the Windows boot folder" is a high finding linked to the BlackLotus page. Also "A boot application outside the usual boot paths". - SIPA settings. "Test signing was on at boot", "Code integrity was off at boot", "The boot manager handed over to an application without a signature check", and boot, kernel or hypervisor debugging.
- Boot loader modules. A boot-start module loaded from outside the Windows folders, or one loaded without a validated signature.
- Firmware events. UEFI debug mode, DMA protection disabled, a measurement error.
Between consecutive full boots of the same Windows host, it also flags a new boot manager, fallback or Linux loader path and "The digest of" a boot application "changed since the previous boot", a low finding because updates do it. It does not compare Linux logs, which cover one boot each, and it does not compare firmware (PCR 0) measurements or hold vendor reference values, so it cannot judge a firmware measurement. It does not replay the PCRs or check a TPM quote. Combine it with the ESP check: the log tells you what ran, the partition tells you what is there now. On BlackLotus's other trace, the windrivers module flags "Memory integrity (HVCI) is turned off in the registry" from the SYSTEM hive.
FAQ
Where does Windows keep its Measured Boot logs?
In C:\Windows\Logs\MeasuredBoot, one file per boot, named after a boot counter, such as 0000000005-0000000000.log. The current log is also kept under HKLM\SYSTEM\CurrentControlSet\Control\IntegrityServices\WBCL. The logs exist on Windows 8 and later when a TPM is enabled.
If the log says Secure Boot was on, is the boot chain clean?
No. BlackLotus keeps Secure Boot on and boots only signed loaders before its own. The Secure Boot variable in the log will read enabled. The sign is in the boot applications listed in PCR 4: Microsoft reports that grubx64.efi and winload.efi appear there once BlackLotus is active.
Can an attacker edit or delete the log files?
Yes. They are ordinary files that an administrator can change or remove. Only a quote signed by the host's TPM ties a log to the PCR values it claims to explain, and an offline copy has no quote. Treat a missing or truncated folder as a finding, and a present log as strong but not tamper-proof evidence.
Do I need the host's TPM to read the logs?
No. The files use the TCG event log format and can be decoded on any machine with TCGLogTools, Microsoft's TBSLogGenerator or PCPTool, or tpm2-tools. The TPM is only needed to check that the log matches the live PCR values.
Related articles
Frequently asked questions
Where does Windows keep its Measured Boot logs?
In C:\Windows\Logs\MeasuredBoot, one file per boot, named after a boot counter, such as 0000000005-0000000000.log. The current log is also kept under HKLM\SYSTEM\CurrentControlSet\Control\IntegrityServices\WBCL. The logs exist on Windows 8 and later when a TPM is enabled.
If the log says Secure Boot was on, is the boot chain clean?
No. BlackLotus keeps Secure Boot on and boots only signed loaders before its own. The Secure Boot variable in the log will read enabled. The sign is in the boot applications listed in PCR 4: Microsoft reports that grubx64.efi and winload.efi appear there once BlackLotus is active.
Can an attacker edit or delete the log files?
Yes. They are ordinary files that an administrator can change or remove. Only a quote signed by the host's TPM ties a log to the PCR values it claims to explain, and an offline copy has no quote. Treat a missing or truncated folder as a finding, and a present log as strong but not tamper-proof evidence.
Do I need the host's TPM to read the logs?
No. The files use the TCG event log format and can be decoded on any machine with TCGLogTools, Microsoft's TBSLogGenerator or PCPTool, or tpm2-tools. The TPM is only needed to check that the log matches the live PCR values.