Hacking challenge: steal a car! Your "local partner in - - PowerPoint PPT Presentation

hacking challenge steal a car your local partner in crime
SMART_READER_LITE
LIVE PREVIEW

Hacking challenge: steal a car! Your "local partner in - - PowerPoint PPT Presentation

Hacking challenge: steal a car! Your "local partner in crime" Sawomir Jasek Agenda BLE vs security IT security expert How to hack the car since 2005, and still loves this job New tool Vulnerabilities examples


slide-1
SLIDE 1
slide-2
SLIDE 2

Hacking challenge: steal a car!

slide-3
SLIDE 3

Your "local partner in crime"

Sławomir Jasek

  • IT security expert
  • since 2005, and still loves this job

Agenda

  • BLE vs security
  • How to hack the car
  • New tool
  • Vulnerabilities examples
  • Smart lock
  • Anti-theft device
  • Mobile PoS
  • Other gadgets
  • MITM encrypted BLE?
  • What can we do better
slide-4
SLIDE 4

Bluetooth Smart? (aka Low Energy, 4...)

  • Probably most thriving IoT technology
  • Wearables, sensors, home automation,

household goods, medical devices, door locks, alarms, banking tokens, smart every-things...

  • Completely different than previous

Bluetooth

slide-5
SLIDE 5

BLE (v4.0) security: encryption

  • Pairing (once, in a secure environment)
  • JustWorks (R) – most common, devices without display cannot implement
  • ther
  • 6-digit PIN – if the device has a display
  • Out of band – not yet spotted in the wild
  • "Just Works and Passkey Entry do not provide any passive

eavesdropping protection"

  • Establish Long Term Key, and store it to secure future communication

("bonding")

Mike Ryan, https://www.lacklustre.net/bluetooth/

slide-6
SLIDE 6

BLE (v4.0) security in practice

  • 8 of 10 tested devices do not implement BLE-layer encryption
  • "Forget" to do it, or do not consider clear-text transmission a problem
  • The pairing is in OS level, mobile application does not have full control over it
  • It is troublesome to manage with requirements for:
  • Multiple users/application instances per device
  • Access sharing
  • Cloud backup
  • Public access devices (e.g. cash register)
  • Other hardware/software/UX problems with pairing
slide-7
SLIDE 7

BLE (v4.0) security in practice

  • Security in "application" layer (GATT)
  • Various authentication schemes
  • Static password/key
  • Challenge-response (most common)
  • PKI
  • Own crypto, based usually on AES
  • No single standard, library, protocol

Controller (firmware) Link layer Physical layer Host (OS) Host Card Interface L2CAP SMP ATT GATT UNENCRYPTED

slide-8
SLIDE 8
slide-9
SLIDE 9

Regular users convinced

slide-10
SLIDE 10

So, how to attack the BLE car lock?

  • Remote relay?

Relay Attacks on Passive Keyless Entry and Start Systems in Modern Cars http://eprint.iacr.org/2010/332.pdf

slide-11
SLIDE 11

So, how to attack the BLE car lock?

  • Remote relay?
  • Jamming?
  • Brute force?

Relay Attacks on Passive Keyless Entry and Start Systems in Modern Cars http://eprint.iacr.org/2010/332.pdf http://greatscottgadgets.com/ubertoothone/

slide-12
SLIDE 12

So, how to attack the BLE car lock?

  • Remote relay?
  • Jamming?
  • Brute force?
  • BLE sniffing?
  • Mobile app

analysis?

  • ...
  • MITM?

http://greatscottgadgets.com/ubertoothone/

slide-13
SLIDE 13

Man in the Middle?

Alice Bob Mallory

slide-14
SLIDE 14

How to MITM: isolate the signal?

slide-15
SLIDE 15

How to MITM?

Stronger signal?

  • Class 1 adapter? +8dBm, 100m range

"little difference in range whether the other end of the link is a Class 1 or Class 2 device as the lower powered device tends to set the range limit" https://en.wikipedia.org/wiki/Bluetooth

More signals?

And how to handle them in a single system?

slide-16
SLIDE 16

Typical connection flow

Advertise Connect the advertising device (MAC) Start scanning for advertisements Specific advertisement received, stop scanning Further communication

slide-17
SLIDE 17

MITM

Start scanning for advertisements Advertise more frequently

MITM?

Keep connection to

  • riginal device. It

does not advertise while connected ;) Specific advertisement received, stop scanning Connect the advertising device (MAC) Further communication

slide-18
SLIDE 18

New tool - architecture

Gather advertisement and services data for cloning Keep connection to

  • riginal device

forward req/resp Advertise Get serv services Data interception and manipulation Advertise (high freq) Offer exact services Forward req/resp Get serv services websockets

slide-19
SLIDE 19

New BLE MITM Tool – a must have for IoT tester!

  • Open source
  • Only $10 BT4 USB

dongle needed

  • Works on Raspberry
  • r any Linux
  • Node.js
  • Websockets
  • Modular design
  • And a cool logo!
slide-20
SLIDE 20

Car hacking challenge: authentication

Get "Challenge" Commands (Open, Close...) Random challenge AES("LOGIN",AES(Challenge,key)) AES("LOGIN", AES (Challenge, key NOT ENCRYPTED: Open, Close...

slide-21
SLIDE 21

Authentication: attack?

Close AES("LOGIN", AES (Challenge, key Other cmd

MITM

Get "Challenge" Random challenge AES("LOGIN",AES(Challenge,key))

slide-22
SLIDE 22

Other commands (based on mobile app):

  • initConfigMode – initiate the configuration – overwrite the keys
  • initiateDataTransfer – dump the whole configuration (including all

keys)

slide-23
SLIDE 23

PRNG?

  • Is there any function which allows to generate a random number?
  • There is no function to do this. However, there is a reasonably good

alternative (...), which reads the module's serial number and uses the two least significant bytes, then triggers a channel 14 (temperature) ADC read and combines the two with some very basic math* to generate a sort of "multiplier seed" which can be used for randomness.

* (multiplication of the values by themselves)

https://bluegiga.zendesk.com/entries/59399217-Random-function

slide-24
SLIDE 24

Smart lock

  • Challenge-response, session key
  • Commands encrypted by session key
  • Challenge looks random
  • Ranging: GPS-enabled, you have to leave the area and return
  • What could possibly go wrong?
slide-25
SLIDE 25

Smart lock - protocol

Get "Challenge" Challenge SESSION KEY = AES(Challenge, KEY Commands AES-encrypted by session key

slide-26
SLIDE 26

Smart lock - protocol

Get "Challenge" Challenge SESSION KEY = AES(Challenge, KEY Close lock OK, closed

MITM (intercept, record, pass through)

slide-27
SLIDE 27

Smart lock – attack

Get "Challenge" Challenge (previously intercepted) SESSION KEY = AES(Challenge, KEY Close lock OK, closed (repeat the encrypted)

MITM (replay)

The same as recorded session

OK, CLOSED!

slide-28
SLIDE 28

Smart lock – DEMO

slide-29
SLIDE 29

Smart lock – attack v2

Get "Challenge"

MITM

Do not forward req to device. Advertise status "Closed"

STALL

OK, CLOSED!

slide-30
SLIDE 30

Smart lock: AT commands

  • BLE module AT interface exposed
slide-31
SLIDE 31

AT commands

slide-32
SLIDE 32

AT commands

slide-33
SLIDE 33

AT commands

slide-34
SLIDE 34

Fallback to analog key may be unavailable...

slide-35
SLIDE 35

DEMO: AT commands

slide-36
SLIDE 36

DEMO: Anti-thief

slide-37
SLIDE 37

DEMO: interception – static password

slide-38
SLIDE 38

DEMO: Mobile PoS

slide-39
SLIDE 39

But what about BLE encryption?

Bond – encrypted communication

slide-40
SLIDE 40

"Just Works"

No need for bonding Bond – encrypted communication

MITM

Other MAC (for static attack scenarios not necessary)

slide-41
SLIDE 41

"Just Works"

Bond – encrypted communication

MITM

Cloned MAC

Bond – encrypted communication

?

(for static attack scenarios not necessary)

slide-42
SLIDE 42
slide-43
SLIDE 43

Remove the pairing, now it works again!

Bond – encrypted communication

MITM

Cloned MAC

Bond – encrypted communication

!

New connection

slide-44
SLIDE 44

PIN entry – trick into pairing again, sniff, crack

Bond – encrypted communication

MITM

cloned MAC

slide-45
SLIDE 45

Passive interception of pairing process Crack the PIN using crackle

PIN entry – trick into pairing again, sniff, crack

Bond – encrypted communication

slide-46
SLIDE 46

Some attacks

  • Denial of Service
  • Interception
  • Replay
  • Authentication bypass
  • Proximity actions
  • Misconfiguration/excessive

services abuse

  • Logic flaws
  • Badly designed crypto
  • Brute force
  • Fuzzing
  • ...
slide-47
SLIDE 47

How to fix the problem?

  • Use the BLE security features
  • Encryption, bonding, MAC randomization
  • Do not allow to bond automatically
  • Detect MITM, warn the user
  • Your own mechanisms
  • Do not implement static passwords
  • Design with active interception possibility in mind
  • Beware excessive services, misconfiguration
  • Prepare fallback for Denial of Service
  • ...
  • More details in whitepaper
slide-48
SLIDE 48

Q&A?

More information, these slides, whitepaper, tool source code:

slawomir.jasek@securing.pl @slawekja

slide-49
SLIDE 49

Thanks:

  • My family – for patience and

various favours

  • SecuRing – for funding large

part of this research