SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Downloaden Sie, um offline zu lesen
BLE Application Hacking
Tal Melamed
Application Security Expert
Tal@AppSec-Labs.com
R U aBLE?
not so
What is BLE?
BLE security
BLE pairing
Discovering services
Cloning the device
MitM
Available tools
Possible attacks and countermeasures
What’s next?
about://me
Tech Lead @ AppSec Labs
Tal@AppSec-Labs.com
Application Security Expert
Follow me @ appsec.it
https://github.com/nu11p0inter
http://sl.owasp.org/talmelamed
AppSec Labs
https://appsec-labs.com/
AppSec Labs
Industry vectors:
AppSec Labs provides its high end services to the following
industry vectors:
High Tech software development
Banking and financing
National security
IoT
Cloud
Pharmaceuticals
Commerce
Travel and transport
IT Security products
Biometrics
Education
Gaming
Government
Telecommunications
Before we start
AppSec Labs – Securing the IoT
Sounds like a buzz
PenTesting RF Operated Devices, OWASP 2016
Azure IoT partner
https://appsec-labs.com/iot-security/
What we offer?
SDLC, Training, Penetration-testing, Consulting
This presentation is a result of a preliminary
research on BLE security and part of a wide
research for IoT Security
What is BLE?
Bluetooth Low Energy
a.k.a Bluetooth Smart, part of Bluetooth 4
Designed to be power-efficient
Claimed to operate “month to years” on a single battery
Significantly smaller and cheaper.
Operates at 2.4 GHz (same as Bluetooth Classic)
Short range (<100m)
Low cost and ease of implementation lead BLE to be
widely used among IoT devices and applications
Used among medical, industrial and government
equipment
Wearables, sensors, lightbulbs, medical devices, and many other
smart-products.
48 billion IoT devices expected by 2021, and Bluetooth—
predicted to be in nearly one-third of those devices
To save you some questions
BLE vs BT Classic
Different architecture (Master-Slave)
Different modulation parameters
Different channels
Different channel-hopping scheme
Different packet format
Different packet whitening
Where is the risk?
And for me?
OMG, your baby
has 41° -
take him to the
hospital!
Your blood sugar is
way up. You should
get your insulin…
Ok, medical but…
What else?
Opens the Garage door
Are you drunk?
Possibly anything!
BLE Architecture
Apps
Applications are built on top
Interacts with host layer only
Different API’s depending on the application environment
Host
Sits on top of the Radio
Provides API to applications
Controller
Radio Control
Connection Linking
Radio Testing
Interface to Host
BLE Security - Security Manager
Three phase process on connection
Pairing feature exchange
Short term key generation
Transport specific key distribution
Implements a number of cryptographic functions
Memory and processing requirements are lower for
responding (saves power)
BLE Security
Uses AES-128 with CCM encryption engine
Uses Key Distribution to share various keys
Identity Resolving Key is used for privacy
Signing Resolving Key provides fast authentication without
encryption
Long Term Key is used
Pairing encrypts the link using a Temporary Key (TK)
Derived from passkey
Then distribute keys
Asymmetric key model
Slave gives keys to master with a diversifier
Slave can then recover keys from thediversifier
For more info:
https://www.bluetooth.com/~/media/files/specification/blu
etooth-low-energy-security.ashx
BLE Security: Pairing
Performed to establish keys in order to encrypt a link.
The keys can be used to encrypt a link in future reconnections,
verify signed data, or perform random address resolution.
3-phase for paring
Pairing Feature Exchange
Short Term Key (STK) Generation (legacy pairing)
Long Term Key (LTK) Generation (Secure Connections)
TransportSpecific Key Distribution
For full specs: Part 1, Part 2, Part 3
BLE Security: Pairing
How to determine the temporary key (TK)?
Just Works
Legacy, most common
Devices without display cannot implement other
Its actually a key of zero, that’s why it just works...
6-digit PIN
In case the device has a display
1m options (BFable)
Out of band (OOB)
Does not share secret key over the 2.4 GHz band (used by protocol)
Makes use of other mediums (e.g. NFC)
Once secret keys are exchanged, encrypts the channel
Not common (understatement – haven’t seen one yet)
“None of the pairing methods provide protection against a
passive eavesdropper” -Bluetooth Core Spec
More info: https://www.lacklustre.net/bluetooth/ (Crackle)
Why not DH?
“ A future version of this specification will include
elliptic curve cryptography and Diffie-Hellman public
key exchanges…”
Well, that’s too bad, I already bought the device!
So? Is it secure or not?
In practice, ~80% of tested devices do not implement
BLE-layer encryption
Mobile apps cannot control the pairing (OS level)
Why?
As always, security is left behind (cost, time, etc.)
Multiple users/apps using the same devices
Access sharing
Backups to the cloud
Public access devices (e.g. cash register)
Hardware, software or even UX
compatibilities/requirements
GATT
Generic Attribute Profile (GATT) used by BLE
to communicate with each other
Client Server Architecture
Built on top of ATT (Attribute Protocol)
GATT Server stores data using ATT
GATT Server accepts ATT requests to serve and
save attributes
Organized in data objects
Profiles
Services
Characteristics
For more info:
https://www.safaribooksonline.com/library/view/getting-
started-with/9781491900550/ch04.html
GATT
Services & characteristic are identified by an associated UUID
A characteristic contains a single value (“attribute”)
Can be read, written to or subscribed for notifications
Typical flow
How does that work?
Hello everyone!
I am a BLE device
and these are my services
Discovering Services
BLE cmd basics
# hciconfig hci0 up/down/reset
# hcitool lescan
# hcidump -x -t hci0
gatttool
Cloning the device
Scan devices
Listen to advertisements
Clone
Advertise cloned services
Let client connect to your “fake device”.
MitM!
Normal MitM
What do we need?
CSR 4.0 dongle x2
One will service as the client
The other as the server
$2.70 in aliexpres
Desired MitM for BLE
Tampering
Tampering with data using Burp
gattacker
BLE (Bluetooth Low Energy) security assessment
using Man-in-the-Middle
https://github.com/securing/gattacker
BtleJuice
Bluetooth Smart (LE) Man-in-the-Middle framework
https://github.com/DigitalSecurity/BtleJuice
Web interface
Replay & on-the-fly data modification
Possible attacks
Attacks on advertisements
The attacker clones the advertisement and broadcasts
(without forwarding to the real device)
The device will try to connect and fail
Mitigation: app should not rely on received
advertisement packets for critical functionality.
Possible attacks
Attacks on exposed services
If the device offers services possible to access without
authentication
BF-ing (e.g. guessing the password)
Fuzzing (Sending improper values to characteristics)
Logic vulnerabilities
Mitigation:
restrict access to services (least privilege)
perform input validation
time-limited provisioning (expose services only for a limited time
after power-up, or dedicated button)
Possible attacks
Attacks on Parining
“Just work” – just hacked
Access protected characteristic
Use for MitM
PIN-protected Pairing
Trick the user into re-initiation of the pairing
Jamming, cloning, etc.
Mitigation:
“Something you have” (e.g. allow pairing initiation only after
performing the required action on device - e.g. push a
dedicated button)
Mobile app should warn when wrong MAC is used.
What about MAC whitelisting?
Can be spoofed…
Possible attacks
MitM
Unencrypted transmission can be intercepted by a passive
eavesdropper.
Exposing sensitive data (health, passwords, etc.)
Data manipulation
Cmd injection (e.g. overwriting auth keys, etc.)
Replay attack (e.g. unlock device)
Mitigation:
encrypt data in transit
Sign
input validation,
etc.
Thanks
Sławomir Jasek (gattacker, BH USA 2016)
Damien Cauquil (Btlejuice, Hack.lu 2016)
Zero_Chaos & Granolocks (DEF CON 24)
Mike Ryan (lacklustre.net)
Sandeep Mistry (github.com/sandeepmistry)
What’s next?
Bluetooth 5
Significantly increasing the range, speed and
broadcast messaging capacity of Bluetooth
applications
4x the range, 2x the speed and 8x the
broadcasting message capacity
“connectionless” IoT, advancing beacon and
location-based capabilities
Improved interoperability and coexistence
with other wireless technologies
Advance IoT experience by enabling simple
and effortless interactions across the vast
range of connected devices
https://www.bluetooth.com/bluetooth5
Thank you!
Stay tuned: https://appsec-labs.com/iot-security/

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Core Bluetooth and BLE 101
Core Bluetooth and BLE 101Core Bluetooth and BLE 101
Core Bluetooth and BLE 101
 
BLE Talk
BLE TalkBLE Talk
BLE Talk
 
Bluetooth Low Energy - A Case Study
Bluetooth Low Energy - A Case StudyBluetooth Low Energy - A Case Study
Bluetooth Low Energy - A Case Study
 
Bluetooth low energy
Bluetooth low energyBluetooth low energy
Bluetooth low energy
 
Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer Kit
 
GATTacking Bluetooth Smart
GATTacking Bluetooth SmartGATTacking Bluetooth Smart
GATTacking Bluetooth Smart
 
IoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT DevkitIoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT Devkit
 
Boards for the IoT-Prototyping
Boards for the IoT-PrototypingBoards for the IoT-Prototyping
Boards for the IoT-Prototyping
 
Esp8266 basics
Esp8266 basicsEsp8266 basics
Esp8266 basics
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
Overview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer KitOverview of the Intel® Internet of Things Developer Kit
Overview of the Intel® Internet of Things Developer Kit
 
Android Things in action
Android Things in actionAndroid Things in action
Android Things in action
 
Sun SPOT, Wireless Sensors Networks
Sun SPOT, Wireless Sensors NetworksSun SPOT, Wireless Sensors Networks
Sun SPOT, Wireless Sensors Networks
 
DIY Science using the Intel IoT Developer Kit
DIY Science using the Intel IoT Developer KitDIY Science using the Intel IoT Developer Kit
DIY Science using the Intel IoT Developer Kit
 
IoT Intro and Demo
IoT Intro and DemoIoT Intro and Demo
IoT Intro and Demo
 
Attendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQLAttendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQL
 
Iot Bootcamp - abridged - part 1
Iot Bootcamp - abridged - part 1Iot Bootcamp - abridged - part 1
Iot Bootcamp - abridged - part 1
 
Geek Pic-Nic Master Class
Geek Pic-Nic Master ClassGeek Pic-Nic Master Class
Geek Pic-Nic Master Class
 
Webinar: Plataforma Renesas Synergy – Construindo sua aplicação MQTT com anal...
Webinar: Plataforma Renesas Synergy – Construindo sua aplicação MQTT com anal...Webinar: Plataforma Renesas Synergy – Construindo sua aplicação MQTT com anal...
Webinar: Plataforma Renesas Synergy – Construindo sua aplicação MQTT com anal...
 
Interacting with Intel Edison
Interacting with Intel EdisonInteracting with Intel Edison
Interacting with Intel Edison
 

Andere mochten auch

Andere mochten auch (8)

Android App Hacking - Erez Metula, AppSec
Android App Hacking - Erez Metula, AppSecAndroid App Hacking - Erez Metula, AppSec
Android App Hacking - Erez Metula, AppSec
 
About BLE server profile
About BLE server profile About BLE server profile
About BLE server profile
 
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
 
Advantages and limitations of PhoneGap for sensor processing
Advantages and limitations of PhoneGap for sensor processingAdvantages and limitations of PhoneGap for sensor processing
Advantages and limitations of PhoneGap for sensor processing
 
Connect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low EnergyConnect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low Energy
 
Motion recognition with Android devices
Motion recognition with Android devicesMotion recognition with Android devices
Motion recognition with Android devices
 
Automated Security Analysis of Android & iOS Applications with Mobile Securit...
Automated Security Analysis of Android & iOS Applications with Mobile Securit...Automated Security Analysis of Android & iOS Applications with Mobile Securit...
Automated Security Analysis of Android & iOS Applications with Mobile Securit...
 
Sensor fusion between car and smartphone
Sensor fusion between car and smartphoneSensor fusion between car and smartphone
Sensor fusion between car and smartphone
 

Ähnlich wie R U aBLE? BLE Application Hacking

Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
Abdul Wahid
 
Kavya racharla ndh-naropanth_fin
Kavya racharla ndh-naropanth_finKavya racharla ndh-naropanth_fin
Kavya racharla ndh-naropanth_fin
PacSecJP
 
Portakal Teknoloji Otc Lyon Part 1
Portakal Teknoloji Otc  Lyon Part 1Portakal Teknoloji Otc  Lyon Part 1
Portakal Teknoloji Otc Lyon Part 1
bora.gungoren
 

Ähnlich wie R U aBLE? BLE Application Hacking (20)

Web Server Technologies Part III: Security & Future Musings
Web Server Technologies Part III: Security & Future MusingsWeb Server Technologies Part III: Security & Future Musings
Web Server Technologies Part III: Security & Future Musings
 
Lecture 07 networking
Lecture 07 networkingLecture 07 networking
Lecture 07 networking
 
network security / information security
network security / information securitynetwork security / information security
network security / information security
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
Make the Smartcard great again
Make the Smartcard great againMake the Smartcard great again
Make the Smartcard great again
 
Bitrix Software Security
Bitrix Software SecurityBitrix Software Security
Bitrix Software Security
 
Kavya racharla ndh-naropanth_fin
Kavya racharla ndh-naropanth_finKavya racharla ndh-naropanth_fin
Kavya racharla ndh-naropanth_fin
 
Corporate Security Issues and countering them using Unified Threat Management...
Corporate Security Issues and countering them using Unified Threat Management...Corporate Security Issues and countering them using Unified Threat Management...
Corporate Security Issues and countering them using Unified Threat Management...
 
Architecting Secure Web Systems
Architecting Secure Web SystemsArchitecting Secure Web Systems
Architecting Secure Web Systems
 
IoT summit - Building flexible & secure IoT solutions
IoT summit - Building flexible & secure IoT solutionsIoT summit - Building flexible & secure IoT solutions
IoT summit - Building flexible & secure IoT solutions
 
Removing Security Roadblocks to IoT Deployment Success
Removing Security Roadblocks to IoT Deployment SuccessRemoving Security Roadblocks to IoT Deployment Success
Removing Security Roadblocks to IoT Deployment Success
 
Cyber securityppt
Cyber securitypptCyber securityppt
Cyber securityppt
 
iPhone and iPad Security
iPhone and iPad SecurityiPhone and iPad Security
iPhone and iPad Security
 
Portakal Teknoloji Otc Lyon Part 1
Portakal Teknoloji Otc  Lyon Part 1Portakal Teknoloji Otc  Lyon Part 1
Portakal Teknoloji Otc Lyon Part 1
 
Automating your AWS Security Operations
Automating your AWS Security OperationsAutomating your AWS Security Operations
Automating your AWS Security Operations
 
Iot Security
Iot SecurityIot Security
Iot Security
 
Automating your AWS Security Operations
Automating your AWS Security OperationsAutomating your AWS Security Operations
Automating your AWS Security Operations
 
AWS re:Invent 2016: IoT Security: The New Frontiers (IOT302)
AWS re:Invent 2016: IoT Security: The New Frontiers (IOT302)AWS re:Invent 2016: IoT Security: The New Frontiers (IOT302)
AWS re:Invent 2016: IoT Security: The New Frontiers (IOT302)
 
Protecting location privacy in sensor networks against a global eavesdropper
Protecting location privacy in sensor networks against a global eavesdropperProtecting location privacy in sensor networks against a global eavesdropper
Protecting location privacy in sensor networks against a global eavesdropper
 
Protecting location privacy in sensor networks against a global eavesdropper
Protecting location privacy in sensor networks against a global eavesdropperProtecting location privacy in sensor networks against a global eavesdropper
Protecting location privacy in sensor networks against a global eavesdropper
 

Kürzlich hochgeladen

+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@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
+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...
 
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, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

R U aBLE? BLE Application Hacking

  • 1. BLE Application Hacking Tal Melamed Application Security Expert Tal@AppSec-Labs.com R U aBLE? not so
  • 2. What is BLE? BLE security BLE pairing Discovering services Cloning the device MitM Available tools Possible attacks and countermeasures What’s next?
  • 3. about://me Tech Lead @ AppSec Labs Tal@AppSec-Labs.com Application Security Expert Follow me @ appsec.it https://github.com/nu11p0inter http://sl.owasp.org/talmelamed
  • 5. AppSec Labs Industry vectors: AppSec Labs provides its high end services to the following industry vectors: High Tech software development Banking and financing National security IoT Cloud Pharmaceuticals Commerce Travel and transport IT Security products Biometrics Education Gaming Government Telecommunications
  • 6. Before we start AppSec Labs – Securing the IoT Sounds like a buzz PenTesting RF Operated Devices, OWASP 2016 Azure IoT partner https://appsec-labs.com/iot-security/ What we offer? SDLC, Training, Penetration-testing, Consulting This presentation is a result of a preliminary research on BLE security and part of a wide research for IoT Security
  • 7. What is BLE? Bluetooth Low Energy a.k.a Bluetooth Smart, part of Bluetooth 4 Designed to be power-efficient Claimed to operate “month to years” on a single battery Significantly smaller and cheaper. Operates at 2.4 GHz (same as Bluetooth Classic) Short range (<100m) Low cost and ease of implementation lead BLE to be widely used among IoT devices and applications Used among medical, industrial and government equipment Wearables, sensors, lightbulbs, medical devices, and many other smart-products. 48 billion IoT devices expected by 2021, and Bluetooth— predicted to be in nearly one-third of those devices
  • 8. To save you some questions BLE vs BT Classic Different architecture (Master-Slave) Different modulation parameters Different channels Different channel-hopping scheme Different packet format Different packet whitening
  • 9. Where is the risk?
  • 10. And for me? OMG, your baby has 41° - take him to the hospital! Your blood sugar is way up. You should get your insulin…
  • 12. What else? Opens the Garage door Are you drunk? Possibly anything!
  • 13. BLE Architecture Apps Applications are built on top Interacts with host layer only Different API’s depending on the application environment Host Sits on top of the Radio Provides API to applications Controller Radio Control Connection Linking Radio Testing Interface to Host
  • 14. BLE Security - Security Manager Three phase process on connection Pairing feature exchange Short term key generation Transport specific key distribution Implements a number of cryptographic functions Memory and processing requirements are lower for responding (saves power)
  • 15. BLE Security Uses AES-128 with CCM encryption engine Uses Key Distribution to share various keys Identity Resolving Key is used for privacy Signing Resolving Key provides fast authentication without encryption Long Term Key is used Pairing encrypts the link using a Temporary Key (TK) Derived from passkey Then distribute keys Asymmetric key model Slave gives keys to master with a diversifier Slave can then recover keys from thediversifier For more info: https://www.bluetooth.com/~/media/files/specification/blu etooth-low-energy-security.ashx
  • 16. BLE Security: Pairing Performed to establish keys in order to encrypt a link. The keys can be used to encrypt a link in future reconnections, verify signed data, or perform random address resolution. 3-phase for paring Pairing Feature Exchange Short Term Key (STK) Generation (legacy pairing) Long Term Key (LTK) Generation (Secure Connections) TransportSpecific Key Distribution For full specs: Part 1, Part 2, Part 3
  • 17. BLE Security: Pairing How to determine the temporary key (TK)? Just Works Legacy, most common Devices without display cannot implement other Its actually a key of zero, that’s why it just works... 6-digit PIN In case the device has a display 1m options (BFable) Out of band (OOB) Does not share secret key over the 2.4 GHz band (used by protocol) Makes use of other mediums (e.g. NFC) Once secret keys are exchanged, encrypts the channel Not common (understatement – haven’t seen one yet) “None of the pairing methods provide protection against a passive eavesdropper” -Bluetooth Core Spec More info: https://www.lacklustre.net/bluetooth/ (Crackle)
  • 18. Why not DH? “ A future version of this specification will include elliptic curve cryptography and Diffie-Hellman public key exchanges…” Well, that’s too bad, I already bought the device!
  • 19. So? Is it secure or not? In practice, ~80% of tested devices do not implement BLE-layer encryption Mobile apps cannot control the pairing (OS level) Why? As always, security is left behind (cost, time, etc.) Multiple users/apps using the same devices Access sharing Backups to the cloud Public access devices (e.g. cash register) Hardware, software or even UX compatibilities/requirements
  • 20. GATT Generic Attribute Profile (GATT) used by BLE to communicate with each other Client Server Architecture Built on top of ATT (Attribute Protocol) GATT Server stores data using ATT GATT Server accepts ATT requests to serve and save attributes Organized in data objects Profiles Services Characteristics For more info: https://www.safaribooksonline.com/library/view/getting- started-with/9781491900550/ch04.html
  • 21. GATT Services & characteristic are identified by an associated UUID A characteristic contains a single value (“attribute”) Can be read, written to or subscribed for notifications
  • 23. How does that work? Hello everyone! I am a BLE device and these are my services
  • 25. BLE cmd basics # hciconfig hci0 up/down/reset # hcitool lescan # hcidump -x -t hci0
  • 27. Cloning the device Scan devices Listen to advertisements Clone Advertise cloned services Let client connect to your “fake device”. MitM!
  • 29. What do we need? CSR 4.0 dongle x2 One will service as the client The other as the server $2.70 in aliexpres
  • 32. Tampering with data using Burp
  • 33. gattacker BLE (Bluetooth Low Energy) security assessment using Man-in-the-Middle https://github.com/securing/gattacker
  • 34. BtleJuice Bluetooth Smart (LE) Man-in-the-Middle framework https://github.com/DigitalSecurity/BtleJuice Web interface Replay & on-the-fly data modification
  • 35. Possible attacks Attacks on advertisements The attacker clones the advertisement and broadcasts (without forwarding to the real device) The device will try to connect and fail Mitigation: app should not rely on received advertisement packets for critical functionality.
  • 36. Possible attacks Attacks on exposed services If the device offers services possible to access without authentication BF-ing (e.g. guessing the password) Fuzzing (Sending improper values to characteristics) Logic vulnerabilities Mitigation: restrict access to services (least privilege) perform input validation time-limited provisioning (expose services only for a limited time after power-up, or dedicated button)
  • 37. Possible attacks Attacks on Parining “Just work” – just hacked Access protected characteristic Use for MitM PIN-protected Pairing Trick the user into re-initiation of the pairing Jamming, cloning, etc. Mitigation: “Something you have” (e.g. allow pairing initiation only after performing the required action on device - e.g. push a dedicated button) Mobile app should warn when wrong MAC is used. What about MAC whitelisting? Can be spoofed…
  • 38. Possible attacks MitM Unencrypted transmission can be intercepted by a passive eavesdropper. Exposing sensitive data (health, passwords, etc.) Data manipulation Cmd injection (e.g. overwriting auth keys, etc.) Replay attack (e.g. unlock device) Mitigation: encrypt data in transit Sign input validation, etc.
  • 39. Thanks Sławomir Jasek (gattacker, BH USA 2016) Damien Cauquil (Btlejuice, Hack.lu 2016) Zero_Chaos & Granolocks (DEF CON 24) Mike Ryan (lacklustre.net) Sandeep Mistry (github.com/sandeepmistry)
  • 40. What’s next? Bluetooth 5 Significantly increasing the range, speed and broadcast messaging capacity of Bluetooth applications 4x the range, 2x the speed and 8x the broadcasting message capacity “connectionless” IoT, advancing beacon and location-based capabilities Improved interoperability and coexistence with other wireless technologies Advance IoT experience by enabling simple and effortless interactions across the vast range of connected devices https://www.bluetooth.com/bluetooth5
  • 41. Thank you! Stay tuned: https://appsec-labs.com/iot-security/