design, implementation, and evaluation of secure cyber ...design, implementation, and evaluation of...

77
PhD Thesis Defense 2019 @ SUTD Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems Daniele Antonioli Singapore University of Technology and Design (SUTD) Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems 1

Upload: others

Post on 14-Jul-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

PhD Thesis Defense 2019 @ SUTD

Design, Implementation, and Evaluation of SecureCyber-Physical and Wireless Systems

Daniele Antonioli

Singapore University of Technology and Design (SUTD)

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems 1

Page 2: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Design, Implementation, and Evaluation of SecureCyber-Physical and Wireless Systems

• Thesis’s structureI Part I: Cyber-physical systems security (Chapter 1-5)I Part II: Wireless systems security (Chapter 6-10)I TL;DR: Read sections 1.3 and 6.3

• Main collaborationsI SUTD (P. Szalachowski), University of Oxford (K. Rasmussen), and CISPA (N. O.

Tippenhauer)

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems Introduction 2

Page 3: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Cyber-Physical Systems (CPS)

• Interconnected devices managing a physical processI Information technology (IT)I Operational technology (OT)

Sensor

42.42

SensorsActuators

Sensor

42.42

SensorsActuators

Sensor

42.42

SensorsActuators

L1 Network

HMI

Switch

HMI

SCADA

Remote IO

PLC1a PLC1b

PLCPLC

L0 Network

RIO

Process 1

Remote IO

PLCPLC

L0 Network

RIO

Process 2

Remote IO

PLCPLC

L0 Network

RIO

Process n

...

...

PLC2a PLC2b PLCna PLCnb

HMI

Historian

Internet

VPN/Gateway

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CPS Security 3

Page 4: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Cyber-Physical Systems (CPS) Security

• Securing CPS is paramount, yet challengingI Cyber, physical, and cyber-physical attacksI Wired and wireless connections (to the Internet)

• High impact attacks on CPSI E.g. Stuxnet (nuclear), BlackEnergy (smart grid), TRISIS/TRITON (safety)

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CPS Security 4

Page 5: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

CPS Security Challenges and Research Questions

• C1: Evaluation of CPS (IT and OT) technologiesI Q1: Can we build a low-cost real-time simulation environment for CPS? [CPS-SPC15]

• C2: Cyber-physical attacksI Q2: Can we detect and mitigate cyber-physical attacks? [CPS-SPC16]

• C3: CPS security educationI Q3: Can we fill the gaps between IT and OT security professionals? [CPS-SPC17]

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CPS Security 5

Page 6: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

MiniCPS: A toolkit for security research on CPS networks[CPS-SPC15]

• Q1: Can we build a low-cost real-time simulation environment for CPS?

(C)yber −→ Network Emulation(P)hysical −→ Physical Layer Simulation and API(S)ystem −→ Simulation of Control Devices

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CPS Security 6

Page 7: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

MiniCPS: A toolkit for security research on CPS networks[CPS-SPC15]

• Q1: Can we build a low-cost real-time simulation environment for CPS?

(C)yber −→ Network Emulation(P)hysical −→ Physical Layer Simulation and API(S)ystem −→ Simulation of Control Devices

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CPS Security 6

Page 8: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Towards high-interaction virtual ICS honeypots-in-a-box[CPS-SPC16]

• Q2: Can we detect and mitigate cyber-physical attacks?High-Interaction virtual honeypot

Real ICS/SCADA system

SIS

Simulated PLC

Simulated HMI

AttackerGateway

PLC

HMI

PLC

Gateway

ICS networkSSH

Telnet

Device

Gateway

SSHTelnet

Device

VPN PLC

Internet

Emulatednetwork

VPN

PhysicalProcess

Simulation

PhysicalProcess

High Interaction −→ Simulate physical process and ICS devicesVirtual −→ Linux container virtualizationIn–a-box −→ Runs on a single Linux kernel

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CPS Security 7

Page 9: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Towards high-interaction virtual ICS honeypots-in-a-box[CPS-SPC16]

• Q2: Can we detect and mitigate cyber-physical attacks?

SDNController

SwitchPhysicalProcess

Simulation

PhysicalLayerAPI

Gateway192.168.1.77

Attacker

Internet

Attacker

Internet

Device192.168.1.76

PLC4192.168.1.40

VPNVPN

SSHTelnetSSH

Telnet

PLC3192.168.1.30

PLC2192.168.1.20

PLC1192.168.1.10

HMI192.168.1.100

EtherNet/IP

High-Interaction virtual honeypot

High Interaction −→ Simulate physical process and ICS devicesVirtual −→ Linux container virtualizationIn–a-box −→ Runs on a single Linux kernel

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CPS Security 7

Page 10: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Gamifying ICS Security Training and Research: Design,Implementation, and Results of S3 [CPS-SPC17]

• Q3: Can we fill the gaps between IT and OT security professionals?

• SWaT Security Showdown (S3) contestI ICS-centric, gamified security competitionI We run it at SUTD in 2016 and 2017I IT and OT security professionals from academia and industry

• MiniCPS based security challengesI Evaluate MiniCPS as an educational toolI E.g. MitM attacks, sensor and actuator manipulations

• Main outcomesI Conducted (novel) attacksI Evaluated (novel) defenses

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CPS Security 8

Page 11: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

CPS includes Wireless Communication Systems

• Wireless systems (thesis’s Part II)I Transmission and reception of electro-magnetic (EM) signalsI Over a wireless physical layer (e.g. over the air)

• Pervasive use casesI Mobile communications: Wi-Fi, Bluetooth, and cellularI Localization: GPS and RFID

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems Wireless Security 9

Page 12: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Wireless Systems Security

• Wireless systems security is important, yet hardI Wireless channel is broadcastI Threats: eavesdropping, jamming, etc.

• Recent high impact attacksI Wi-Fi: Key Reinstallation AttaCK (KRACK) on WPA2I Bluetooth: BlueBorne implementation flaws on Android and Linux

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems Wireless Security 10

Page 13: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Our Wireless Security Challenges and Research Questions

• C1: Wireless physical layer as a defense mechanismI Q1: Can we leverage deployed physical layer features to secure communications?

[CANS17]

• C2: Complexity and accessibility of wireless technologiesI Q2: Can we analyze and evaluate (proprietary) wireless technologies? [NDSS19]

• C3: Security evaluations and hardening of wireless technologiesI Q3: Can we harden already deployed technologies? [USEC19]

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems Wireless Security 11

Page 14: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Our Wireless Security Challenges and Research Questions

• C1: Wireless physical layer as a defense mechanismI Q1: Can we leverage deployed physical layer features to secure communications?

[CANS17]

• C2: Complexity and accessibility of wireless technologiesI Q2: Can we analyze and evaluate (proprietary) wireless technologies? [NDSS19]

• C3: Security evaluations and hardening of wireless technologiesI Q3: Can we harden already deployed technologies? [USEC19]

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems Wireless Security 11

Page 15: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

C1: Wireless physical layer as a defense mechanism

• Physical layer (PHY)I From bits to EM signals and vice versa

• Wireless PHY securityI Security guarantees from some physical layer featuresI E.g. beamforming

• Q1: Can we leverage deployed physical layer features to secure communications?I Practical Evaluation of Passive COTS Eavesdropping in 802.11b/n/ac WLAN [CANS17]

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Motivation 12

Page 16: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Practical Evaluation of Passive COTS Eavesdropping in802.11b/n/ac WLAN [CANS17]

• IEEE 802.11 PHY featuresI 802.11b: single antenna, omnidirectional (SISO)I 802.11n/ac: multiple antenna, beamforming (MIMO)

• Threat modelI Alice (access point) communicates with Bob (user)I Eve (attacker) wants to eavesdrop the downlink from Alice to Bob

• Is Eve affected by 802.11n/ac PHY features compared to 802.11b?I If yes, we should use it (together with crypto)

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Introduction 13

Page 17: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

802.11b Downlink (SISO, omnidirectional)

• 802.11bI Alice uses 1 antennasI Eve’s eavesdropping success depends on: dAE

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Introduction 14

Page 18: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

802.11n/ac Downlink (MISO, beamforming)

• 802.11n/acI Alice uses L antennas to dynamically beamform towards BobI Bob experiences a gain but Eve does notI Eve’s eavesdropping success depends on: dAE , dBE , and L

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Introduction 15

Page 19: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Metrics

• Signal-to-Noise-Ratio (SNR)I Power of the useful signal divided by the noise power at the receiverI Usually expressed in dB (10 log10 SNR = SNRdB)

• Bit-Error-Rate (BER)I Probability of erroneously decoding 1-bit at the receiverI Not an exact quantity (MCS, fading model)I 10−6 considered reasonable

• Packet-Error-Rate (PER)I PER = 1− (1− BER)N

I N is the average packet size in bits

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Introduction 16

Page 20: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Predictions and Experiments

• 802.11n/ac (beamforming) vs. 802.11b (omnidirectional)I Eve targets the downlink from Alice to BobI Is Eve affected by n/ac PHY features?

• Predictions (numerical analysis)I Eve’s SNR disadvantage in b vs. n/acI Eve’s PER disadvantage compared to Bob in n/ac

• Experiments (COTS devices)I Measure PER and SNR of Eve and BobI Compare the results with predictions

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Introduction 17

Page 21: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Wireless Path Loss Models

• Path loss modelI Parametric simulation ot wireless links (indoor, outdoor)I dBP is the breakpoint distanceI σSF is the shadowing std dev (log-normal)I sPL LOS and NLOS path loss slopes

• Model B: Residential (intra-room)I dBP = 5 mI σSF = 3, 4 dBI sPL = 2, 3.5

• Model D: Office (large conference room)I dBP = 10 mI σSF = 3, 5 dBI sPL = 2, 3.5

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Analysis 18

Page 22: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Model B (Residential) Expected PER

0 20 40 60 80 100 120 140

Distance from Alice d [m]

0.0

0.2

0.4

0.6

0.8

1.0

Exp

ecte

dP

ER

PER = 50%

Eve

Bob (L=2)

Bob (L=4)

• PER of Eve, Bob(L=2) and Bob(L=4) in 802.11n (BPSK)

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Analysis 19

Page 23: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Model B (Residential) Expected PER

0 20 40 60 80 100 120 140

Distance from Alice d [m]

0.0

0.2

0.4

0.6

0.8

1.0

Exp

ecte

dP

ER

12.5 m: Eve’s PER = 0.5

20 m: Eve’s PER = 0.98, Bob’s PER = 0

129.5 m from Eve: Bob’s PER 0.5

PER = 50%

Eve

Bob (L=2)

Bob (L=4)

• PER of Eve, Bob(L=2) and Bob(L=4) in 802.11n (BPSK)

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Analysis 19

Page 24: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Experimental Office Layout (NLOS)

~2.5 m

• Alice, Bob, and Eve locationsI dAB = 2 mI ~dAE = [2.5,5.0, . . . ,20] m (8 distances)I ∆dAE = 2.5 mI Constant angle and elevationI NLOS (exploit multipath)

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Evaluation 20

Page 25: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Experimental Setup: Traffic and Metrics

• UDP packets from Alice to Bob (targeted by Eve)I Wireshark running on Alice, Eve, and BobI 30 repetitions per distance (2.5 m, 5.0 m, . . . , 20 m)

• SNR measurementsI Received Signal Strength Indication (RSSI) and noise floorI From radiotap headers

• PER measurementsI From incorrect UDP checksumsI Over the total number of packet sent

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Evaluation 21

Page 26: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Eve’s Measured PER vs. Model D (Office)

2.5 5.0 7.5 10.0 12.5 15.0 17.5 20.0

dAE [m]

0

20

40

60

80

100

Eve

’sP

ER

%

Model D prediction 802.11b

Model D prediction 802.11n

Model D prediction 802.11ac

Measured values 802.11b

Measured values 802.11n

Measured values 802.11ac

• Eve’s PER is increasing among 802.11b/n/ac

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Evaluation 22

Page 27: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Conclusions about 802.11 Eavesdropping

• Q1: Can we leverage deployed physical layer features to secure communications?I Yes, 802.11n/ac PHY features disadvantage an eavesdropper

• Predicted 802.11n/ac disadvantages for EveI SNR is bounded by 6-41 dBI PER increases to 98% when dAE > 20 mI Eve has to be 129.5 m closer to get same performance as Bob

• Experimental results about EveI PER increases significantly when dAE > 15 mI PER is 20% higher in 802.11n than in 802.11bI PER is 30% higher in 802.11ac than in 802.11b

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems CANS17 - Conclusions 23

Page 28: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Our Wireless Security Challenges and Research Questions

• C1: Wireless physical layer as a defense mechanismI Q1: Can we use physical layer features to build security mechanisms? [CANS17]

• C2: Complexity and accessibility of wireless technologiesI Q2: Can we analyze and evaluate (proprietary) wireless technologies? [NDSS19]

• C3: Security evaluations and hardening of wireless technologiesI Q3: Can we harden already deployed technologies? [USEC19]

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Motivation 24

Page 29: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Our Wireless Security Challenges and Research Questions

• C1: Wireless physical layer as a defense mechanismI Q1: Can we use physical layer features to build security mechanisms? [CANS17]

• C2: Complexity and accessibility of wireless technologiesI Q2: Can we analyze and evaluate (proprietary) wireless technologies? [NDSS19]

• C3: Security evaluations and hardening of wireless technologiesI Q3: Can we harden already deployed technologies? [USEC19]

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Motivation 24

Page 30: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

C2: Complexity and accessibility of wireless technologies

• Wireless technologies are complexI Specifications have amendments (revisions)I Different implementations of a specification

• Wireless technologies are difficult to accessI Proprietary specificationsI Closed-source implementations

• Q2: Can we analyze and evaluate (proprietary) wireless technologies?I Nearby Threats: Reversing, Analyzing, and Attacking Google’s ‘Nearby Connections’ on

Android [NDSS19]

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Motivation 25

Page 31: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Nearby Threats: Reversing, Analyzing, and Attacking Google’s‘Nearby Connections’ on Android [NDSS19]

• Nearby ConnectionsI API for Android and Android ThingsI In-app proximity-based services

• Implemented in the Google Play ServicesI Available across different Android versionsI Applications use it as a shared library

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Introduction 26

Page 32: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Why Analyzing Nearby Connections?

• Wide attack surfaceI Any Android (version ≥ 4.0) and Android Things deviceI Uses Bluetooth and Wi-Fi (even at the same time)

• Proprietary technologyI No public specificationsI Implementation is closed-source and obfuscated

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Introduction 27

Page 33: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Our Core Contributions

• First (security) analysis of Nearby ConnectionsI Uncovers its proprietary mechanisms and protocolsI Based on reversing its Android implementation

• Re-implementation of Nearby Connections (REarby)I Exposes parameters not accessible with the official APII Impersonates nearby devices from any application

• Attacking Nearby Connections on AndroidI Connection manipulation and range extension attacksI Responsible disclosure with Google

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Introduction 28

Page 34: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Nearby Connections Public Information

• The server advertises a service (sid) and the client discovers it• Two connection strategies: P2P_STAR and P2P_CLUSTER

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Background 29

Page 35: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Nearby Connections Public Information 2

• Automatic connection using Bluetooth and/or Wi-Fi• Node exchanges encrypted payloads (peer-to-peer)

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Background 30

Page 36: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Our Dynamic Binary Instrumentation

• Workhorse: Frida, https://www.frida.reI Profiling of processes, e.g. NC-App, NC-GPSI Hook function and methods callsI Override parameters and return valuesI Read and write processes’ memory

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Setup 31

Page 37: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth name (BR/EDR) and BLE reports

2 Connection Request: automatic over Bluetooth, not authenticated

3 Key Exchange Protocol: Establishment of a shared secret

4 Optional Authentication: Based on the shared secret

5 Application Layer Connection Establishment: Interactive

6 Key Derivation Functions: Session, AES and HMAC keys

7 Optional Physical Layer Switch: Bluetooth to Wi-Fi

8 Exchange Encrypted Payloads: Proximity-based service

9 Disconnection: automatic after a 30 seconds timeout

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 32

Page 38: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth name (BR/EDR) and BLE reports

2 Connection Request: automatic over Bluetooth, not authenticated

3 Key Exchange Protocol: Establishment of a shared secret

4 Optional Authentication: Based on the shared secret

5 Application Layer Connection Establishment: Interactive

6 Key Derivation Functions: Session, AES and HMAC keys

7 Optional Physical Layer Switch: Bluetooth to Wi-Fi

8 Exchange Encrypted Payloads: Proximity-based service

9 Disconnection: automatic after a 30 seconds timeout

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 32

Page 39: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth name (BR/EDR) and BLE reports

2 Connection Request: automatic over Bluetooth, not authenticated

3 Key Exchange Protocol: Establishment of a shared secret

4 Optional Authentication: Based on the shared secret

5 Application Layer Connection Establishment: Interactive

6 Key Derivation Functions: Session, AES and HMAC keys

7 Optional Physical Layer Switch: Bluetooth to Wi-Fi

8 Exchange Encrypted Payloads: Proximity-based service

9 Disconnection: automatic after a 30 seconds timeout

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 32

Page 40: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth name (BR/EDR) and BLE reports

2 Connection Request: automatic over Bluetooth, not authenticated

3 Key Exchange Protocol: Establishment of a shared secret

4 Optional Authentication: Based on the shared secret

5 Application Layer Connection Establishment: Interactive

6 Key Derivation Functions: Session, AES and HMAC keys

7 Optional Physical Layer Switch: Bluetooth to Wi-Fi

8 Exchange Encrypted Payloads: Proximity-based service

9 Disconnection: automatic after a 30 seconds timeout

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 32

Page 41: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth name (BR/EDR) and BLE reports

2 Connection Request: automatic over Bluetooth, not authenticated

3 Key Exchange Protocol: Establishment of a shared secret

4 Optional Authentication: Based on the shared secret

5 Application Layer Connection Establishment: Interactive

6 Key Derivation Functions: Session, AES and HMAC keys

7 Optional Physical Layer Switch: Bluetooth to Wi-Fi

8 Exchange Encrypted Payloads: Proximity-based service

9 Disconnection: automatic after a 30 seconds timeout

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 32

Page 42: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth name (BR/EDR) and BLE reports

2 Connection Request: automatic over Bluetooth, not authenticated

3 Key Exchange Protocol: Establishment of a shared secret

4 Optional Authentication: Based on the shared secret

5 Application Layer Connection Establishment: Interactive

6 Key Derivation Functions: Session, AES and HMAC keys

7 Optional Physical Layer Switch: Bluetooth to Wi-Fi

8 Exchange Encrypted Payloads: Proximity-based service

9 Disconnection: automatic after a 30 seconds timeout

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 32

Page 43: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth name (BR/EDR) and BLE reports

2 Connection Request: automatic over Bluetooth, not authenticated

3 Key Exchange Protocol: Establishment of a shared secret

4 Optional Authentication: Based on the shared secret

5 Application Layer Connection Establishment: Interactive

6 Key Derivation Functions: Session, AES and HMAC keys

7 Optional Physical Layer Switch: Bluetooth to Wi-Fi

8 Exchange Encrypted Payloads: Proximity-based service

9 Disconnection: automatic after a 30 seconds timeout

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 32

Page 44: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth name (BR/EDR) and BLE reports

2 Connection Request: automatic over Bluetooth, not authenticated

3 Key Exchange Protocol: Establishment of a shared secret

4 Optional Authentication: Based on the shared secret

5 Application Layer Connection Establishment: Interactive

6 Key Derivation Functions: Session, AES and HMAC keys

7 Optional Physical Layer Switch: Bluetooth to Wi-Fi

8 Exchange Encrypted Payloads: Proximity-based service

9 Disconnection: automatic after a 30 seconds timeout

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 32

Page 45: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth name (BR/EDR) and BLE reports

2 Connection Request: automatic over Bluetooth, not authenticated

3 Key Exchange Protocol: Establishment of a shared secret

4 Optional Authentication: Based on the shared secret

5 Application Layer Connection Establishment: Interactive

6 Key Derivation Functions: Session, AES and HMAC keys

7 Optional Physical Layer Switch: Bluetooth to Wi-Fi

8 Exchange Encrypted Payloads: Proximity-based service

9 Disconnection: automatic after a 30 seconds timeout

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 32

Page 46: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Reversed Phases of a Nearby Connection

1 Discovery: Bluetooth name (BR/EDR) and BLE reports

2 Connection Request: automatic over Bluetooth, not authenticated

3 Key Exchange Protocol: Establishment of a shared secret

4 Optional Authentication: Based on the shared secret

5 Application Layer Connection Establishment: Interactive

6 Key Derivation Functions: Session, AES and HMAC keys

7 Optional Physical Layer Switch: Bluetooth to Wi-Fi

8 Exchange Encrypted Payloads: Proximity-based service

9 Disconnection: automatic after a 30 seconds timeout

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 32

Page 47: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Key Exchange Protocol (KEP)

Client

C

Server

S

Generate skC , pkCPick NC

cC = Hash(pkC)

Generate skS , pkSPick NS

Kep1: 1, endpointId, ncname, version

Kep2: 2, NC , cC , algo

Kep3: 3, NS , pkS

Kep4: 4, pkC

Verify cC(Sx, Sy) = skS · pkC

(Sx, Sy) = skC · pkS

• Based on ECDH, NIST P256 curve, shared secret is Sx

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 33

Page 48: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Optional Physical Layer Switch

• Bluetooth to soft access point (Wi-Fi Direct, hostapd)I Server instructs the client over Bluetooth (e.g. ESSID, password)I Client contacts the server over Wi-Fi

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - RE 34

Page 49: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Range Extension MitM Attack

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Attacks 35

Page 50: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Range Extension MitM Attack

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Attacks 36

Page 51: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Soft Access Point Manipulation Attack

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Attacks 37

Page 52: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Victim Connects to Attacker’s REarby Server

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Attacks 38

Page 53: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Attacker Manipulates Bluetooth to Wi-Fi Switch

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Attacks 39

Page 54: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Victim Connects to Attacker’s Wi-Fi AP

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Attacks 40

Page 55: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Attacker Configures Victim’s Network Interface

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Attacks 41

Page 56: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Attacker Eavesdrops All Wi-Fi Traffic

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Attacks 42

Page 57: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Conclusions about Nearby Connections

• Q2: Can we analyze and evaluate (proprietary) wireless technologies?I Yes, and they should not use security through obscurity.

• First security analysis of Nearby ConnectionsI Android and Android Things API for proximity-based services

• Reversed its Android implementation and re-implemented itI REarby https://francozappa.github.io/project/rearby/

• Demonstrate attacks and proposed countermeasuresI Range extension MitM: authenticate nodes and check proximityI Soft access point manipulation: authenticate nodes

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems NDSS19 - Conclusions 43

Page 58: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Conclusion and Q&A

• CPS security contributions (Thesis Part I, Chapter 1-5)I C1: Evaluation of CPS (IT and OT) technologies

• MiniCPS: A toolkit for security research on CPS networks [CPS-SPC15]• Legacy-Compliant Data Authentication for Industrial Control System Traffic [ACNS17]

I C2: Cyber-physical attacks• Towards high-interaction virtual ICS honeypots-in-a-box [CPS-SPC16]• State-Aware Anomaly Detection for Industrial Control Systems [SAC18]

I C3: CPS security education• Gamifying ICS Security Training and Research: Design, Implementation, and Results of S3

[CPS-SPC17]

• Wireless systems security contributions (Thesis Part II, Chapter 6-10)I C1: Wireless physical layer as a defense mechanism

• Practical Evaluation of Passive COTS Eavesdropping in 802.11b/n/ac WLAN [CANS17]I C2: Complexity and accessibility of wireless technologies

• Nearby Threats: Reversing, Analyzing, and Attacking Google’s ‘Nearby Connections’ onAndroid [NDSS19]

I C3: Security evaluations and hardening of wireless technologies• The KNOB is broken: Exploiting low entropy in the encryption key negotiation of Bluetooth

BR/EDR [USEC19]

Thanks for your time! Questions? More at: https://francozappa.github.ioDaniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems Conclusions 44

Page 59: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Our Wireless Security Challenges and Research Questions

• C1: Wireless physical layer as a defense mechanismI Q1: Can we leverage deployed physical layer features to secure communications?

[CANS17]

• C2: Complexity and accessibility of wireless technologiesI Q2: Can we analyze and evaluate (proprietary) wireless technologies? [NDSS19]

• C3: Security evaluations and hardening of wireless technologiesI Q3: Can we harden already deployed technologies? [USEC19]

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Motivation 45

Page 60: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Our Wireless Security Challenges and Research Questions

• C1: Wireless physical layer as a defense mechanismI Q1: Can we leverage deployed physical layer features to secure communications?

[CANS17]

• C2: Complexity and accessibility of wireless technologiesI Q2: Can we analyze and evaluate (proprietary) wireless technologies? [NDSS19]

• C3: Security evaluations and hardening of wireless technologiesI Q3: Can we harden already deployed technologies? [USEC19]

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Motivation 45

Page 61: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

C3: Security evaluations and hardening of wirelesstechnologies

• Bluetooth is a pervasive wireless technologyI Wide attack surface: IT, mobile, automotive, medical, and industrial

• Bluetooth security postureI Open specificationI Custom security mechanismsI No public reference implementation

• Q3: Can we evaluate and harden already deployed technologies?I The KNOB is broken: Exploiting low entropy in the encryption key negotiation of

Bluetooth BR/EDR [USEC19]

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Motivation 46

Page 62: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

The KNOB is broken: Exploiting low entropy in the encryptionkey negotiation of Bluetooth BR/EDR [USEC19]

• Bluetooth BR/EDR (Basic Rate/Extended Data Rate)I P2P, master-slaveI Better performance, yet less battery life than Bluetooth Low Energy (BLE)

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Motivation 47

Page 63: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Bluetooth BR/EDR’s Security

• Bluetooth BR/EDR link layer security guaranteesI Confidentiality, integrity, and authentication

• Secure Simple Paring (SSP), since Bluetooth v2.1I Pairing to generate a link key (long term secret)I ECDH and nonce-based key authenticationI Session keys derived from the link key (AES, HMAC)

• Secure Connections (SC), since Bluetooth v4.1I AES-CCM rather than E0I P-256 curve rather than P-192 curve

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Background 48

Page 64: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Key Negotiation of Bluetooth (KNOB)

• Paired devices share KL and negotiate a new K ′C per connection

• Q: What is the smallest yet standard-compliant N?

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 KNOB 49

Page 65: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

KNOB from the Bluetooth core spec v5.0 (page 1650)

“For the encryption algorithm, the key size may vary between 1 and 16 octets(8-128 bits). The size of the encryption key is configurable for two reasons. Thefirst has to do with the many different requirements imposed on cryptographicalgorithms in different countries - both with respect to export regulations andofficial attitudes towards privacy in general. The second reason is to facilitate afuture upgrade path for the security without the need of a costly redesign of thealgorithms and encryption hardware; increasing the effective key size is thesimplest way to combat increased computing power at the opponent side.”

https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=421043

• Q: How hard is to decrease the key size (entropy) to 1 Byte?

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 KNOB 50

Page 66: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Our Contribution: the KNOB Attack

• How hard is to adversarially set N=1 (break the KNOB)?

• Well, we demonstrated that the KNOB is broken

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 KNOB 51

Page 67: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Threat Model

• Alice (master) establishes a secure Bluetooth connection with Bob (slave)I Victims already performed pairing (they share KL)I Link layer is encrypted (using K ′C)

• Charlie (attacker)I In range with the Alice and BobI Wants to eavesdrop and manipulate the victims’s information

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 KNOB 52

Page 68: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

KNOB Attack Stages

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 KNOB 53

Page 69: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Entropy Negotiation is Not Integrity Protected

• Devices negotiate N, between 1 and 16, according to their Lmin and Lmax

Alice (controller)

A

Bob (controller)

B

LMP: AU RAND

LMP: SRES

LMP encryption mode req: 1

LMP accept

Negot’n

LMP K′

Centropy: 16

LMP K′

Centropy: 1

LMP accept

LMP start encryption: EN RAND

LMP accept

Encryption key K′

Chas 1 byte of entropy

• Over the air LMP packets are not integrity protected

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Key Negotiation 54

Page 70: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Adversarial Entropy Negotiation

• Charlie (attacker) forces Alice and Bob to negotiate N=1

Alice (controller)

A

Charlie (attacker)

C

Bob (controller)

B

LMP: AU RAND LMP: AU RAND

LMP: SRESLMP: SRES

LMP encryption mode req: 1 LMP encryption mode req: 1

LMP acceptLMP accept

Negot’n

LMP K′

Centropy: 16 LMP K

Centropy: 1

LMP acceptLMP K′

Centropy: 1

LMP accept

LMP start encryption: EN RAND LMP start encryption: EN RAND

LMP acceptLMP accept

Encryption key K′

Chas 1 byte of entropy

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Key Negotiation 55

Page 71: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Brute Forcing the Encryption Key (K ′C)

• Alice and BobI Use an encryption key (K ′C) with 1 Byte of entropyI K ′C is one within 256 candidates

• CharlieI Eavesdrops the ciphertextI Tests the 256 K ′C candidates against the ciphertext (in parallel)I Use K ′C to decrypt all packets and inject new packets

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Key Negotiation 56

Page 72: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Example of a KNOB Attack Scenario

• Victims: Nexus 5 and Motorola G3 (SSP, no SC)• Attacker: ThinkPad X1 and Ubertooth (Bluetooth sniffer)• Attacker decrypts a file exchanged over a secure Bluetooth link (OBEX)

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Key Negotiation 57

Page 73: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

KNOB Attack Evaluation

• The KNOB attack is at the architectural levelI All standard compliant Bluetooth devices are (potentially) vulnerableI Regardless their implementations, SSP, and SC

• KNOB Attack EvaluationI We tested all the Bluetooth devices that we had access to

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Evaluation 58

Page 74: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Vulnerable chips and devices (Bluetooth 5.0, 4.2)

Bluetooth chip Device(s) Vulnerable?

Bluetooth Version 5.0Snapdragon 845 Galaxy S9 XSnapdragon 835 Pixel 2, OnePlus 5 XApple/USI 339S00428 MacBookPro 2018 XApple A1865 iPhone X X

Bluetooth Version 4.2Intel 8265 ThinkPad X1 6th XIntel 7265 ThinkPad X1 3rd XUnknown Sennheiser PXC 550 XApple/USI 339S00045 iPad Pro 2 XBCM43438 RPi 3B, RPi 3B+ XBCM43602 iMac MMQA2LL/A X

X= Entropy of the encryption key (K ′C) reduced to 1 Byte

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Evaluation 59

Page 75: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Vulnerable chips and devices (Bluetooth 4.1 and below)

Bluetooth chip Device(s) Vulnerable?

Bluetooth Version 4.1BCM4339 (CYW4339) Nexus5, iPhone 6 XSnapdragon 410 Motorola G3 X

Bluetooth Version ≤ 4.0Snapdragon 800 LG G2 XIntel Centrino 6205 ThinkPad X230 XChicony Unknown ThinkPad KT-1255 XBroadcom Unknown ThinkPad 41U5008 XBroadcom Unknown Anker A7721 XApple W1 AirPods *

X= Entropy of the encryption key (K ′C) reduced to 1 Byte

* = Entropy of the encryption key (K ′C) reduced to 7 Byte

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Evaluation 60

Page 76: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Countermeasures for the KNOB Attack

• Legacy compliant (do not require to change the specification)I Set N to 16 (set Lmin = Lmax = 16)I Check N from the host (OS) upon connectionI Security mechanisms on top of the link layer

• Non legacy compliantI Secure entropy negotiation with KL (ECDH shared secret)I Get rid of the entropy negotiation protocol

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Countermeasures 61

Page 77: Design, Implementation, and Evaluation of Secure Cyber ...Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems • Thesis’s structure I Part I: Cyber-physical

Conclusion

• Discovered an architectural vulnerability of Bluetooth BR/EDRI The entropy of any encryption key can be reduced to 1 ByteI All standard compliant devices are (potentially) vulnerable

• Demonstrated the exploitability of this vulnerabilityI Key Negotiation Of Bluetooth (KNOB) attackI Evaluated on more than 14 chips (e.g. Intel, Broadcom, Apple, Qualcomm)

• Provided effective countermeasures (while doing disclosure)I Legacy and non legacy compliantI Today the embargo is over and the KNOB should be fixed

https://github.com/francozappa/knob

• Thanks for your time! Questions?

Daniele Antonioli Design, Implementation, and Evaluation of Secure Cyber-Physical and Wireless Systems USEC19 Conclusions 62