SlideShare uma empresa Scribd logo
1 de 38
Baixar para ler offline
BluetoothLowEnergySecurity
Presentedby:
AkshayKumar
DarshanRamakantBhat
FreezeFrancis
A case study
Overview
● What is Bluetooth Low Energy?
○ vs classic bluetooth
● Protocol Stack
○ PHY and Link
● Encryption
● Security Issues in BLE 4.0/4.1
○ Eavesdropping
○ Active Attack
○ MITM
● Security Enhancements BLE 4.2
○ ECDH
What is Bluetooth Low Energy?
● a.k.a Bluetooth Smart
● originally introduced under the name Wibree by Nokia in 2006
● merged into the main Bluetooth standard in 2010 with the adoption of the
Bluetooth Core Specification Version 4.0
● operates in the unlicensed 2.4 GHz band
● new modulation and link layer for low-power devices
● vs classic Bluetooth
○ incompatible with classic Bluetooth devices
○ PHY and link layer almost completely different
○ high-level protocols the same
Applications
Bluetooth LE network
Protocol Stack
PHY Layer
● 2.4 GHz ISM band splitted into 40 channels:
○ 37 data channels
○ 3 advertising channels (37,38,39)
○ Central frequency, fn
=2402 + 2n MHz
PHY Layer (continued..)
● Modulation scheme : Gaussian Frequency Shift Keying(GFSK)
○ Data rate : 1 Mbit/s
● Hopping
○ hop along all 37 data channels
○ duration (a.k.a hop interval) : one data packet per channel
○ hop increment (specific to a connection ) decides the next channel
next channel = (channel + hop increment) mod 37
Link Layer
● Preamble: an alternating binary sequence for synchronization
● Access Address: unique identifier which defines a particular connection
○ Fixed value for communications in advertising channel : 0x8E89BED6
● PDU : protocol data unit which is the actual payload (variable length)
● CRC : for error checking
○ depends on CRC Init and the PDU
○ Computed using Linear Feedback Shift Register (LFSR)
● Whitening is applied to the PDU and CRC.
○ Not complicated as it depends only on channel number.
○ Computed using LFSR
● Each Bluetooth device has a unique MAC address
Link layer state diagram
● Standby: does not transmit or receive any packets
● Advertising: transmitting advertising channel
packets and possibly listening to and responding to
responses triggered by these advertising channel
packets
● Scanning: listening for advertising channel packets
from devices that are advertising.
● Initiating: listening for advertising channel packets
from a specific device(s) and responding to these
packets to initiate a connection with another device.
● Connection : connected state, device is either
master or slave and further communication happens
in data channels.
Encryption
● Link layer
○ AES-CCM encryption scheme
○ CCM : Counter mode with CBC-MAC (Cipher Block Chaining Message Authentication Code)
○ authenticated encryption algorithm: encrypts the PDU and also generates MAC
● Application layer
○ user-defined encryption
○ generally not used in BLE devices
With Low Energy Comes Low Security!!!
Compromises made for low power:
● Hopping rate is less aggressive (37 data channels)
● Whitening seed is straight-forward from channel number and LFSR used is
known
● Overly simplified custom key exchange
Combining all these resulted in a major flaw in the protocol !!
● Applications:
○ heart rate and blood pressure monitors
○ wireless door lock, low power gadgets
○ industrial monitoring sensors
○ public transportation apps
Eavesdropping
● Compromises make eavesdropping easy
● To sniff a connection:
○ Hop increment : to determine next channel
○ Access address : to find the start of the PDU
○ Hop interval : to determine how long to stay in a channel
○ CRC init : to filter out corrupt packets
● Two scenarios:
○ Observed the connection initialization packet: all values are known.
○ Missed the connection initialization packet: recover values by exploiting properties of BLE packets.
Eavesdropping attack in detail
(Hardware)
(Software)
Ubertooth
(to PC)
RF to packets:
● CC2400 gets bits from air
● We know Access Address !
● MCU finds the start of PDU and gets it
as packet
● Wireshark plugin available
Wireshark plugins
Recovering the unknown values
● Master and slave transmits packets in each channel, even if
there is no meaningful data (empty packet).
● waits for hop_interval x 1.25 ms in a channel.
● Empty packet : PDU = header( 16 bit) + empty body
○ easy to identify looking for header
○ most traffic is empty
Access address:
● Look for an empty packet and AA comes before the header
● least frequently used cache (LFU) + CRC to eliminate false
positives
Recovering unknown values (continued..)
CRC init:
● seed value used for generating CRC
● CRC computed using an LFSR
● CRC Init obtained by reversing LFSR with CRC as seed
● LFU to filter out false positives
Hop interval:
● wait on particular data channel for consecutive packets
● 37 channels visited in full cycle
●
Recovering unknown values (continued..)
Hop Increment:
● Interarrival time of packets in two data channels (say 0 and 1)
(Fermat's little theorem)
we can now follow a connection and sniff packets, but encryption?
0 -----> 25 -----> 50 -----> 1
Bypassing the encryption
● Encryption by link layer
● How to get the keys ?
Custom Key Exchange Protocol:
● 3 stage process
● Stage 1 : Choosing the pairing methods which defines Temporary Key (TK)
● Stage 2 : Generate the Short Term Key (STK)
● Stage 3 : Generate the Long Term Key (LTK)
● LTK is reused and used to generate session keys
● Session keys are used during encrypted sessions (AES-CCM)
Pairing methods
Devices chooses pairing methods based on I/O capabilities.
1. Just Works
● TK is trivial i.e TK=0
2. PassKey Entry
● TK is 6-digit PIN (user inputs)
3. Out Of Band (OOB)
● uses other means like NFC for TK exchange
● more secure
● almost never used !
The TK (also the 128-bit AES key) is used to generate a ‘confirm’ values.
Cracking the TK
● We already have a packet sniffer
● TK is between 0 and 99999 (if passKey entry pairing)
● brute forced in < 1 second
(plain text)
Key Exchange Broken
● TK + pairing data is used to compute a STK
● STK is used to encrypt the LTK exchange
● Worst part : LTK is reused and used to generate session keys
● 100 % passive attack and can be done offline
Active Attack
What if attacker missed the LTK exchange packets?
Two possible active attacks:
1. Eavesdropper can jam the connection so that master will drop the connection
causing force re-pairing.
2. BLE protocol has provisions for a master or slave to reject a LTK. Eavesdropper
sends an appropriate link layer message (LL_REJECT_IND) that forces a key
renegotiation.
Man In The Middle Attacks
An attacker can emulate himself as the valid device and cause the data to pass
through him.
Authentication protects against MIMT
Authentication is the method to prevent the MITM
Enhancements in Bluetooth 4.2
There are two major enhancements in BLE 4.2
● New pairing method : A new pairing method is added. Both the devices should
have display capabilities and one should have yes or no button.
● Elliptic Curve Diffie Hellman (ECDH) Key exchange:
DH uses prime factorization whereas ECDH uses elliptic curve cryptography.
Breaking the ECDH is more computationally expensive than DH and also it
requires less bits than DH.
MITM prevention
● Before pairing both the devices must share pairing parameters that includes
authentication requirements
● If authentication is required, both devices must authenticate each other using one of the
association models
Which model to use is based on two parameters:
● Can the device receive data from a user, or output data to the user. Involving the user in
the pairing process is an important element in the secure transfer of data
● Can the device communicate Out-of-Band (OOB)? For example, if part of the security key
can be transferred between the two devices over Near-Field Communication (NFC), an
eavesdropper will not be able to make sense of the final data.
Association models (BLE 4.2)
● Numeric Comparison—Both devices display a six-digit number and the user
authenticates by selecting ‘Yes’ if both devices are displaying the same number.
● Passkey Entry—The user either inputs an identical Passkey into both devices, or one
device displays the Passkey and the user enters that Passkey into the other device.
● Out of Band (OOB)—The OOB association model is the model to use if the device are
capable of OOB.
● Just Works—This association model is used either when MITM protection is not needed
or when devices have limited IO capabilities.
Diffie-Hellman
Elliptic Curve Cryptography
● An elliptic curve E is the graph of an equation of the form
y2
= x3
+ ax + b
● Elliptic curves provides a different way to do
the math in public key system
y2 = x3 - x + 1
Elliptic curve maths
Consider y2
= x3
+ 2x + 3 (mod 5)
x = 0 y2
= 3 no solution (mod 5) ; x = 1 y2
= 6 = 1 y = 1,4 (mod 5)
x = 2 y2
= 15 = 0 y = 0 (mod 5); x = 3 y2
= 36 = 1 y = 1,4 (mod 5)
x = 4 y2
= 75 = 0 y = 0 (mod 5)
So valid points on the curve are (1,1) (1,4) (2,0) (3,1) (3,4) (4,0) and (inf,inf)
These points form the finite set.
Addition in elliptic curve
● P1 + P2 = P3
Addition on: y2
= x3
+ ax + b (mod p)
P1=(x1
,y1
), P2=(x2
,y2
); P1 + P2 = P3 = (x3
,y3
) where
x3
= (m2
- x1
- x2
) (mod p); y3
= (m(x1
- x3
) - y1
)(mod p)
And m = (y2
-y1
)(x2
-x1
)-1
mod p, if P1 ≠P2
m = (3x1
2
+a)(2y1
)-1
mod p, if P1 = P2
What is (1,4) + (3,1) = P3 = (x3,y3) in y2
= x3
+2x+3 mod 5? m = (1-4)(3-1)-1
= (-3)(2)-1
= 2(3) = 6 = 1 (mod 5)
x3
= 1 - 1 - 3 = 2 (mod 5) y3
= 1(1-2) - 4 = 0 (mod 5)
Diffie-Hellman using elliptic maths
Public: Elliptic curve and point (x,y) on curve
Secret: Alice’s A and Bob’s B
Alice computes A(B(x,y))
Bob computes B(A(x,y))
These are the same since AB = BA
Example
Public: Curve y2
= x3
+ 7x + b (mod 37) and point (2,5) b = 3
Alice’s secret: A = 4
Bob’s secret: B = 7
Alice sends Bob: 4(2,5) = (7,32)
Bob sends Alice: 7(2,5) = (18,35)
Alice computes: 4(18,35) = (22,1)
Bob computes: 7(7,32) = (22,1)
References
● https://www.bluetooth.com/specifications/bluetooth-core-specification
● http://blog.bluetooth.com/everything-you-always-wanted-to-know-about-blueto
oth-security-in-bluetooth-4-2/
● “Bluetooth: With Low Energy comes Low Security” by Mike Ryan, 7th USENIX
conference on Offensive Technologies, 2013
Bluetooth Low Energy - A Case Study

Mais conteúdo relacionado

Mais procurados

Passive Optical Networks
Passive Optical NetworksPassive Optical Networks
Passive Optical Networks
fanttazio
 

Mais procurados (20)

5G NR parameters
5G NR parameters5G NR parameters
5G NR parameters
 
Gpon the technology --rev 1
Gpon the technology --rev 1Gpon the technology --rev 1
Gpon the technology --rev 1
 
Passive Optical Networks
Passive Optical NetworksPassive Optical Networks
Passive Optical Networks
 
UWB and applications
UWB and applicationsUWB and applications
UWB and applications
 
Bluetooth Low Energy Packet Format
Bluetooth Low Energy Packet FormatBluetooth Low Energy Packet Format
Bluetooth Low Energy Packet Format
 
Technology Introduction Series: Edge Computing tutorial.pdf
Technology Introduction Series: Edge Computing tutorial.pdfTechnology Introduction Series: Edge Computing tutorial.pdf
Technology Introduction Series: Edge Computing tutorial.pdf
 
Contiki Operating system tutorial
Contiki Operating system tutorialContiki Operating system tutorial
Contiki Operating system tutorial
 
5gc call flow
5gc call flow5gc call flow
5gc call flow
 
Iot ble and_beacons_2015_nov28
Iot ble and_beacons_2015_nov28Iot ble and_beacons_2015_nov28
Iot ble and_beacons_2015_nov28
 
Energy Efficiency of Telecom Networks
Energy Efficiency of Telecom NetworksEnergy Efficiency of Telecom Networks
Energy Efficiency of Telecom Networks
 
5G Network Architecture and Design
5G Network Architecture and Design5G Network Architecture and Design
5G Network Architecture and Design
 
The Bluetooth technology
The Bluetooth technologyThe Bluetooth technology
The Bluetooth technology
 
An overview of D2D in 3GPP LTE standard
An overview of D2D in 3GPP LTE standardAn overview of D2D in 3GPP LTE standard
An overview of D2D in 3GPP LTE standard
 
O-RAN 5g high level network design
O-RAN 5g high level network designO-RAN 5g high level network design
O-RAN 5g high level network design
 
LTE Vs. 3G
LTE Vs. 3GLTE Vs. 3G
LTE Vs. 3G
 
LTE Schedulers – A Definitive Approach
LTE Schedulers – A Definitive Approach LTE Schedulers – A Definitive Approach
LTE Schedulers – A Definitive Approach
 
Introduction to Mobile Core Network
Introduction to Mobile Core NetworkIntroduction to Mobile Core Network
Introduction to Mobile Core Network
 
5g architecture, Industrial Training
5g architecture, Industrial Training5g architecture, Industrial Training
5g architecture, Industrial Training
 
3GPP 5G Control Plane Service Based Architecture
3GPP 5G Control Plane Service Based Architecture3GPP 5G Control Plane Service Based Architecture
3GPP 5G Control Plane Service Based Architecture
 
GPEH, PCHR, CHR, MR, SIG, CTUM, CELL TRACE, UETR Parsers - Innovile
GPEH, PCHR, CHR, MR, SIG, CTUM, CELL TRACE, UETR Parsers - InnovileGPEH, PCHR, CHR, MR, SIG, CTUM, CELL TRACE, UETR Parsers - Innovile
GPEH, PCHR, CHR, MR, SIG, CTUM, CELL TRACE, UETR Parsers - Innovile
 

Destaque

Bluetooth low energy(ble) wireless technology
Bluetooth low energy(ble) wireless technologyBluetooth low energy(ble) wireless technology
Bluetooth low energy(ble) wireless technology
Lin Steven
 

Destaque (20)

Bluetooth low energy
Bluetooth low energyBluetooth low energy
Bluetooth low energy
 
Bluetooth low energy(ble) wireless technology
Bluetooth low energy(ble) wireless technologyBluetooth low energy(ble) wireless technology
Bluetooth low energy(ble) wireless technology
 
Introduction to bluetooth low energy - JFokus IoT 2015
Introduction to bluetooth low energy - JFokus IoT 2015Introduction to bluetooth low energy - JFokus IoT 2015
Introduction to bluetooth low energy - JFokus IoT 2015
 
About BLE server profile
About BLE server profile About BLE server profile
About BLE server profile
 
Smart home management system based on BLE
Smart home management system based on BLESmart home management system based on BLE
Smart home management system based on BLE
 
Summer Internship Report
Summer Internship ReportSummer Internship Report
Summer Internship Report
 
REPORT RI 15BPE104
REPORT RI 15BPE104 REPORT RI 15BPE104
REPORT RI 15BPE104
 
IoT-Stockholm-Intro_to_BLE
IoT-Stockholm-Intro_to_BLEIoT-Stockholm-Intro_to_BLE
IoT-Stockholm-Intro_to_BLE
 
Interfacing two arduino boards using rn 42 bluetooth
Interfacing two arduino boards using rn 42 bluetoothInterfacing two arduino boards using rn 42 bluetooth
Interfacing two arduino boards using rn 42 bluetooth
 
Carwhisperer Bluetooth Attack
Carwhisperer Bluetooth AttackCarwhisperer Bluetooth Attack
Carwhisperer Bluetooth Attack
 
Developing Beacons with Bluetooth® Low Energy (BLE) Technology
 Developing Beacons with Bluetooth® Low Energy (BLE) Technology Developing Beacons with Bluetooth® Low Energy (BLE) Technology
Developing Beacons with Bluetooth® Low Energy (BLE) Technology
 
Shenzhen2015
Shenzhen2015Shenzhen2015
Shenzhen2015
 
R U aBLE? BLE Application Hacking
R U aBLE? BLE Application HackingR U aBLE? BLE Application Hacking
R U aBLE? BLE Application Hacking
 
Bluetooth and profiles on WEC7
Bluetooth and profiles on WEC7Bluetooth and profiles on WEC7
Bluetooth and profiles on WEC7
 
Bluetooth
BluetoothBluetooth
Bluetooth
 
Bluetooth low energy
Bluetooth low energyBluetooth low energy
Bluetooth low energy
 
Bluetooth Reinvented. Smart connectivity in consumer devices: Bluetooth Low ...
Bluetooth Reinvented.  Smart connectivity in consumer devices: Bluetooth Low ...Bluetooth Reinvented.  Smart connectivity in consumer devices: Bluetooth Low ...
Bluetooth Reinvented. Smart connectivity in consumer devices: Bluetooth Low ...
 
Bluetooth low energy final version
Bluetooth low energy final versionBluetooth low energy final version
Bluetooth low energy final version
 
Hijacking bluetooth headsets
Hijacking bluetooth headsetsHijacking bluetooth headsets
Hijacking bluetooth headsets
 
Wearable Device (Bluetooth Low Energy BLE ) connect with Android
Wearable Device (Bluetooth Low Energy BLE ) connect with  AndroidWearable Device (Bluetooth Low Energy BLE ) connect with  Android
Wearable Device (Bluetooth Low Energy BLE ) connect with Android
 

Semelhante a Bluetooth Low Energy - A Case Study

Semelhante a Bluetooth Low Energy - A Case Study (20)

Bluetooth security
Bluetooth securityBluetooth security
Bluetooth security
 
Basic Study on the WT12 Family of Bluetooth Devices
Basic Study on the WT12 Family of Bluetooth DevicesBasic Study on the WT12 Family of Bluetooth Devices
Basic Study on the WT12 Family of Bluetooth Devices
 
spins
spinsspins
spins
 
G05215356
G05215356G05215356
G05215356
 
Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1Digital logic-formula-notes-final-1
Digital logic-formula-notes-final-1
 
Gl embedded starterkit_ethernet
Gl embedded starterkit_ethernetGl embedded starterkit_ethernet
Gl embedded starterkit_ethernet
 
FastBFT
FastBFTFastBFT
FastBFT
 
Cryptography 202
Cryptography 202Cryptography 202
Cryptography 202
 
One-Wire-Serial-Communication.pdf
One-Wire-Serial-Communication.pdfOne-Wire-Serial-Communication.pdf
One-Wire-Serial-Communication.pdf
 
G3 phase1 final ppt.pptx
G3 phase1 final ppt.pptxG3 phase1 final ppt.pptx
G3 phase1 final ppt.pptx
 
Kernel Recipes 2015: Greybus
Kernel Recipes 2015: GreybusKernel Recipes 2015: Greybus
Kernel Recipes 2015: Greybus
 
Client server computing in mobile environments part 2
Client server computing in mobile environments part 2Client server computing in mobile environments part 2
Client server computing in mobile environments part 2
 
Networking essentials lect1
Networking essentials lect1Networking essentials lect1
Networking essentials lect1
 
DEF CON 27 - CHRISTOPHER WADE - tag side attacks against nfc
DEF CON 27 - CHRISTOPHER WADE - tag side attacks against nfcDEF CON 27 - CHRISTOPHER WADE - tag side attacks against nfc
DEF CON 27 - CHRISTOPHER WADE - tag side attacks against nfc
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandota
 
Network Topologies, L1-L2 Basics, Networking Devices
Network Topologies, L1-L2 Basics, Networking DevicesNetwork Topologies, L1-L2 Basics, Networking Devices
Network Topologies, L1-L2 Basics, Networking Devices
 
Bluetooth
BluetoothBluetooth
Bluetooth
 
Computer System and Architecture
Computer System and ArchitectureComputer System and Architecture
Computer System and Architecture
 
Module: drand - the Distributed Randomness Beacon
Module: drand - the Distributed Randomness BeaconModule: drand - the Distributed Randomness Beacon
Module: drand - the Distributed Randomness Beacon
 
Micro c lab8(serial communication)
Micro c lab8(serial communication)Micro c lab8(serial communication)
Micro c lab8(serial communication)
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Bluetooth Low Energy - A Case Study

  • 2. Overview ● What is Bluetooth Low Energy? ○ vs classic bluetooth ● Protocol Stack ○ PHY and Link ● Encryption ● Security Issues in BLE 4.0/4.1 ○ Eavesdropping ○ Active Attack ○ MITM ● Security Enhancements BLE 4.2 ○ ECDH
  • 3. What is Bluetooth Low Energy? ● a.k.a Bluetooth Smart ● originally introduced under the name Wibree by Nokia in 2006 ● merged into the main Bluetooth standard in 2010 with the adoption of the Bluetooth Core Specification Version 4.0 ● operates in the unlicensed 2.4 GHz band ● new modulation and link layer for low-power devices ● vs classic Bluetooth ○ incompatible with classic Bluetooth devices ○ PHY and link layer almost completely different ○ high-level protocols the same
  • 4.
  • 6.
  • 9. PHY Layer ● 2.4 GHz ISM band splitted into 40 channels: ○ 37 data channels ○ 3 advertising channels (37,38,39) ○ Central frequency, fn =2402 + 2n MHz
  • 10. PHY Layer (continued..) ● Modulation scheme : Gaussian Frequency Shift Keying(GFSK) ○ Data rate : 1 Mbit/s ● Hopping ○ hop along all 37 data channels ○ duration (a.k.a hop interval) : one data packet per channel ○ hop increment (specific to a connection ) decides the next channel next channel = (channel + hop increment) mod 37
  • 11. Link Layer ● Preamble: an alternating binary sequence for synchronization ● Access Address: unique identifier which defines a particular connection ○ Fixed value for communications in advertising channel : 0x8E89BED6 ● PDU : protocol data unit which is the actual payload (variable length) ● CRC : for error checking ○ depends on CRC Init and the PDU ○ Computed using Linear Feedback Shift Register (LFSR) ● Whitening is applied to the PDU and CRC. ○ Not complicated as it depends only on channel number. ○ Computed using LFSR ● Each Bluetooth device has a unique MAC address
  • 12. Link layer state diagram ● Standby: does not transmit or receive any packets ● Advertising: transmitting advertising channel packets and possibly listening to and responding to responses triggered by these advertising channel packets ● Scanning: listening for advertising channel packets from devices that are advertising. ● Initiating: listening for advertising channel packets from a specific device(s) and responding to these packets to initiate a connection with another device. ● Connection : connected state, device is either master or slave and further communication happens in data channels.
  • 13. Encryption ● Link layer ○ AES-CCM encryption scheme ○ CCM : Counter mode with CBC-MAC (Cipher Block Chaining Message Authentication Code) ○ authenticated encryption algorithm: encrypts the PDU and also generates MAC ● Application layer ○ user-defined encryption ○ generally not used in BLE devices
  • 14. With Low Energy Comes Low Security!!! Compromises made for low power: ● Hopping rate is less aggressive (37 data channels) ● Whitening seed is straight-forward from channel number and LFSR used is known ● Overly simplified custom key exchange Combining all these resulted in a major flaw in the protocol !! ● Applications: ○ heart rate and blood pressure monitors ○ wireless door lock, low power gadgets ○ industrial monitoring sensors ○ public transportation apps
  • 15. Eavesdropping ● Compromises make eavesdropping easy ● To sniff a connection: ○ Hop increment : to determine next channel ○ Access address : to find the start of the PDU ○ Hop interval : to determine how long to stay in a channel ○ CRC init : to filter out corrupt packets ● Two scenarios: ○ Observed the connection initialization packet: all values are known. ○ Missed the connection initialization packet: recover values by exploiting properties of BLE packets.
  • 16. Eavesdropping attack in detail (Hardware) (Software)
  • 17. Ubertooth (to PC) RF to packets: ● CC2400 gets bits from air ● We know Access Address ! ● MCU finds the start of PDU and gets it as packet ● Wireshark plugin available
  • 19. Recovering the unknown values ● Master and slave transmits packets in each channel, even if there is no meaningful data (empty packet). ● waits for hop_interval x 1.25 ms in a channel. ● Empty packet : PDU = header( 16 bit) + empty body ○ easy to identify looking for header ○ most traffic is empty Access address: ● Look for an empty packet and AA comes before the header ● least frequently used cache (LFU) + CRC to eliminate false positives
  • 20. Recovering unknown values (continued..) CRC init: ● seed value used for generating CRC ● CRC computed using an LFSR ● CRC Init obtained by reversing LFSR with CRC as seed ● LFU to filter out false positives Hop interval: ● wait on particular data channel for consecutive packets ● 37 channels visited in full cycle ●
  • 21. Recovering unknown values (continued..) Hop Increment: ● Interarrival time of packets in two data channels (say 0 and 1) (Fermat's little theorem) we can now follow a connection and sniff packets, but encryption? 0 -----> 25 -----> 50 -----> 1
  • 22. Bypassing the encryption ● Encryption by link layer ● How to get the keys ? Custom Key Exchange Protocol: ● 3 stage process ● Stage 1 : Choosing the pairing methods which defines Temporary Key (TK) ● Stage 2 : Generate the Short Term Key (STK) ● Stage 3 : Generate the Long Term Key (LTK) ● LTK is reused and used to generate session keys ● Session keys are used during encrypted sessions (AES-CCM)
  • 23. Pairing methods Devices chooses pairing methods based on I/O capabilities. 1. Just Works ● TK is trivial i.e TK=0 2. PassKey Entry ● TK is 6-digit PIN (user inputs) 3. Out Of Band (OOB) ● uses other means like NFC for TK exchange ● more secure ● almost never used ! The TK (also the 128-bit AES key) is used to generate a ‘confirm’ values.
  • 24. Cracking the TK ● We already have a packet sniffer ● TK is between 0 and 99999 (if passKey entry pairing) ● brute forced in < 1 second (plain text)
  • 25. Key Exchange Broken ● TK + pairing data is used to compute a STK ● STK is used to encrypt the LTK exchange ● Worst part : LTK is reused and used to generate session keys ● 100 % passive attack and can be done offline
  • 26. Active Attack What if attacker missed the LTK exchange packets? Two possible active attacks: 1. Eavesdropper can jam the connection so that master will drop the connection causing force re-pairing. 2. BLE protocol has provisions for a master or slave to reject a LTK. Eavesdropper sends an appropriate link layer message (LL_REJECT_IND) that forces a key renegotiation.
  • 27. Man In The Middle Attacks An attacker can emulate himself as the valid device and cause the data to pass through him. Authentication protects against MIMT Authentication is the method to prevent the MITM
  • 28. Enhancements in Bluetooth 4.2 There are two major enhancements in BLE 4.2 ● New pairing method : A new pairing method is added. Both the devices should have display capabilities and one should have yes or no button. ● Elliptic Curve Diffie Hellman (ECDH) Key exchange: DH uses prime factorization whereas ECDH uses elliptic curve cryptography. Breaking the ECDH is more computationally expensive than DH and also it requires less bits than DH.
  • 29. MITM prevention ● Before pairing both the devices must share pairing parameters that includes authentication requirements ● If authentication is required, both devices must authenticate each other using one of the association models Which model to use is based on two parameters: ● Can the device receive data from a user, or output data to the user. Involving the user in the pairing process is an important element in the secure transfer of data ● Can the device communicate Out-of-Band (OOB)? For example, if part of the security key can be transferred between the two devices over Near-Field Communication (NFC), an eavesdropper will not be able to make sense of the final data.
  • 30. Association models (BLE 4.2) ● Numeric Comparison—Both devices display a six-digit number and the user authenticates by selecting ‘Yes’ if both devices are displaying the same number. ● Passkey Entry—The user either inputs an identical Passkey into both devices, or one device displays the Passkey and the user enters that Passkey into the other device. ● Out of Band (OOB)—The OOB association model is the model to use if the device are capable of OOB. ● Just Works—This association model is used either when MITM protection is not needed or when devices have limited IO capabilities.
  • 32. Elliptic Curve Cryptography ● An elliptic curve E is the graph of an equation of the form y2 = x3 + ax + b ● Elliptic curves provides a different way to do the math in public key system y2 = x3 - x + 1
  • 33. Elliptic curve maths Consider y2 = x3 + 2x + 3 (mod 5) x = 0 y2 = 3 no solution (mod 5) ; x = 1 y2 = 6 = 1 y = 1,4 (mod 5) x = 2 y2 = 15 = 0 y = 0 (mod 5); x = 3 y2 = 36 = 1 y = 1,4 (mod 5) x = 4 y2 = 75 = 0 y = 0 (mod 5) So valid points on the curve are (1,1) (1,4) (2,0) (3,1) (3,4) (4,0) and (inf,inf) These points form the finite set.
  • 34. Addition in elliptic curve ● P1 + P2 = P3 Addition on: y2 = x3 + ax + b (mod p) P1=(x1 ,y1 ), P2=(x2 ,y2 ); P1 + P2 = P3 = (x3 ,y3 ) where x3 = (m2 - x1 - x2 ) (mod p); y3 = (m(x1 - x3 ) - y1 )(mod p) And m = (y2 -y1 )(x2 -x1 )-1 mod p, if P1 ≠P2 m = (3x1 2 +a)(2y1 )-1 mod p, if P1 = P2 What is (1,4) + (3,1) = P3 = (x3,y3) in y2 = x3 +2x+3 mod 5? m = (1-4)(3-1)-1 = (-3)(2)-1 = 2(3) = 6 = 1 (mod 5) x3 = 1 - 1 - 3 = 2 (mod 5) y3 = 1(1-2) - 4 = 0 (mod 5)
  • 35. Diffie-Hellman using elliptic maths Public: Elliptic curve and point (x,y) on curve Secret: Alice’s A and Bob’s B Alice computes A(B(x,y)) Bob computes B(A(x,y)) These are the same since AB = BA
  • 36. Example Public: Curve y2 = x3 + 7x + b (mod 37) and point (2,5) b = 3 Alice’s secret: A = 4 Bob’s secret: B = 7 Alice sends Bob: 4(2,5) = (7,32) Bob sends Alice: 7(2,5) = (18,35) Alice computes: 4(18,35) = (22,1) Bob computes: 7(7,32) = (22,1)