Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott...

51
Kasper & Oswald GmbH, Bochum, Ruhrpott www.kasper-oswald.de Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks, Reverse Engineering, and more David Oswald Vector Testing Symposium

Transcript of Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott...

Page 1: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

Kasper & Oswald GmbH, Bochum, Ruhrpott

www.kasper-oswald.de

Stuttgart, 7. Mai 2019

Testing the Security of Embedded Systems: Side-Channel Attacks,Reverse Engineering, and more

David Oswald

Vector Testing Symposium

Page 2: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

2

Classical IT security (software, interfaces)

Page 3: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

3

Embedded security (hardware, firmware,

interfaces)

CC-BY-SA-3.0Albert Belchers

Page 4: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

4

Research Question:

Security of Embedded Devices?

Page 5: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

5

An implementation attack ...

Page 6: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

6

Principle of Side-Channel Analysis(here: listen to Sound)

A Bank Robbery

Page 7: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

7

Principle of Side-Channel Analysis

The world is changing…

Page 8: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

8

Principle of Side-Channel Analysis(Monitor the power consumption / run-time)

The world is changing…

…the tools are, too.

Page 9: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

9

Page 10: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

10

Page 11: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

Case Study:Remote Keyless Entry

Page 12: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

12

Remote Keyless Entry (1)Uni-directional

First systems: Fixed code

123xbhdsgf …123xbhdsgf …123xbhdsgf …

Page 13: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

14

Remote Keyless Entry (2)Uni-directional with Crypto

Industry reacts: Rolling code

encrypt(124)encrypt(125)

Cipher

Page 14: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

15

Remote Keyless Entry (2)Uni-directional with Crypto

Industry reacts: Rolling code

encrypt(124)encrypt(125)

Cipher

BUT there are attacks ...

Option 1:Attack key management

Option 2:Attack crypto

Page 15: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

Side-Channel Attacks on KeeLoq

(Crypto 2008)

Page 16: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

17

Side-Channel Analysis of KeeLoq:Management Summary

Power analysis attack (with physical access):

clone a remote control from 10 power measurements

obtain manufacturer key from 1 power measurement

Flaw of KeeLoq system:

Key derivation from manufacturer key kM

– kremote_control = f(#ser, kM)

– kM used in every receiver of manufacturer M

– Single point-of-failure

Page 17: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

18

Case Study: KeeLoq RollcodeGerman TV (3Sat NANO, 2008)

Page 18: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

Automotive RKE(Usenix 2016)

Page 19: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

20

Santa‘s Problem

Page 20: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

21

Santa’s Secret: RKE of Cars

Page 21: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

So how did Santa do it?

22

Page 22: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

23

VW Group RKE

Step 1: Eavesdropping & decoding

Page 23: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

Step 2: Obtain ECUs for analysis (eBay) ...

24

Page 24: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

25

25

Page 25: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

26

26

Page 26: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

27

27

Page 27: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

28

Reverse engineering

Step 3: Reverse-engineering ECUs

Page 28: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

29

Management Summary

VW Group: secure crypto ≠ secure system

• extract a few worldwide keys

instantly copy a remote control from 1 signal

• RF attack highly practical and scalable

Page 29: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

30

VW Group: Affected Vehicles

• Audi: A1, Q3, R8, S3, TT, other types of Audi cars (e.g. remote control 4D0 837 231)

• VW: Amarok, (New) Beetle, Bora, Caddy, Crafter, e-Up, Eos, Fox, Golf 4, Golf 5, Golf 6, Golf Plus, Jetta, Lupo, Passat, Polo, T4, T5, Scirocco, Sharan, Tiguan, Touran, Up

• Seat: Alhambra, Altea, Arosa, Cordoba, Ibiza, Leon, MII, Toledo

• Skoda: City Go, Roomster, Fabia 1, Fabia 2, Octavia, Superb, Yeti

• In summary: most VW group vehicles between 1995 and 2016/17 except the new Golf 7 (MQB) platform

Page 30: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

31

Hitag2 RKE Attack Demo

Page 31: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

32

Vehicles we tested using Hitag2 RKE

Opel | Astra H | 2008Opel | Corsa D | 2009Fiat | Grande Punto | 2009

Page 32: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

33

Management Summary

VW Group: secure crypto ≠ secure system

• extract a few worldwide keys

instantly copy a remote control from 1 signal

• RF attack highly practical and scalable

Hitag2: diversified keys but bad crypto

• eavesdrop ≈ 4 to 8 signals (key presses)

copy remote control with some computations

Poor crypto is bad, but poor key management is worse.

Page 33: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

Case Study: RFID Cards

Page 34: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

36

Examples for RFID cards w/ crypto

Broken crypto

• 125 kHz: Hitag 1/2/S, Megamos, …

• 13.56 MHz: Mifare Classic, HID iClass, Legic Prime, …

Cloning possible with medium effortsSecure crypto

• 13,56 MHz: Mifare DESfire EV1/2, NXP SmartMX, Infineon SLE XX, JCOP, …

Cloning „impossible“

Unknown: Legic Advant

Page 35: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

KeeLoq(Crypto 2008)

Page 36: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

38

Analysis of the ID-Card 1/2 Extracting Keys

• test our key-recovery on ID-Card extraction of all secret keys

• another ID-Card contains the same keys

• a third ID-Card contains the same keys

...• surprising discovery:

All ID-Cards have identical keys !

38

Page 37: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

39

Real-World Tests

• clone ID-Cards (copy to blank card)

payments with clones accepted ?

• modify credit balances payments with “counterfeit money” possible ?

• production of “new” cards (new card number) pay with arbitrarily generated cards ?

No effective countermeasures in the back-end !

Page 38: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

40

new issued cards are Mifare DESfire (EV1)

old Mifare Classic cards are still working

improved backend: shadow accounts are used(…and still manually checked…)

Analysis of a Contactless Payment System5 years after the Attack ….

Improve

Report flaws

Page 39: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

41

as a Virtual Wallet

Page 40: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

A Versatile NFC Emulator and more

Page 41: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

43

2006: Kaffeetassen Transponder(Coffee Cup Tag)

Page 42: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

44

Rev.E

open source project: https://github.com/emsec/ChameleonMini

• 8 card slots

• Integratedantenna

• Improved USBcommand set

• Widespread

Page 43: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

45

Rev.Evisits the University of Aveiro, Portugal, Part 1: Barriers

Page 44: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

46

Rev.G

• (Basic) RFID Reader• ATXMega128 + FRAM• Li-Ion Battery

• 8 virtual card slots• ISO 14443/ ISO 15693• Log Mode

Page 45: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

47

and E-Mobility(“Ladekarten” used all over Europe)

Source: https://github.com/emsec/ChameleonMini/issues/140

Identify with UID ofMifare Classic …

Page 46: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

48

and E-Mobility

Source: youtube

Page 47: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

What to do?A system designer‘s

perspective

Page 48: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

50

Secure Against Cyber Attacks

Page 49: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

51

A System Designer‘s Perspective:How to Secure The Internet of Things?

Use standard crypto and standard protocols

Test the security of your system!

Implementation attacks: Practical threat, but:

– Use certified devices (secure hardware)

– Algorithmic countermeasures (secure software)

System level: Second line of defense!

– Shadow accounts / Logging (detect fraud)

– Key diversification (minimize impact)

– Fallback plan (update, notify, …)

Page 50: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

52

Expect the unexpected.

Page 51: Testing the Security of Embedded Systems: Side-Channel ......Kasper & Oswald GmbH, Bochum, Ruhrpott Stuttgart, 7. Mai 2019 Testing the Security of Embedded Systems: Side-Channel Attacks,

Thank you!

Questions? Comments?

Contact: [email protected]

www.kasper-oswald.com