
Intel Atomマイクロコード更新を復号し、復元したRC4キーでXuCodeを展開して、ハードウェアセキュリティ研究向けに内部CPUマイクロコード構造を明らかにします。
すべての情報は教育目的でのみ提供されています。これらの手順は自己責任で実行してください。著者およびその雇用主は、このページに含まれる情報に基づいて行動または不作為を行った個人や組織から生じる直接的または結果的な損害または損失について一切責任を負いません。
2020年の初めに、私たちは Intel Atom Microcode を抽出できる Red Unlock 技術を発見しました。マイクロコードの内部構造と x86 命令の実装を調査することができました。また、マイクロコードアップデートの形式、アルゴリズム、およびマイクロコードを保護するために使用される暗号化キーを復元しました(RC4 を参照)。
いいえ、できません。マイクロコードには完全性保護のためのRSA署名があるため、復号のみがサポートされています。
マイクロコードアップデートの復号鍵はCPU世代に依存します。Intel Gemini Lake(Goldmont Plusマイクロアーキテクチャ)世代とIntel Apolo Lake(Goldmontマイクロアーキテクチャ)世代の鍵を抽出しました。サポート対象CPUの一覧 を参照してください。
Intel TXEの脆弱性を利用して、red unlockと呼ばれる非公開のデバッグモードを有効化し、CPUから直接マイクロコードのダンプを抽出しました。その中から鍵とアルゴリズムを発見しました。
OffensiveCon22での私たちの講演 Chip Red Pill: How We Achived to Execute Arbitrary Microcode Inside Intel Atom CPUs を参照してください。
すべてのスクリプトは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ファイルがマイクロコードアップデートに統合されています。

参照: XuCode: An Innovative Technology for Implementing Complex Instruction Flows
次の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 | + |