
Entschlüsselt Intel-Atom-Mikrocode-Updates und entpackt XuCode mit wiederhergestellten RC4-Schlüsseln, wodurch interne CPU-Mikrocode-Strukturen für die Hardware-Sicherheitsforschung offengelegt werden.
Alle Informationen werden ausschließlich zu Bildungszwecken bereitgestellt. Befolgen Sie diese Anweisungen auf eigene Gefahr. Weder die Autoren noch ihr Arbeitgeber sind für direkte oder Folgeschäden oder Verluste verantwortlich, die dadurch entstehen, dass eine Person oder Organisation auf der Grundlage der auf dieser Seite enthaltenen Informationen handelt oder nicht handelt.
Anfang 2020 entdeckten wir die Red-Unlock-Technik, mit der sich Intel-Atom-Mikrocode extrahieren lässt. Wir konnten die interne Struktur des Mikrocodes und anschließend die Implementierung von x86-Instruktionen untersuchen. Außerdem haben wir das Format der Mikrocode-Updates, den Algorithmus und den zum Schutz des Mikrocodes verwendeten Verschlüsselungsschlüssel wiederhergestellt (siehe RC4).
Nein, das können Sie nicht. Unterstützt wird nur die Entschlüsselung, da der Mikrocode eine RSA-Signatur zum Integritätsschutz besitzt.
Ein Entschlüsselungsschlüssel für Mikrocode-Updates hängt von der CPU-Generation ab. Wir haben Schlüssel für die Intel-Gemini-Lake- (Goldmont-Plus-Mikroarchitektur) und Intel-Apolo-Lake- (Goldmont-Mikroarchitektur) Generation extrahiert. Siehe Liste der unterstützten CPUs
Mithilfe von Schwachstellen in Intel TXE haben wir den undokumentierten Debug-Modus „Red Unlock“ aktiviert und Dumps des Mikrocodes direkt aus der CPU extrahiert. Darin fanden wir die Schlüssel und den Algorithmus.
Siehe unsere Vorträge Chip Red Pill: How We Achived to Execute Arbitrary Microcode Inside Intel Atom CPUs von der OffensiveCon22.
Alle unsere Skripte sind in Python geschrieben. Wir empfehlen die Verwendung von Python 3. Die Skripte benötigen das Paket pycryptodome. Führen Sie zum Installieren von pycryptodome den folgenden Befehl aus:
pip3 install pycryptodome
Führen Sie das Skript dec_uUpd_Atom_apl.py für Apolo-Lake-CPUs aus:
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
Führen Sie das Skript dec_uUpd_xu_Atom_glp.py für Gemini-Lake-CPUs aus:
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
Führen Sie das Skript XuUnp.py für Goldmont-Plus-CPUs aus:
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 ist der Softwareteil der SGX-Technologie; in das Mikrocode-Update sind ELF-Dateien integriert.

Siehe: XuCode: An Innovative Technology for Implementing Complex Instruction Flows
Das Mikrocode-Update kann für folgende CPUs entschlüsselt werden:
Mark Ermolov (@_markel___)
Maxim Goryachy (@h0t_max)
Dmitry Sklyarov (@_Dmit)
| Prozessormodell | Mikroarchitektur | SGX-/XuCode-Unterstützung |
|---|
| 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 | + |