SlideShare a Scribd company logo
1 of 35
Download to read offline
Dmitry Sklyarov, Maxim Goryachy
Intel ME: Security keys Genealogy,
Obfuscation and other Magic
2
Research Team
Date Presentation/Paper name
Maxim
Goryachy
Mark
Ermolov
Dmitry
Sklyarov
2016-12-28 Tapping into the Core + +
2017-03-23 Intel ME: The Way of the Static Analysis +
2017-04-14 Intel DCI Secrets + +
2017-08-28 Disabling Intel ME 11 via undocumented mode + +
2017-11-09
Where there's a JTAG, there's a way: obtaining full system
access via USB
+ +
2017-12-06
How to Hack a Turned-Off Computer, or Running
Unsigned Code in Intel Management Engine
+ +
2017-12-06 Intel ME: Flash File System Explained +
2017-12-06 Recovering Huffman tables in Intel ME 11.x +
2017-12-27 Inside Intel Management Engine + +
3
• Security Hardware Overview
• Security Fuses
• Keys Derivation and Storage
• Fun and Magic
Agenda
4
ME Position in Computer System
Intel AMT Release
2.0/2.1/2.2
Architecture
Management Engine (ME)
System Management Mode (SMM)
Hypervisor
OS Kernel
User
Fullcontrol
Limitedinterfaces
5
Security Hardware Overview
6
Intel ME: Security Hardware
AES
Engine
[DMA]
SHA/HMAC
Engine
[DMA]
RSA
Engine
SecureKey
Storage(SKS)
SPI Flash
+Huffman
[DMA]
Security
Fuses
RAM
RC4
Engine
7
• Includes BIOS/UEFI, GbE, ME partition
• Holds code and configuration
• Could operate in conjunction with HMAC Engine
• Has a built-in Huffman Decompressor
SPI Flash + Controller
8
• Slots 1..11 for 128-bit keys, slots 12..21 for 256-bit keys
• Key either loaded directly or obtained as a result of AES/HMAC
• Saved keys can’t be extracted into memory (only used for AES/HMAC)
• Usage policy are supported (e.g. result of AES Encrypt could be stored into
memory or SKS, result of AES Decrypt – only into SKS)
Security Key Storage (SKS)
9
• Keys of 128 and 256 bits are supported
• Supported block chaining modes: ECB, CBC, CTR
• AES keys could be specified directly or obtained from SKS
• Data could be transferred directly or with DMA
AES Engine
10
• Supported hash algorithms: SHA-1, SHA-256, SHA-384, SHA-512
• HMAC key length either 128 or 256 bits
• HMAC keys could be specified directly or obtained from SKS
• Data could be transferred directly or with DMA
• Could operate in conjunction with AES Engine (e.g. Decrypt-than-HMAC)
SHA/HMAC Engine
11
• Capable to perform modular exponentiation
• Used for verification of Digital Signatures (e.g. ROM verifies ME Partition
Manifest integrity before using any data from that partition)
RSA Engine
12
Partition Manifest data
Module Metadata
Module Data
Module Attributes
Extension
SHA256(Module Data)
Partition Info Extension
SHA256(Module Metadata)
Partition Manifest
SHA256(Module data)Header
RSA Signature
SHA256(Partition Manifest
Header + Data)
RSA Public Key
ROM
List of allowed
signature keys
SHA256(RSA Public Key)
RSAPrivateKey
13
• Is it really necessary in HW developed in 2012+?
• Not used for providing security of ME itself
• Probably used by ME applications (for supporting WiFi, SSL, etc.)
RC4 Engine
14
Security Fuses
15
• Initialized at [some] production stage
• Unique values for each PCH-chip (at least, we believe in that)
• Can not be overwritten
• Readable limited number of times (usually just once) after platform reset
• Huge part of ME security is based on confidentiality of fuses (e.g. TPM)
• Partially blocked if JTAG is enabled (even Intel’s engineers can’t get fuses)
Security Fuses
16
Reading Data from Fuses
void __cdecl GetKey(T_KeysInfo *pKI) {
unsigned int size, *pdw;
GEN_status_reg = 1;
while ( GEN_status_reg & 1 );
if ( GEN_status_reg & 8 ) stage_complete(Ev_Gen_BadStatus, GEN_status_reg, 0);
else {
size = (GEN_status_reg >> 0x10) & 0x1FF;
if ( size == 0x9C ) {
pdw = (unsigned int *)&GEN;
.... // Copy bytes from GEN to Memory
}
else if ( size == 0x10 ) {
if ( isOrangeUnlock()) { // JTAG for vendor is enabled
stage_complete(Ev_Gen_NotLoaded,(MEMORY[0xF00B1050] >> 4), 0);
}
else {
*(_DWORD *)pKI->NonIntelKey = *(_DWORD *)GEN.NonIntelKey;
*(_DWORD *)&pKI->NonIntelKey[4] = *(_DWORD *)&GEN.NonIntelKey[4];
*(_DWORD *)&pKI->NonIntelKey[8] = *(_DWORD *)&GEN.NonIntelKey[8];
*(_DWORD *)&pKI->NonIntelKey[0xC] = *(_DWORD *)&GEN.NonIntelKey[0xC];
stage_complete(Ev_Gen_LoadedShort, 0, 0);
}
17
Security Fuses Layout
Wrapped HMAC Key Wrapped EPID Key
0 0x20
0x40 0x48
EPID Non Intel Root KeyfTPM[0..3] CheckSum
0x70
fTPM[4..67]
0x80
0x40
0x44 0x4C
Not used
0x80
0xBC
Completely unknown (for us) value
We are able to get unwrapped value
Could be recovered from data available at runtime
Available on platform that started with JTAG activated
18
Keys Derivation and Storage
19
FS Security Keys
Intel
Integrity
Intel
Confidentiality
Non-Intel
Integrity
Non-Intel
Confidentiality
Intel
Integrity
Intel
Confidentiality
Non-Intel
Integrity
Non-Intel
Confidentiality
RPMC
HMAC #0
RPMC
HMAC #1
Current keys
(for current SVN)
Previous* keys
(optional)
Replay-Protected Monotonic Counter (RPMC)
is optional feature of SPI Flash chip
*Previous keys are calculated if current SVN > 1
and PSVN partition contains valid data.
These keys are used for migrating files
created before the SVN was updated.
There are up to 10 keys involved in FS Security
20
Keys Derivation: File System (ROM)
AES Decrypt SKS[12]
WR HMAC Key
“x00”*32 (?)
HMAC
HMAC
AES Wrap
SKS[1]
Non Intel Root Key HMAC
“CSE Non-Intel Root Key”+SVN
AES Wrap
“CSE Intel Root Key”+SVN
“CSE Wrapping Key”
SKS[21]
curr_keys
(Intel)
curr_keys
(non-Intel)
Security Fuses
KeyData in RAM
Key in SKS
Temporary data
Data
Temporary key in SKS
21
Keys Derivation: File System (BUP)
curr_keys
(Intel)
curr_keys
(non-Intel)
HMACAES Unwrap Key
HMAC Key
AES Wrap
AES Wrap
AES Wrap
AES Wrap
FS
Keys
HMACAES Unwrap Key
HMAC Key
“Confidentiality Intel Key”
“Integrity Intel Key”
“Confidentiality Non-Intel Key”
“Integrity Non-Intel Key”
SKS[21]
SKS[21]
KeyData in RAM
Key in SKS
Temporary data
Data
22
Keys Derivation: Enhanced Privacy ID (EPID)
AES Decrypt SKS[12]
WR HMAC Key
“x00”*32(?)
HMAC
SKS[1]
WR EPID Key
SKS[21]
epid_keys
Security Fuses
AES Decrypt AES Wrap
HMAC
“CSE Memory Guard Key”+SVN
SKS[18]
KeyData in RAM
Key in SKS
Temporary data
Data
Temporary key in SKS
“CSE Wrapping Key”
23
Keys Derivation: fTPM Keys
AES Decrypt SKS[12]
WR HMAC Key
“x00”*32 (?)
HMACSKS[1]
fTPM
“CSE Wrapping Key”
SKS[21]
ftpm_keys
Security Fuses
AES Wrap
HMAC
“CSE Memory Guard Key”+SVN
SKS[18]
HMAC
“CSE fTPM Root Key”
KeyData in RAM
Key in SKS
Temporary data
Data
Temporary key in SKS
24
• Security keys never holds in memory in plaintext
• Usually wrapped by SKS[21] or SKS[18]
• Almost all keys depends on Wrapped HMAC Key (which unavailable)
• Having Code Execution in BUP we could recalculate some keys (but not
Wrapped/Unwrapped HMAC Key == SKS[12])
• Even Intel’s engineers (with JTAG) are unable to get HMAC key
Keys Derivation and Storage Summary
25
Fun and Magic
26
• System partition for «warm» starting (like hibernation restoration)
• Encrypted, integrity protected with HMAC
• Unique for each platform (PCH-chip) and each boot
• If you know IVBP key, you have arbitrary execution on this platform
IVBP (IVB Partition)
27
Keys Derivation: IVBP Key
AES Decrypt SKS[12]
WR HMAC Key
“x00”*32 (?)
HMACSKS[1]
Security Fuses
SKS[19]
“CSE Provisioning Base Key” +SVN
KeyData in RAM
Key in SKS
Temporary data
Data
Temporary key in SKS
28
ROM: Boot stages (it’s about IDLM)
start
Is partition
signature OK?
Find Partition
BootPart[idx]
Yes
idx == 0?
Yes
Lock Fuses
BootPart = {DLMP:idlm,
FTPR:rbe, FTUP:rbe}
idx = 0
idx ++
Read module
PartName[idx]
Is module
hash OK?
Derive
Keys
Yes
Execute
«rbe»
idx <= 2?
end
Yes
Execute
«idlm»
29
• The only place (except ROM) where data read from Fuses is available
• IDLM must be signed with RSA-2048
• SHA-256 for 8 Public RSA Keys are hardcoded in ROM
• 4 of 8 keys can be used for IDLM signing (on tested platforms)
• Owner of permitted RSA signing key can extract HMAC key with IDLM!
• IDLM partition seen “in the wild” on ME 11.8 (svn 3) releases
IDLM module (DLM Partition)
30
• Intel’s engineers implemented complex and well-thought-out security
model for handling keys
• Even Code Execution (in any place except ROM) do not give an attacker
the ability to fully compromise security model
• But IDLM feature looks like backdoor ;)
• And who knows – are Fuses Data really unique and unpredictable?
Conclusion
dsklyarov@ptsecurity.com
mgoryachy@ptsecurity.com
32
Bonus Slides
33
ROM bypass vs ROM
ROM bypass
ROM
parity = check_parity(&g_KeysInfo, 8);
if ( parity == (g_KeysInfo.check & 1) {
pBuf.pb = (unsigned __int8 *)&g_KeysInfo;
pBuf.cb = offsetof(T_KeysInfo, unused);
SHA256(&pBuf, SHAF_Final|SHAF_Init);
pBuf.pb = hash;
pBuf.cb = 32;
SHA256_GetResult(hash, 0);
b1 = (LOBYTE(g_KeysInfo.check) >> 1) & 1;
if ( b1 != is_bit((unsigned int *)hash, 32u)
|| (b2 = (BYTE(g_KeysInfo.check) >> 2) & 1, b2 != is_bit(hash, 69u))
|| (b3 = (BYTE(g_KeysInfo.check) >> 3) & 1, b3 != is_bit(hash, 109u))
|| (b4 = (BYTE(g_KeysInfo.check) >> 4) & 1, b4 != is_bit(hash, 239u))
)
parity = check_parity(&g_KeysInfo, 0x12);// 0x48 bytes
if ( odd == (g_KeysInfo.check & 1) ) {
pBuf.d.pb = (unsigned __int8 *)&g_KeysInfo;
pBuf.cb = 72;
SHA256(&pBuf, SHAF_Final|SHAF_Init);
SHA256_GetResult(hash, 0);
key.u.pb = hash;
key.location = KEY_IN_MEM;
key.cb = 0x20;
out.location = KEY_IN_MEM;
out.u.pdw = adw_mask;
out.cb = 32;
data.d.pb = "CSE_PART_ID";
data.cb = 0x20;
ROM_HMAC_derive_key(&key, &out, 0, &data);
b1 = (LOBYTE(g_KeysInfo.check) >> 1) & 1;
if ( b1 != is_bit(adw_mask, 2u)
|| (b2 = (BYTE(g_KeysInfo.check) >> 2) & 1, b2 != is_bit(adw_mask, 28u))
|| (b3 = (BYTE(g_KeysInfo.check) >> 3) & 1, b3 != is_bit(adw_mask, 47u))
|| (b4 = (BYTE(g_KeysInfo.check) >> 4) & 1, b4 != is_bit(adw_mask, 72u))
)
34
Some Initial Value for AES Engine (in ROM)
st260 = AES_r_st260;
st264 = AES_r_st264;
AES_r_secret[0] = 0xE103F8A3;
AES_r_secret[1] = 0xA4B79CD6;
AES_r_secret[2] = 0x56216728;
AES_r_secret[3] = 0x30E039B6;
if ( g_gen_cfg[0] & 4 )
{
st260 = AES_r_st260 & ~0x12u;
st264 = AES_r_st264 | 1;
}
AES_r_st260 = st260 & ~1u;
AES_r_st264 = st264;
35
Some hardcoded key for AES Engine (in Crypto)
if ( byte_6584F & 1 )
{
v6 = getDW_sel(devAES, 0x260u);
putDW_sel(15, 0x260u, v6 | 4);
}
else
{
putDW_sel(devAES, key0, 0x09CF4F3C);
putDW_sel(devAES, key4, 0xABF71588);
putDW_sel(devAES, key8, 0x28AED2A6);
putDW_sel(devAES, keyC, 0x2B7E1516);
}
putDW_sel(devAES, 0, (*(_BYTE *)a3 == 0) << 6);

More Related Content

What's hot

Android 4.2 Internals - Bluetooth and Network
Android 4.2 Internals - Bluetooth and NetworkAndroid 4.2 Internals - Bluetooth and Network
Android 4.2 Internals - Bluetooth and NetworkCaio Pereira
 
44CON London - Attacking VxWorks: from Stone Age to Interstellar
44CON London - Attacking VxWorks: from Stone Age to Interstellar44CON London - Attacking VxWorks: from Stone Age to Interstellar
44CON London - Attacking VxWorks: from Stone Age to Interstellar44CON
 
Breaking hardware enforced security with hypervisors
Breaking hardware enforced security with hypervisorsBreaking hardware enforced security with hypervisors
Breaking hardware enforced security with hypervisorsPriyanka Aash
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemCyber Security Alliance
 
U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0GlobalLogic Ukraine
 
ARM Architecture and Meltdown/Spectre
ARM Architecture and Meltdown/SpectreARM Architecture and Meltdown/Spectre
ARM Architecture and Meltdown/SpectreGlobalLogic Ukraine
 
Trusted Platform Module (TPM)
Trusted Platform Module (TPM)Trusted Platform Module (TPM)
Trusted Platform Module (TPM)k33a
 
Intel Trusted eXecution Technology
Intel Trusted eXecution TechnologyIntel Trusted eXecution Technology
Intel Trusted eXecution TechnologyBibhu Biswal
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniquesSatpal Parmar
 
Plan de sesion_integrado_18_febrero_2011 -eng-
Plan de sesion_integrado_18_febrero_2011 -eng-Plan de sesion_integrado_18_febrero_2011 -eng-
Plan de sesion_integrado_18_febrero_2011 -eng-Alberto Vargas
 
JA108 Datasheet_v1.8
JA108 Datasheet_v1.8JA108 Datasheet_v1.8
JA108 Datasheet_v1.8Robert Holman
 
LCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLinaro
 

What's hot (18)

Integrity Protection for Embedded Systems
Integrity Protection for Embedded SystemsIntegrity Protection for Embedded Systems
Integrity Protection for Embedded Systems
 
Android 4.2 Internals - Bluetooth and Network
Android 4.2 Internals - Bluetooth and NetworkAndroid 4.2 Internals - Bluetooth and Network
Android 4.2 Internals - Bluetooth and Network
 
44CON London - Attacking VxWorks: from Stone Age to Interstellar
44CON London - Attacking VxWorks: from Stone Age to Interstellar44CON London - Attacking VxWorks: from Stone Age to Interstellar
44CON London - Attacking VxWorks: from Stone Age to Interstellar
 
Breaking hardware enforced security with hypervisors
Breaking hardware enforced security with hypervisorsBreaking hardware enforced security with hypervisors
Breaking hardware enforced security with hypervisors
 
Debugging linux
Debugging linuxDebugging linux
Debugging linux
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem
 
U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0U-boot and Android Verified Boot 2.0
U-boot and Android Verified Boot 2.0
 
ARM Architecture and Meltdown/Spectre
ARM Architecture and Meltdown/SpectreARM Architecture and Meltdown/Spectre
ARM Architecture and Meltdown/Spectre
 
Defense
DefenseDefense
Defense
 
Trusted Computing Base
Trusted Computing BaseTrusted Computing Base
Trusted Computing Base
 
Trusted Platform Module (TPM)
Trusted Platform Module (TPM)Trusted Platform Module (TPM)
Trusted Platform Module (TPM)
 
Intel Trusted eXecution Technology
Intel Trusted eXecution TechnologyIntel Trusted eXecution Technology
Intel Trusted eXecution Technology
 
Txt Introduction
Txt IntroductionTxt Introduction
Txt Introduction
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniques
 
Plan de sesion_integrado_18_febrero_2011 -eng-
Plan de sesion_integrado_18_febrero_2011 -eng-Plan de sesion_integrado_18_febrero_2011 -eng-
Plan de sesion_integrado_18_febrero_2011 -eng-
 
JA108 Datasheet_v1.8
JA108 Datasheet_v1.8JA108 Datasheet_v1.8
JA108 Datasheet_v1.8
 
Character drivers
Character driversCharacter drivers
Character drivers
 
LCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platformLCU14 302- How to port OP-TEE to another platform
LCU14 302- How to port OP-TEE to another platform
 

Similar to CONFidence 2018: Intel ME: Security keys Genealogy, Obfuscation and other Magic (Dmitry Sklyarov, Maxim Goryachy)

Adventures in Underland: Is encryption solid as a rock or a handful of dust?
Adventures in Underland: Is encryption solid as a rock or a handful of dust?Adventures in Underland: Is encryption solid as a rock or a handful of dust?
Adventures in Underland: Is encryption solid as a rock or a handful of dust?Paula Januszkiewicz
 
FIPS 140-2 Validations in a Secure Enclave
FIPS 140-2 Validations in a Secure EnclaveFIPS 140-2 Validations in a Secure Enclave
FIPS 140-2 Validations in a Secure EnclavewolfSSL
 
Linoma CryptoComplete
Linoma CryptoCompleteLinoma CryptoComplete
Linoma CryptoCompleteStuart Marsh
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyJean-François Gagné
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -evechiportal
 
LAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELinaro
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Vincenzo Iozzo
 
ARM® Cortex™ M Bootup_CMSIS_Part_2_3
ARM® Cortex™ M Bootup_CMSIS_Part_2_3ARM® Cortex™ M Bootup_CMSIS_Part_2_3
ARM® Cortex™ M Bootup_CMSIS_Part_2_3Raahul Raghavan
 
Attack your Trusted Core
Attack your Trusted CoreAttack your Trusted Core
Attack your Trusted CoreDi Shen
 
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...Cristofaro Mune
 
Hardware backdooring is practical : slides
Hardware backdooring is practical : slidesHardware backdooring is practical : slides
Hardware backdooring is practical : slidesMoabi.com
 
Optimizing GELI Performance by John-Mark Gurney
  Optimizing GELI Performance by John-Mark Gurney  Optimizing GELI Performance by John-Mark Gurney
Optimizing GELI Performance by John-Mark Gurneyeurobsdcon
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practicalMoabi.com
 
PEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot SecurelyPEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot SecurelyRiscure
 
PEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot SecurelyPEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot SecurelyNiek Timmers
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyJean-François Gagné
 
OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...
OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...
OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...OpenNebula Project
 
OpenNebulaConf 2019 - Crytek: A Video gaming Edge Implementation "on the shou...
OpenNebulaConf 2019 - Crytek: A Video gaming Edge Implementation "on the shou...OpenNebulaConf 2019 - Crytek: A Video gaming Edge Implementation "on the shou...
OpenNebulaConf 2019 - Crytek: A Video gaming Edge Implementation "on the shou...Dmytro Korzhevin
 
EuskalHack 2017 - Secure initialization of TEEs: when secure boot falls short
EuskalHack 2017 - Secure initialization of TEEs: when secure boot falls shortEuskalHack 2017 - Secure initialization of TEEs: when secure boot falls short
EuskalHack 2017 - Secure initialization of TEEs: when secure boot falls shortCristofaro Mune
 

Similar to CONFidence 2018: Intel ME: Security keys Genealogy, Obfuscation and other Magic (Dmitry Sklyarov, Maxim Goryachy) (20)

Adventures in Underland: Is encryption solid as a rock or a handful of dust?
Adventures in Underland: Is encryption solid as a rock or a handful of dust?Adventures in Underland: Is encryption solid as a rock or a handful of dust?
Adventures in Underland: Is encryption solid as a rock or a handful of dust?
 
FIPS 140-2 Validations in a Secure Enclave
FIPS 140-2 Validations in a Secure EnclaveFIPS 140-2 Validations in a Secure Enclave
FIPS 140-2 Validations in a Secure Enclave
 
Linoma CryptoComplete
Linoma CryptoCompleteLinoma CryptoComplete
Linoma CryptoComplete
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash Safety
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
 
LAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEE
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
 
ARM® Cortex™ M Bootup_CMSIS_Part_2_3
ARM® Cortex™ M Bootup_CMSIS_Part_2_3ARM® Cortex™ M Bootup_CMSIS_Part_2_3
ARM® Cortex™ M Bootup_CMSIS_Part_2_3
 
Attack your Trusted Core
Attack your Trusted CoreAttack your Trusted Core
Attack your Trusted Core
 
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
Blue Hat IL 2019 - Hardening Secure Boot on Embedded Devices for Hostile Envi...
 
Hardware backdooring is practical : slides
Hardware backdooring is practical : slidesHardware backdooring is practical : slides
Hardware backdooring is practical : slides
 
Optimizing GELI Performance by John-Mark Gurney
  Optimizing GELI Performance by John-Mark Gurney  Optimizing GELI Performance by John-Mark Gurney
Optimizing GELI Performance by John-Mark Gurney
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical
 
PEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot SecurelyPEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot Securely
 
PEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot SecurelyPEW PEW PEW: Designing Secure Boot Securely
PEW PEW PEW: Designing Secure Boot Securely
 
Demystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash SafetyDemystifying MySQL Replication Crash Safety
Demystifying MySQL Replication Crash Safety
 
Programar para GPUs
Programar para GPUsProgramar para GPUs
Programar para GPUs
 
OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...
OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...
OpenNebulaConf2019 - Crytek: A Video gaming Edge Implementation "on the shoul...
 
OpenNebulaConf 2019 - Crytek: A Video gaming Edge Implementation "on the shou...
OpenNebulaConf 2019 - Crytek: A Video gaming Edge Implementation "on the shou...OpenNebulaConf 2019 - Crytek: A Video gaming Edge Implementation "on the shou...
OpenNebulaConf 2019 - Crytek: A Video gaming Edge Implementation "on the shou...
 
EuskalHack 2017 - Secure initialization of TEEs: when secure boot falls short
EuskalHack 2017 - Secure initialization of TEEs: when secure boot falls shortEuskalHack 2017 - Secure initialization of TEEs: when secure boot falls short
EuskalHack 2017 - Secure initialization of TEEs: when secure boot falls short
 

Recently uploaded

Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfROWELL MARQUINA
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 

Recently uploaded (20)

Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 

CONFidence 2018: Intel ME: Security keys Genealogy, Obfuscation and other Magic (Dmitry Sklyarov, Maxim Goryachy)

  • 1. Dmitry Sklyarov, Maxim Goryachy Intel ME: Security keys Genealogy, Obfuscation and other Magic
  • 2. 2 Research Team Date Presentation/Paper name Maxim Goryachy Mark Ermolov Dmitry Sklyarov 2016-12-28 Tapping into the Core + + 2017-03-23 Intel ME: The Way of the Static Analysis + 2017-04-14 Intel DCI Secrets + + 2017-08-28 Disabling Intel ME 11 via undocumented mode + + 2017-11-09 Where there's a JTAG, there's a way: obtaining full system access via USB + + 2017-12-06 How to Hack a Turned-Off Computer, or Running Unsigned Code in Intel Management Engine + + 2017-12-06 Intel ME: Flash File System Explained + 2017-12-06 Recovering Huffman tables in Intel ME 11.x + 2017-12-27 Inside Intel Management Engine + +
  • 3. 3 • Security Hardware Overview • Security Fuses • Keys Derivation and Storage • Fun and Magic Agenda
  • 4. 4 ME Position in Computer System Intel AMT Release 2.0/2.1/2.2 Architecture Management Engine (ME) System Management Mode (SMM) Hypervisor OS Kernel User Fullcontrol Limitedinterfaces
  • 6. 6 Intel ME: Security Hardware AES Engine [DMA] SHA/HMAC Engine [DMA] RSA Engine SecureKey Storage(SKS) SPI Flash +Huffman [DMA] Security Fuses RAM RC4 Engine
  • 7. 7 • Includes BIOS/UEFI, GbE, ME partition • Holds code and configuration • Could operate in conjunction with HMAC Engine • Has a built-in Huffman Decompressor SPI Flash + Controller
  • 8. 8 • Slots 1..11 for 128-bit keys, slots 12..21 for 256-bit keys • Key either loaded directly or obtained as a result of AES/HMAC • Saved keys can’t be extracted into memory (only used for AES/HMAC) • Usage policy are supported (e.g. result of AES Encrypt could be stored into memory or SKS, result of AES Decrypt – only into SKS) Security Key Storage (SKS)
  • 9. 9 • Keys of 128 and 256 bits are supported • Supported block chaining modes: ECB, CBC, CTR • AES keys could be specified directly or obtained from SKS • Data could be transferred directly or with DMA AES Engine
  • 10. 10 • Supported hash algorithms: SHA-1, SHA-256, SHA-384, SHA-512 • HMAC key length either 128 or 256 bits • HMAC keys could be specified directly or obtained from SKS • Data could be transferred directly or with DMA • Could operate in conjunction with AES Engine (e.g. Decrypt-than-HMAC) SHA/HMAC Engine
  • 11. 11 • Capable to perform modular exponentiation • Used for verification of Digital Signatures (e.g. ROM verifies ME Partition Manifest integrity before using any data from that partition) RSA Engine
  • 12. 12 Partition Manifest data Module Metadata Module Data Module Attributes Extension SHA256(Module Data) Partition Info Extension SHA256(Module Metadata) Partition Manifest SHA256(Module data)Header RSA Signature SHA256(Partition Manifest Header + Data) RSA Public Key ROM List of allowed signature keys SHA256(RSA Public Key) RSAPrivateKey
  • 13. 13 • Is it really necessary in HW developed in 2012+? • Not used for providing security of ME itself • Probably used by ME applications (for supporting WiFi, SSL, etc.) RC4 Engine
  • 15. 15 • Initialized at [some] production stage • Unique values for each PCH-chip (at least, we believe in that) • Can not be overwritten • Readable limited number of times (usually just once) after platform reset • Huge part of ME security is based on confidentiality of fuses (e.g. TPM) • Partially blocked if JTAG is enabled (even Intel’s engineers can’t get fuses) Security Fuses
  • 16. 16 Reading Data from Fuses void __cdecl GetKey(T_KeysInfo *pKI) { unsigned int size, *pdw; GEN_status_reg = 1; while ( GEN_status_reg & 1 ); if ( GEN_status_reg & 8 ) stage_complete(Ev_Gen_BadStatus, GEN_status_reg, 0); else { size = (GEN_status_reg >> 0x10) & 0x1FF; if ( size == 0x9C ) { pdw = (unsigned int *)&GEN; .... // Copy bytes from GEN to Memory } else if ( size == 0x10 ) { if ( isOrangeUnlock()) { // JTAG for vendor is enabled stage_complete(Ev_Gen_NotLoaded,(MEMORY[0xF00B1050] >> 4), 0); } else { *(_DWORD *)pKI->NonIntelKey = *(_DWORD *)GEN.NonIntelKey; *(_DWORD *)&pKI->NonIntelKey[4] = *(_DWORD *)&GEN.NonIntelKey[4]; *(_DWORD *)&pKI->NonIntelKey[8] = *(_DWORD *)&GEN.NonIntelKey[8]; *(_DWORD *)&pKI->NonIntelKey[0xC] = *(_DWORD *)&GEN.NonIntelKey[0xC]; stage_complete(Ev_Gen_LoadedShort, 0, 0); }
  • 17. 17 Security Fuses Layout Wrapped HMAC Key Wrapped EPID Key 0 0x20 0x40 0x48 EPID Non Intel Root KeyfTPM[0..3] CheckSum 0x70 fTPM[4..67] 0x80 0x40 0x44 0x4C Not used 0x80 0xBC Completely unknown (for us) value We are able to get unwrapped value Could be recovered from data available at runtime Available on platform that started with JTAG activated
  • 19. 19 FS Security Keys Intel Integrity Intel Confidentiality Non-Intel Integrity Non-Intel Confidentiality Intel Integrity Intel Confidentiality Non-Intel Integrity Non-Intel Confidentiality RPMC HMAC #0 RPMC HMAC #1 Current keys (for current SVN) Previous* keys (optional) Replay-Protected Monotonic Counter (RPMC) is optional feature of SPI Flash chip *Previous keys are calculated if current SVN > 1 and PSVN partition contains valid data. These keys are used for migrating files created before the SVN was updated. There are up to 10 keys involved in FS Security
  • 20. 20 Keys Derivation: File System (ROM) AES Decrypt SKS[12] WR HMAC Key “x00”*32 (?) HMAC HMAC AES Wrap SKS[1] Non Intel Root Key HMAC “CSE Non-Intel Root Key”+SVN AES Wrap “CSE Intel Root Key”+SVN “CSE Wrapping Key” SKS[21] curr_keys (Intel) curr_keys (non-Intel) Security Fuses KeyData in RAM Key in SKS Temporary data Data Temporary key in SKS
  • 21. 21 Keys Derivation: File System (BUP) curr_keys (Intel) curr_keys (non-Intel) HMACAES Unwrap Key HMAC Key AES Wrap AES Wrap AES Wrap AES Wrap FS Keys HMACAES Unwrap Key HMAC Key “Confidentiality Intel Key” “Integrity Intel Key” “Confidentiality Non-Intel Key” “Integrity Non-Intel Key” SKS[21] SKS[21] KeyData in RAM Key in SKS Temporary data Data
  • 22. 22 Keys Derivation: Enhanced Privacy ID (EPID) AES Decrypt SKS[12] WR HMAC Key “x00”*32(?) HMAC SKS[1] WR EPID Key SKS[21] epid_keys Security Fuses AES Decrypt AES Wrap HMAC “CSE Memory Guard Key”+SVN SKS[18] KeyData in RAM Key in SKS Temporary data Data Temporary key in SKS “CSE Wrapping Key”
  • 23. 23 Keys Derivation: fTPM Keys AES Decrypt SKS[12] WR HMAC Key “x00”*32 (?) HMACSKS[1] fTPM “CSE Wrapping Key” SKS[21] ftpm_keys Security Fuses AES Wrap HMAC “CSE Memory Guard Key”+SVN SKS[18] HMAC “CSE fTPM Root Key” KeyData in RAM Key in SKS Temporary data Data Temporary key in SKS
  • 24. 24 • Security keys never holds in memory in plaintext • Usually wrapped by SKS[21] or SKS[18] • Almost all keys depends on Wrapped HMAC Key (which unavailable) • Having Code Execution in BUP we could recalculate some keys (but not Wrapped/Unwrapped HMAC Key == SKS[12]) • Even Intel’s engineers (with JTAG) are unable to get HMAC key Keys Derivation and Storage Summary
  • 26. 26 • System partition for «warm» starting (like hibernation restoration) • Encrypted, integrity protected with HMAC • Unique for each platform (PCH-chip) and each boot • If you know IVBP key, you have arbitrary execution on this platform IVBP (IVB Partition)
  • 27. 27 Keys Derivation: IVBP Key AES Decrypt SKS[12] WR HMAC Key “x00”*32 (?) HMACSKS[1] Security Fuses SKS[19] “CSE Provisioning Base Key” +SVN KeyData in RAM Key in SKS Temporary data Data Temporary key in SKS
  • 28. 28 ROM: Boot stages (it’s about IDLM) start Is partition signature OK? Find Partition BootPart[idx] Yes idx == 0? Yes Lock Fuses BootPart = {DLMP:idlm, FTPR:rbe, FTUP:rbe} idx = 0 idx ++ Read module PartName[idx] Is module hash OK? Derive Keys Yes Execute «rbe» idx <= 2? end Yes Execute «idlm»
  • 29. 29 • The only place (except ROM) where data read from Fuses is available • IDLM must be signed with RSA-2048 • SHA-256 for 8 Public RSA Keys are hardcoded in ROM • 4 of 8 keys can be used for IDLM signing (on tested platforms) • Owner of permitted RSA signing key can extract HMAC key with IDLM! • IDLM partition seen “in the wild” on ME 11.8 (svn 3) releases IDLM module (DLM Partition)
  • 30. 30 • Intel’s engineers implemented complex and well-thought-out security model for handling keys • Even Code Execution (in any place except ROM) do not give an attacker the ability to fully compromise security model • But IDLM feature looks like backdoor ;) • And who knows – are Fuses Data really unique and unpredictable? Conclusion
  • 33. 33 ROM bypass vs ROM ROM bypass ROM parity = check_parity(&g_KeysInfo, 8); if ( parity == (g_KeysInfo.check & 1) { pBuf.pb = (unsigned __int8 *)&g_KeysInfo; pBuf.cb = offsetof(T_KeysInfo, unused); SHA256(&pBuf, SHAF_Final|SHAF_Init); pBuf.pb = hash; pBuf.cb = 32; SHA256_GetResult(hash, 0); b1 = (LOBYTE(g_KeysInfo.check) >> 1) & 1; if ( b1 != is_bit((unsigned int *)hash, 32u) || (b2 = (BYTE(g_KeysInfo.check) >> 2) & 1, b2 != is_bit(hash, 69u)) || (b3 = (BYTE(g_KeysInfo.check) >> 3) & 1, b3 != is_bit(hash, 109u)) || (b4 = (BYTE(g_KeysInfo.check) >> 4) & 1, b4 != is_bit(hash, 239u)) ) parity = check_parity(&g_KeysInfo, 0x12);// 0x48 bytes if ( odd == (g_KeysInfo.check & 1) ) { pBuf.d.pb = (unsigned __int8 *)&g_KeysInfo; pBuf.cb = 72; SHA256(&pBuf, SHAF_Final|SHAF_Init); SHA256_GetResult(hash, 0); key.u.pb = hash; key.location = KEY_IN_MEM; key.cb = 0x20; out.location = KEY_IN_MEM; out.u.pdw = adw_mask; out.cb = 32; data.d.pb = "CSE_PART_ID"; data.cb = 0x20; ROM_HMAC_derive_key(&key, &out, 0, &data); b1 = (LOBYTE(g_KeysInfo.check) >> 1) & 1; if ( b1 != is_bit(adw_mask, 2u) || (b2 = (BYTE(g_KeysInfo.check) >> 2) & 1, b2 != is_bit(adw_mask, 28u)) || (b3 = (BYTE(g_KeysInfo.check) >> 3) & 1, b3 != is_bit(adw_mask, 47u)) || (b4 = (BYTE(g_KeysInfo.check) >> 4) & 1, b4 != is_bit(adw_mask, 72u)) )
  • 34. 34 Some Initial Value for AES Engine (in ROM) st260 = AES_r_st260; st264 = AES_r_st264; AES_r_secret[0] = 0xE103F8A3; AES_r_secret[1] = 0xA4B79CD6; AES_r_secret[2] = 0x56216728; AES_r_secret[3] = 0x30E039B6; if ( g_gen_cfg[0] & 4 ) { st260 = AES_r_st260 & ~0x12u; st264 = AES_r_st264 | 1; } AES_r_st260 = st260 & ~1u; AES_r_st264 = st264;
  • 35. 35 Some hardcoded key for AES Engine (in Crypto) if ( byte_6584F & 1 ) { v6 = getDW_sel(devAES, 0x260u); putDW_sel(15, 0x260u, v6 | 4); } else { putDW_sel(devAES, key0, 0x09CF4F3C); putDW_sel(devAES, key4, 0xABF71588); putDW_sel(devAES, key8, 0x28AED2A6); putDW_sel(devAES, keyC, 0x2B7E1516); } putDW_sel(devAES, 0, (*(_BYTE *)a3 == 0) << 6);