所有信息仅供教育目的使用。请自行承担遵循这些说明的风险。对于任何个人或组织基于本页信息行事或未行事而产生的任何直接或间接损害或损失,作者及其雇主均不承担责任。
2020 年初,我们发现了 Red Unlock 技术,该技术能够提取 Intel Atom 微码。我们得以研究微码的内部结构,进而研究 x86 指令的实现。此外,我们还还原了微码更新的格式、算法以及用于保护微码的加密密钥(参见 RC4)。
不,你不能。仅支持解密,因为微码具有用于完整性保护的 RSA 签名。
微码更新解密密钥取决于 CPU 世代。我们已为 Intel Gemini Lake(Goldmont Plus 微架构)和 Intel Apolo Lake(Goldmont 微架构)世代提取了密钥。参见支持的 CPU 列表
我们利用 Intel TXE 中的漏洞激活了一种未公开的调试模式,称为 red unlock,并直接从 CPU 中提取了微码转储。我们在其中找到了密钥和算法。
请观看我们在 OffensiveCon22 上的演讲 Chip Red Pill:我们如何在 Intel Atom CPU 内部执行任意微码。
我们所有的脚本均使用 Python 编写。建议使用 Python 3。这些脚本需要 pycryptodome 包。要安装 pycryptodome,请运行以下命令:
pip3 install pycryptodome
针对 Apolo Lake CPU,运行脚本 dec_uUpd_Atom_apl.py:
C:\microcode>py -3 dec_uUpd_Atom_apl.py cpu506C9_plat03_ver00000040_2020-02-27_PRD_2FC3D618_.bin
Hash matched at length 0x3E00 (15872)
Data entropy: 6.898306
针对 Gemini Lake CPU,运行脚本 dec_uUpd_xu_Atom_glp.py:
C:\microcode>py -3 dec_uUpd_xu_Atom_glp.py cpu706A8_plat01_ver00000018_2020-06-09_PRD_1D9A5DFE.bin
Patch hash matched: enc size: 0x3480
Patch data entropy: 6.438890
XuCode hash matched: size: 0xed40
XuCode data entropy: 7.752765
针对 Goldmont Plus CPU,运行脚本 XuUnp.py:
C:\microcode>py -3 XuUnp.py cpu706A8_plat01_ver00000018_2020-06-09_PRD_1D9A5DFE.bin.xu.dec
Processing cpu706A8_plat01_ver00000018_2020-06-09_PRD_1D9A5DFE.bin.xu.dec
. ELF at 0x28
. Parking: 0xD58+944
. XuRT: 0x16EC+D404
. Decompressing 54276 -> 101448, be patient...
+ Unpacked OK

XuCode 是 SGX 技术的软件部分,微码更新中集成了 ELF 文件。

以下 CPU 的微码更新可以被解密:
Mark Ermolov (@_markel___)
Maxim Goryachy (@h0t_max)
Dmitry Sklyarov (@_Dmit)
| 处理器型号 | 微架构 | SGX / XuCode 支持 |
|---|
| Pentium J4205 | Goldmont, Apollo Lake | - |
| Celeron J3455 | Goldmont, Apollo Lake | - |
| Celeron J3355 | Goldmont, Apollo Lake | - |
| Pentium N4200 | Goldmont, Apollo Lake | - |
| Celeron N3450 | Goldmont, Apollo Lake | - |
| Celeron N3350 | Goldmont, Apollo Lake | - |
| Atom x7 E3940 | Goldmont, Apollo Lake | - |
| Atom x5 E3930 | Goldmont, Apollo Lake | - |
| Atom x7 A3960 | Goldmont, Apollo Lake | - |
| Atom x7 A3950 | Goldmont, Apollo Lake | - |
| Atom x5 A3940 | Goldmont, Apollo Lake | - |
| Atom x5 A3930 | Goldmont, Apollo Lake | - |
| Atom C3958 | Goldmont, Denverton | - |
| Atom C3955 | Goldmont, Denverton | - |
| Atom C3858 | Goldmont, Denverton | - |
| Atom C3850 | Goldmont, Denverton | - |
| Atom C3830 | Goldmont, Denverton | - |
| Atom C3808 | Goldmont, Denverton | - |
| Atom C3758 | Goldmont, Denverton | - |
| Atom C3750 | Goldmont, Denverton | - |
| Atom C3708 | Goldmont, Denverton | - |
| Atom C3558 | Goldmont, Denverton | - |
| Atom C3538 | Goldmont, Denverton | - |
| Atom C3508 | Goldmont, Denverton | - |
| Atom C3338 | Goldmont, Denverton | - |
| Atom C3308 | Goldmont, Denverton | - |
| Pentium Silver J5005 | Goldmont Plus, Gemini Lake | + |
| Celeron J4105 | Goldmont Plus, Gemini Lake | + |
| Celeron J4005 | Goldmont Plus, Gemini Lake | + |
| Pentium Silver N5000 | Goldmont Plus, Gemini Lake | + |
| Celeron N4100 | Goldmont Plus, Gemini Lake | + |
| Celeron N4000 | Goldmont Plus, Gemini Lake | + |
| Pentium Silver N5030 | Goldmont Plus, Gemini Lake Refresh | + |
| Celeron N4120 | Goldmont Plus, Gemini Lake Refresh | + |
| Celeron N4020 | Goldmont Plus, Gemini Lake Refresh | + |