查找两个 UEFI 固件版本之间的变化?

逆向工程 固件 补丁反转 BIOS
2021-06-17 03:21:16

我已经通过内置的闪存实用程序保存了当前在我的主板上运行的 UEFI 固件的副本。现在我想将固件转储与制造商的最新固件更新进行比较,以找出两个版本之间的变化。这两个文件都是Intel serial flash for PCH ROM.

我想确保新版本不是恶意的,并且我无法以任何其他方式验证完整性,因为制造商不提供任何校验和并且更新只能通过普通 HTTP 获得。但是,我不确定如何开始。

内置闪存实用程序必须将系统特定数据添加到固件转储中,因为每次我保存固件时,它都有不同的哈希值。我想这应该以某种方式剥离以防止它使过程复杂化......

非常感谢有关我如何开始的任何提示、建议等。

1个回答

由于 NVRAM 数据(基本上需要在启动或什至 BIOS 更新之间保存的设置,例如启动设备、RAM 时序、序列号/MAC 地址等),转储可能会有所不同。包含代码的固件卷的内容不应在引导之间更改。

我知道至少有两个选项可以检查 UEFI ROM 转储之间的差异:

  • UEFITool或姊妹项目 UEFIextract:提取两个图像,然后使用标准文件比较工具(例如 Beyond Compare 或 even diff进行比较

  • chipsec项目有一个白名单模块,用于验证 UEFI 模块列表没有改变:


该模块可以从 (U)EFI 固件文件或
从闪存 ROM 中提取EFI 可执行文件列表,然后
根据此 [预期/白名单] 可执行文件列表检查闪存 ROM 或文件中的固件映像

Usage:

  ``chipsec_main -m tools.uefi.whitelist [-a generate|check,<json>,<fw_image>]``

    - ``generate``  Generates a list of EFI executable binaries from the UEFI

                        firmware image (default)

    - ``check``     Decodes UEFI firmware image and checks all EFI executable

                        binaries against a specified list

    - ``json``      JSON file with configuration of white-listed EFI

                        executables (default = ``efilist.json``)

    - ``fw_image``  Full file path to UEFI firmware image. If not specified,

                        the module will dump firmware image directly from ROM



Examples:



>>> chipsec_main -m tools.uefi.whitelist



Creates a list of EFI executable binaries in ``efilist.json`` from the firmware

image extracted from ROM



>>> chipsec_main -i -n -m tools.uefi.whitelist -a generate,efilist.json,uefi.rom



Creates a list of EFI executable binaries in ``efilist.json`` from ``uefi.rom``

firmware binary 



>>> chipsec_main -i -n -m tools.uefi.whitelist -a check,efilist.json,uefi.rom



Decodes ``uefi.rom`` UEFI firmware image binary and checks all EFI executables

in it against a list defined in ``efilist.json``

请注意,BIOS 更新本质上意味着某些模块会发生变化(由于错误修复/新功能等),但这至少应该让您知道哪些特定部分发生了变化,甚至可以详细检查它们。