SlideShare a Scribd company logo
1 of 78
Download to read offline
ra
Defea ng Bluetooth Low
Energy PRNG
for fun and jamming
Damien ”virtualabs” Cauquil | DEF CON
ra
Who am I ?
• Security Evangelist @ digital.security
• Senior Security Researcher
• Main developer of BtleJack (a BLE swiss-army tool)
virtualabs
/
ra
What’s new in BLE ?
ra
Bluetooth Low Energy Protocol
Origins
Bluetooth Low Energy has been introduced in as Bluetooth
Smart, in Bluetooth Core Specifica ons version . .
Evolved since then: version . ( ), version . ( ), version
( ) and version . ( )
/
ra
Bluetooth Low Energy Protocol
Security mechanisms
• Pairing: key exchange with PIN code, OOB or ECDH
• Secure connec ons: encrypted and authen cated
communica on
• Channel Selec on Algorithm: not a security mechanism, but
makes sniffing complicated
/
ra
Bluetooth Low Energy Protocol
Known a acks (BLE <= . )
• Sniffing: stealing secrets sent through non-secure and secure
BLE connec ons
• Jamming: disrup ng an exis ng BLE connec on
• Hijacking: taking over an exis ng BLE connec on
/
ra
Bluetooth Low Energy Protocol
Required hardware
/
ra
Bluetooth Low Energy Protocol
BtleJack
• Swiss-army knife to perform Bluetooth Low Energy a acks
• Compa ble with Micro:Bit and other nRF boards
/
ra
New features introduced in BLE
• Be er throughput (up to Mbps)
• Be er range (up to feet – meters)
• Improved coexistence
/
ra
New features introduced in BLE
Be er throughput / be er range
BLE adds two new PHYs:
• Mbps uncoded PHY: twice the speed of BLE .x
• LE Coded PHY: range × ( kbps) or range × ( kbps)
/
ra
New features introduced in BLE
LE Coded PHY vs LE uncoded PHY
/
ra /
ra
New features introduced in BLE
Improved coexistence
BLE also adds a new Channel Selec on Algorithm (CSA # )
• Designed to replace the old algorithm:
Channeln+ = (Channeln + hopInc) mod
• PRNG-based: more ”random” than CSA #
/
ra
New features introduced in BLE
Improved coexistence
BLE adds a ChSel bit in the adver sing channel PDU header:
/
ra
New features introduced in BLE
Consequences regarding known a acks
• A completely different hopping pa ern ( -hop instead of
-hop sequence) is used
• We won’t be able to sniff, jam or hijack BLE devices
• We need a new hardware that supports BLE new PHYs
/
ra /
ra
BLE PRNG WTF
ra
BLE PRNG overview
• It uses a channel iden fier as a seed
• It relies on basic opera ons (add, mul ply, xor, bit
permuta ons)
• Channel remapping is performed if not all channels are in use
/
ra
BLE PRNG overview
Channel Iden fier
Channel iden fier is first computed from Access Address, as
described in the specs:
/
ra
BLE PRNG overview
MAM
This PRNG relies on a basic rou ne called MAM:
/
ra
BLE PRNG overview
Random number genera on
It generates a random number based on channelIden fier and a
counter:
/
ra
BLE PRNG overview
Channel Selec on Algorithm #
Based on the output of this PRNG, it selects a specific channel:
/
ra /
ra /
ra
Breaking this PRNG
I see some flaws in here ...
• channelIden fier is computed from Access Address ... which
is PUBLIC !
/
ra
Breaking this PRNG
I see some flaws in here ...
• channelIden fier is computed from Access Address ... which
is PUBLIC !
• Next value is generated from a COUNTER, not from some
previous internal state !
/
ra
Breaking this PRNG
From unknown bits to , easy peasy
Access Address is broadcasted in every packet!
/
ra
Breaking this PRNG
PRNG ? really ?
prn_e = PRNG(channelIdentifier, counter)
• channelIden fier is constant
• it generates a fixed sequence of values, indexed by
counter
/
ra /
ra
Breaking this PRNG
Waht do we need to break it ?
• Consider channelIden fier as known
/
ra
Breaking this PRNG
Waht do we need to break it ?
• Consider channelIden fier as known
• We are le with an unknown -bit counter
/
ra
Breaking this PRNG
Waht do we need to break it ?
• Consider channelIden fier as known
• We are le with an unknown -bit counter
• If we can figure out where we are in the sequence of
values, we would find out this counter value
/
ra
Guessing the counter value
ra
Ge ng informa on from RF
As an a acker, we can only monitor an exis ng BLE connec on and:
• determine WHEN a packet is sent over a specific channel
• determine the me spent between two packets transmi ed
on two channels
/
ra
Ge ng informa on from RF
Channels are not -bit values
If all data channels are used:
channel = prn_e mod
else:
channel = remappingIndex[ (N×prn_e)
]
/
ra
First approach: using a sieve
• Pre-requisite: we know the hopInterval used for the target
connec on (i.e. me spent between two hops)
• Our goal: to eliminate every possible candidate in the
smallest number of rounds
/
ra
First approach: using a sieve
How it works
Considering a counter of , we compute channel C from PRNG
with this candidate counter, and wait for a valid packet
/
ra
First approach: using a sieve
How it works
Once a valid packet received, we compute the next channel (C )
and we wait for a valid packet again:
/
ra
First approach: using a sieve
How it works
We deduce the me spent between these two packets:
/
ra
First approach: using a sieve
How it works
And we convert it into a number of hops:
/
ra
First approach: using a sieve
How it works
We then sieve the sequence of channels to only keep poten al
candidate indexes:
Sequence = {..., C , ..., C
N hops
, ...}
And we end up with a list of candidate counter values at T
(between and , most of the me)
/
ra
First approach: using a sieve
How it works
Then, we consider the first candidate and:
• we compute C and C
/
ra
First approach: using a sieve
How it works
Then, we consider the first candidate and:
• we compute C and C
• we wait for a packet on channel C
/
ra
First approach: using a sieve
How it works
Then, we consider the first candidate and:
• we compute C and C
• we wait for a packet on channel C
• we wait for another packet on channel C
/
ra
First approach: using a sieve
How it works
Then, we consider the first candidate and:
• we compute C and C
• we wait for a packet on channel C
• we wait for another packet on channel C
• we deduce the number of hops
/
ra
First approach: using a sieve
How it works
Then, we consider the first candidate and:
• we compute C and C
• we wait for a packet on channel C
• we wait for another packet on channel C
• we deduce the number of hops
• we sieve our list of candidates to only keep the matching ones
/
ra
First approach: using a sieve
How it works
Repeat un l one candidate le !
(This is the counter value at T )
/
ra
First approach: using a sieve
Implementa on (video)
Since I did not have a BLE compa ble device, I simulated this
a ack:
-> Attacker waited 21 hops until a packet arrived on channel 0
>> Filtering candidates ...
-> Candidate 20476 removed
-> Candidate 45108 removed
-> Remaining candidates: 22967
>> Found initial counter: 22967
INFO: Attack required 209 hops
/
ra /
ra
Guessing the hop interval
ra
Guessing the hop interval
Using our previous measures
hopInterval = GCD(δT , δT , δT , ...)
/
ra
Guessing the hop interval
Simula ng (again)
$ python3 csa2-hopinter-simulate.py
[system] Hop interval: 2220
Deduced hop interval after 2 deltas: 8880
Deduced hop interval after 3 deltas: 4440
Deduced hop interval after 4 deltas: 4440
Deduced hop interval after 5 deltas: 2220
Deduced hop interval after 6 deltas: 2220
[...]
Deduced hop interval after 10 deltas: 2220
/
ra
Guessing the hop interval
Efficiency
# of measures approx. success rate Max. me required (s)
%
%
%
%
%
%
/
ra
From theory to prac ce:
breaking CSA # on the field
ra
I bought some BLE compa ble devices
/
ra
Improving Btlejack
Channel map and hopInterval recovery
• Btlejack can do the job but only for Mbps uncoded PHY
• I modified Btlejack to compute hopInterval while mapping
channels
• This GCD-based technique works pre y well =)
/
ra
Improving Btlejack
Example output
# btlejack -f 0x9af4493f -5 -d /dev/ttyACM2
BtleJack version 2.0
[i] Using cached parameters (created on 2019-07-23 00:47:59)
[i] Detected sniffers:
> Sniffer #0: fw version 2.0
[i] Synchronizing with connection 0x9af4493f ...
✓ CRCInit: 0x6f1c40
✓ Channel Map = 0x0774ea8a3c
✓ Hop interval = 160
/
ra /
ra
Improving Btlejack
Implemen ng our sieve a ack on counter
I implemented this algorithm and tested it:
• First round went pre y well: I got about candidates
filtered
/
ra
Improving Btlejack
Implemen ng our sieve a ack on counter
I implemented this algorithm and tested it:
• First round went pre y well: I got about candidates
filtered
• Next rounds messed up: I was not able to guess the counter
value
/
ra
Improving Btlejack
Implemen ng our sieve a ack on counter
Filter out candidates took a hell of a me, thus inducing
a delay !
(Sor ng algorithms did not help)
/
ra /
ra
Improving Btlejack
Re-designing our sieve a ack
To solve this problem, I moved from a sieve to a pa ern-matching
algorithm:
• Measure first (number of hops between different
consecu ve channels)
/
ra
Improving Btlejack
Re-designing our sieve a ack
To solve this problem, I moved from a sieve to a pa ern-matching
algorithm:
• Measure first (number of hops between different
consecu ve channels)
• You end up with δT values (δT to δT )
/
ra
Improving Btlejack
Re-designing our sieve a ack
To solve this problem, I moved from a sieve to a pa ern-matching
algorithm:
• Measure first (number of hops between different
consecu ve channels)
• You end up with δT values (δT to δT )
• Look for this hopping pa ern in our sequence and deduce
counter
/
ra
counter guessing is now working, YAY !
/
ra /
ra
Improving Btlejack
hops why
Pa ern matching took about hops to complete !
/
ra
Sniffing a BLE connec on with CSA #
[i] Synchronizing with connection 0x31204f95 ...
✓ CRCInit: 0x40d64f
✓ Channel Map = 0x1fffffffff
✓ Hop interval = 160
✓ CSA2 PRNG counter = 5137
[i] Synchronized, packet capture in progress ...
LL Data: 0e 08 04 00 04 00 52 10 00 01
LL Data: 02 08 04 00 04 00 52 10 00 00
LL Data: 02 08 04 00 04 00 52 10 00 01
LL Data: 0e 08 04 00 04 00 52 10 00 00
LL Data: 0e 08 04 00 04 00 52 10 00 01
/
ra
Jamming a BLE connec on with CSA #
# btlejack -f 0x91a7471f -m 0x1fffffffff -p 160 -5 -j
BtleJack version 2.0
[..]
[i] Synchronizing with connection 0x91a7471f ...
✓ CRCInit: 0x21a31e
✓ Channel map is provided: 0x1fffffffff
✓ Hop interval is provided: 160
✓ CSA2 PRNG counter = 1199
[i] Synchronized, jamming in progress ...
[!] Connection lost.
[i] Quitting
/
ra
Btlejack version .
https://github.com/virtualabs/btlejack
/
ra
Conclusion
ra
Conclusion
Bluetooth Low Energy CSA # PRNG is weak:
• It is not really a PRNG
• bits out of can be easily guessed from a public value
• The last bits compose a counter that is periodically
incremented
/
ra
Conclusion
This PRNG:
• is thought to improve coexistence, not security
• is designed to be easily implemented on low-power devices
/
ra
Conclusion
• We should use Nordic’s nRF rather than the old
nRF
• S ll a lot of work to port BtleJack to this pla orm
• But luckily, Marcus Meng has done a great job with nRF
/
ra
Research materials
Python scripts and notes
https://github.com/virtualabs/ble5-research
/
ra
Thank you !
Ques ons ?
 @virtualabs
 damien.cauquil@digital.security
/
ra
Further readings
• https://virtualabs.fr/defcon26/
DC26-DamienCauquil-YoudBetterSecureYourBLEDevices.pdf
• https://www.alchemistowl.org/pocorgtfo/pocorgtfo17.pdf
• https://github.com/mame82/misc/blob/master/logitech_vuln_
summary.md
/

More Related Content

What's hot

What's hot (20)

11 bgp-ethernet
11 bgp-ethernet11 bgp-ethernet
11 bgp-ethernet
 
Networking lab
Networking labNetworking lab
Networking lab
 
Ad hoc on demand distance
Ad hoc on demand distanceAd hoc on demand distance
Ad hoc on demand distance
 
8 congestion-ipv6
8 congestion-ipv68 congestion-ipv6
8 congestion-ipv6
 
Arp Cache Poisoning
Arp Cache PoisoningArp Cache Poisoning
Arp Cache Poisoning
 
Np unit iv ii
Np unit iv iiNp unit iv ii
Np unit iv ii
 
Basics of sockets
Basics of socketsBasics of sockets
Basics of sockets
 
QoS Classification on Cisco IOS Router
QoS Classification on Cisco IOS RouterQoS Classification on Cisco IOS Router
QoS Classification on Cisco IOS Router
 
Np unit iii
Np unit iiiNp unit iii
Np unit iii
 
Totem
TotemTotem
Totem
 
Course on TCP Dynamic Performance
Course on TCP Dynamic PerformanceCourse on TCP Dynamic Performance
Course on TCP Dynamic Performance
 
Basics of firewall, ebtables, arptables and iptables
Basics of firewall, ebtables, arptables and iptablesBasics of firewall, ebtables, arptables and iptables
Basics of firewall, ebtables, arptables and iptables
 
Netfilter: Making large iptables rulesets scale
Netfilter: Making large iptables rulesets scaleNetfilter: Making large iptables rulesets scale
Netfilter: Making large iptables rulesets scale
 
Part 5 : Sharing resources, security principles and protocols
Part 5 : Sharing resources, security principles and protocolsPart 5 : Sharing resources, security principles and protocols
Part 5 : Sharing resources, security principles and protocols
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
Arpspoofing
ArpspoofingArpspoofing
Arpspoofing
 
Tcpip
TcpipTcpip
Tcpip
 
07 data linkcontrol
07 data linkcontrol07 data linkcontrol
07 data linkcontrol
 
IPv6 Segment Routing : an end-to-end solution ?
IPv6 Segment Routing : an end-to-end solution ?IPv6 Segment Routing : an end-to-end solution ?
IPv6 Segment Routing : an end-to-end solution ?
 

Similar to DEF CON 27 - DAMIEN CAUQUIL - defeating bluetooth low energy 5 prng for fun and jamming

WCDMA optimization & Drive test analysis
WCDMA optimization & Drive test analysisWCDMA optimization & Drive test analysis
WCDMA optimization & Drive test analysisTABREZ KHAN
 
Dc ch07 : error control and data link control
Dc ch07 : error control and data link controlDc ch07 : error control and data link control
Dc ch07 : error control and data link controlSyaiful Ahdan
 
Dynamic time warping and PIC 16F676 for control of devices
Dynamic time warping and PIC 16F676 for control of devicesDynamic time warping and PIC 16F676 for control of devices
Dynamic time warping and PIC 16F676 for control of devicesRoger Gomes
 
New framing-protocols
New framing-protocolsNew framing-protocols
New framing-protocolsNitesh Singh
 
Aerospike Go Language Client
Aerospike Go Language ClientAerospike Go Language Client
Aerospike Go Language ClientSayyaparaju Sunil
 
Pcr array data analysis 2013
Pcr array data analysis 2013Pcr array data analysis 2013
Pcr array data analysis 2013Elsa von Licy
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer ProtocolsZahouAmel1
 
MagneTag Presentation Winter Quarter V3.0
MagneTag Presentation Winter Quarter V3.0MagneTag Presentation Winter Quarter V3.0
MagneTag Presentation Winter Quarter V3.0John-Paul Petersen
 
running stable diffusion on android
running stable diffusion on androidrunning stable diffusion on android
running stable diffusion on androidKoan-Sin Tan
 
Network performance overview
Network  performance overviewNetwork  performance overview
Network performance overviewMy cp
 
PRESENTATION ON DATA STRUCTURE AND THEIR TYPE
PRESENTATION ON DATA STRUCTURE AND THEIR TYPEPRESENTATION ON DATA STRUCTURE AND THEIR TYPE
PRESENTATION ON DATA STRUCTURE AND THEIR TYPEnikhilcse1
 
456589.-Compiler-Design-Code-Generation (1).ppt
456589.-Compiler-Design-Code-Generation (1).ppt456589.-Compiler-Design-Code-Generation (1).ppt
456589.-Compiler-Design-Code-Generation (1).pptMohibKhan79
 
USART - 8251 / usart-8251A Pallav Shukla
USART - 8251 / usart-8251A Pallav ShuklaUSART - 8251 / usart-8251A Pallav Shukla
USART - 8251 / usart-8251A Pallav ShuklaPallav Shukla
 
Wpmc2004 phy protection
Wpmc2004 phy protectionWpmc2004 phy protection
Wpmc2004 phy protectionArpan Pal
 
Expl sw chapter_02_switches_part_1
Expl sw chapter_02_switches_part_1Expl sw chapter_02_switches_part_1
Expl sw chapter_02_switches_part_1aghacrom
 
Networking
NetworkingNetworking
Networkingra na
 
hajer
hajerhajer
hajerra na
 

Similar to DEF CON 27 - DAMIEN CAUQUIL - defeating bluetooth low energy 5 prng for fun and jamming (20)

WCDMA optimization & Drive test analysis
WCDMA optimization & Drive test analysisWCDMA optimization & Drive test analysis
WCDMA optimization & Drive test analysis
 
Tcp(no ip) review part1
Tcp(no ip) review part1Tcp(no ip) review part1
Tcp(no ip) review part1
 
Dc ch07 : error control and data link control
Dc ch07 : error control and data link controlDc ch07 : error control and data link control
Dc ch07 : error control and data link control
 
Dynamic time warping and PIC 16F676 for control of devices
Dynamic time warping and PIC 16F676 for control of devicesDynamic time warping and PIC 16F676 for control of devices
Dynamic time warping and PIC 16F676 for control of devices
 
New framing-protocols
New framing-protocolsNew framing-protocols
New framing-protocols
 
Aerospike Go Language Client
Aerospike Go Language ClientAerospike Go Language Client
Aerospike Go Language Client
 
Pcr array data analysis 2013
Pcr array data analysis 2013Pcr array data analysis 2013
Pcr array data analysis 2013
 
Computer Networks
Computer NetworksComputer Networks
Computer Networks
 
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols5-LEC- 5.pptxTransport Layer.  Transport Layer Protocols
5-LEC- 5.pptxTransport Layer. Transport Layer Protocols
 
MagneTag Presentation Winter Quarter V3.0
MagneTag Presentation Winter Quarter V3.0MagneTag Presentation Winter Quarter V3.0
MagneTag Presentation Winter Quarter V3.0
 
running stable diffusion on android
running stable diffusion on androidrunning stable diffusion on android
running stable diffusion on android
 
Network performance overview
Network  performance overviewNetwork  performance overview
Network performance overview
 
PRESENTATION ON DATA STRUCTURE AND THEIR TYPE
PRESENTATION ON DATA STRUCTURE AND THEIR TYPEPRESENTATION ON DATA STRUCTURE AND THEIR TYPE
PRESENTATION ON DATA STRUCTURE AND THEIR TYPE
 
456589.-Compiler-Design-Code-Generation (1).ppt
456589.-Compiler-Design-Code-Generation (1).ppt456589.-Compiler-Design-Code-Generation (1).ppt
456589.-Compiler-Design-Code-Generation (1).ppt
 
USART - 8251 / usart-8251A Pallav Shukla
USART - 8251 / usart-8251A Pallav ShuklaUSART - 8251 / usart-8251A Pallav Shukla
USART - 8251 / usart-8251A Pallav Shukla
 
Wpmc2004 phy protection
Wpmc2004 phy protectionWpmc2004 phy protection
Wpmc2004 phy protection
 
Expl sw chapter_02_switches_part_1
Expl sw chapter_02_switches_part_1Expl sw chapter_02_switches_part_1
Expl sw chapter_02_switches_part_1
 
Networking
NetworkingNetworking
Networking
 
hajer
hajerhajer
hajer
 
PPP
PPPPPP
PPP
 

More from Felipe Prado

DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryDEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryFelipe Prado
 
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...Felipe Prado
 
DEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsDEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsFelipe Prado
 
DEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionDEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionFelipe Prado
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101Felipe Prado
 
DEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentDEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentFelipe Prado
 
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareDEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareFelipe Prado
 
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...Felipe Prado
 
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationDEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationFelipe Prado
 
DEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceDEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceFelipe Prado
 
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionistDEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionistFelipe Prado
 
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksDEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksFelipe Prado
 
DEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud securityDEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud securityFelipe Prado
 
DEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsDEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsFelipe Prado
 
DEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchDEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchFelipe Prado
 
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...Felipe Prado
 
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksDEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksFelipe Prado
 
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationDEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationFelipe Prado
 
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncDEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncFelipe Prado
 
DEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesDEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesFelipe Prado
 

More from Felipe Prado (20)

DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directoryDEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
DEF CON 24 - Sean Metcalf - beyond the mcse red teaming active directory
 
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
DEF CON 24 - Bertin Bervis and James Jara - exploiting and attacking seismolo...
 
DEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got antsDEF CON 24 - Tamas Szakaly - help i got ants
DEF CON 24 - Tamas Szakaly - help i got ants
 
DEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryptionDEF CON 24 - Ladar Levison - compelled decryption
DEF CON 24 - Ladar Levison - compelled decryption
 
DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101DEF CON 24 - Clarence Chio - machine duping 101
DEF CON 24 - Clarence Chio - machine duping 101
 
DEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a governmentDEF CON 24 - Chris Rock - how to overthrow a government
DEF CON 24 - Chris Rock - how to overthrow a government
 
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardwareDEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
DEF CON 24 - Fitzpatrick and Grand - 101 ways to brick your hardware
 
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
DEF CON 24 - Rogan Dawes and Dominic White - universal serial aBUSe remote at...
 
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustrationDEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
DEF CON 24 - Jay Beale and Larry Pesce - phishing without frustration
 
DEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interfaceDEF CON 24 - Gorenc Sands - hacker machine interface
DEF CON 24 - Gorenc Sands - hacker machine interface
 
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionistDEF CON 24 - Allan Cecil and DwangoAC -  tasbot the perfectionist
DEF CON 24 - Allan Cecil and DwangoAC - tasbot the perfectionist
 
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locksDEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
DEF CON 24 - Rose and Ramsey - picking bluetooth low energy locks
 
DEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud securityDEF CON 24 - Rich Mogull - pragmatic cloud security
DEF CON 24 - Rich Mogull - pragmatic cloud security
 
DEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portalsDEF CON 24 - Grant Bugher - Bypassing captive portals
DEF CON 24 - Grant Bugher - Bypassing captive portals
 
DEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitchDEF CON 24 - Patrick Wardle - 99 problems little snitch
DEF CON 24 - Patrick Wardle - 99 problems little snitch
 
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
DEF CON 24 - Plore - side -channel attacks on high security electronic safe l...
 
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucksDEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
DEF CON 24 - Six Volts and Haystack - cheap tools for hacking heavy trucks
 
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitationDEF CON 24 - Dinesh and Shetty - practical android application exploitation
DEF CON 24 - Dinesh and Shetty - practical android application exploitation
 
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vncDEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
DEF CON 24 - Klijnsma and Tentler - stargate pivoting through vnc
 
DEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devicesDEF CON 24 - Antonio Joseph - fuzzing android devices
DEF CON 24 - Antonio Joseph - fuzzing android devices
 

Recently uploaded

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

DEF CON 27 - DAMIEN CAUQUIL - defeating bluetooth low energy 5 prng for fun and jamming

  • 1. ra Defea ng Bluetooth Low Energy PRNG for fun and jamming Damien ”virtualabs” Cauquil | DEF CON
  • 2. ra Who am I ? • Security Evangelist @ digital.security • Senior Security Researcher • Main developer of BtleJack (a BLE swiss-army tool) virtualabs /
  • 4. ra Bluetooth Low Energy Protocol Origins Bluetooth Low Energy has been introduced in as Bluetooth Smart, in Bluetooth Core Specifica ons version . . Evolved since then: version . ( ), version . ( ), version ( ) and version . ( ) /
  • 5. ra Bluetooth Low Energy Protocol Security mechanisms • Pairing: key exchange with PIN code, OOB or ECDH • Secure connec ons: encrypted and authen cated communica on • Channel Selec on Algorithm: not a security mechanism, but makes sniffing complicated /
  • 6. ra Bluetooth Low Energy Protocol Known a acks (BLE <= . ) • Sniffing: stealing secrets sent through non-secure and secure BLE connec ons • Jamming: disrup ng an exis ng BLE connec on • Hijacking: taking over an exis ng BLE connec on /
  • 7. ra Bluetooth Low Energy Protocol Required hardware /
  • 8. ra Bluetooth Low Energy Protocol BtleJack • Swiss-army knife to perform Bluetooth Low Energy a acks • Compa ble with Micro:Bit and other nRF boards /
  • 9. ra New features introduced in BLE • Be er throughput (up to Mbps) • Be er range (up to feet – meters) • Improved coexistence /
  • 10. ra New features introduced in BLE Be er throughput / be er range BLE adds two new PHYs: • Mbps uncoded PHY: twice the speed of BLE .x • LE Coded PHY: range × ( kbps) or range × ( kbps) /
  • 11. ra New features introduced in BLE LE Coded PHY vs LE uncoded PHY /
  • 12. ra /
  • 13. ra New features introduced in BLE Improved coexistence BLE also adds a new Channel Selec on Algorithm (CSA # ) • Designed to replace the old algorithm: Channeln+ = (Channeln + hopInc) mod • PRNG-based: more ”random” than CSA # /
  • 14. ra New features introduced in BLE Improved coexistence BLE adds a ChSel bit in the adver sing channel PDU header: /
  • 15. ra New features introduced in BLE Consequences regarding known a acks • A completely different hopping pa ern ( -hop instead of -hop sequence) is used • We won’t be able to sniff, jam or hijack BLE devices • We need a new hardware that supports BLE new PHYs /
  • 16. ra /
  • 18. ra BLE PRNG overview • It uses a channel iden fier as a seed • It relies on basic opera ons (add, mul ply, xor, bit permuta ons) • Channel remapping is performed if not all channels are in use /
  • 19. ra BLE PRNG overview Channel Iden fier Channel iden fier is first computed from Access Address, as described in the specs: /
  • 20. ra BLE PRNG overview MAM This PRNG relies on a basic rou ne called MAM: /
  • 21. ra BLE PRNG overview Random number genera on It generates a random number based on channelIden fier and a counter: /
  • 22. ra BLE PRNG overview Channel Selec on Algorithm # Based on the output of this PRNG, it selects a specific channel: /
  • 23. ra /
  • 24. ra /
  • 25. ra Breaking this PRNG I see some flaws in here ... • channelIden fier is computed from Access Address ... which is PUBLIC ! /
  • 26. ra Breaking this PRNG I see some flaws in here ... • channelIden fier is computed from Access Address ... which is PUBLIC ! • Next value is generated from a COUNTER, not from some previous internal state ! /
  • 27. ra Breaking this PRNG From unknown bits to , easy peasy Access Address is broadcasted in every packet! /
  • 28. ra Breaking this PRNG PRNG ? really ? prn_e = PRNG(channelIdentifier, counter) • channelIden fier is constant • it generates a fixed sequence of values, indexed by counter /
  • 29. ra /
  • 30. ra Breaking this PRNG Waht do we need to break it ? • Consider channelIden fier as known /
  • 31. ra Breaking this PRNG Waht do we need to break it ? • Consider channelIden fier as known • We are le with an unknown -bit counter /
  • 32. ra Breaking this PRNG Waht do we need to break it ? • Consider channelIden fier as known • We are le with an unknown -bit counter • If we can figure out where we are in the sequence of values, we would find out this counter value /
  • 34. ra Ge ng informa on from RF As an a acker, we can only monitor an exis ng BLE connec on and: • determine WHEN a packet is sent over a specific channel • determine the me spent between two packets transmi ed on two channels /
  • 35. ra Ge ng informa on from RF Channels are not -bit values If all data channels are used: channel = prn_e mod else: channel = remappingIndex[ (N×prn_e) ] /
  • 36. ra First approach: using a sieve • Pre-requisite: we know the hopInterval used for the target connec on (i.e. me spent between two hops) • Our goal: to eliminate every possible candidate in the smallest number of rounds /
  • 37. ra First approach: using a sieve How it works Considering a counter of , we compute channel C from PRNG with this candidate counter, and wait for a valid packet /
  • 38. ra First approach: using a sieve How it works Once a valid packet received, we compute the next channel (C ) and we wait for a valid packet again: /
  • 39. ra First approach: using a sieve How it works We deduce the me spent between these two packets: /
  • 40. ra First approach: using a sieve How it works And we convert it into a number of hops: /
  • 41. ra First approach: using a sieve How it works We then sieve the sequence of channels to only keep poten al candidate indexes: Sequence = {..., C , ..., C N hops , ...} And we end up with a list of candidate counter values at T (between and , most of the me) /
  • 42. ra First approach: using a sieve How it works Then, we consider the first candidate and: • we compute C and C /
  • 43. ra First approach: using a sieve How it works Then, we consider the first candidate and: • we compute C and C • we wait for a packet on channel C /
  • 44. ra First approach: using a sieve How it works Then, we consider the first candidate and: • we compute C and C • we wait for a packet on channel C • we wait for another packet on channel C /
  • 45. ra First approach: using a sieve How it works Then, we consider the first candidate and: • we compute C and C • we wait for a packet on channel C • we wait for another packet on channel C • we deduce the number of hops /
  • 46. ra First approach: using a sieve How it works Then, we consider the first candidate and: • we compute C and C • we wait for a packet on channel C • we wait for another packet on channel C • we deduce the number of hops • we sieve our list of candidates to only keep the matching ones /
  • 47. ra First approach: using a sieve How it works Repeat un l one candidate le ! (This is the counter value at T ) /
  • 48. ra First approach: using a sieve Implementa on (video) Since I did not have a BLE compa ble device, I simulated this a ack: -> Attacker waited 21 hops until a packet arrived on channel 0 >> Filtering candidates ... -> Candidate 20476 removed -> Candidate 45108 removed -> Remaining candidates: 22967 >> Found initial counter: 22967 INFO: Attack required 209 hops /
  • 49. ra /
  • 51. ra Guessing the hop interval Using our previous measures hopInterval = GCD(δT , δT , δT , ...) /
  • 52. ra Guessing the hop interval Simula ng (again) $ python3 csa2-hopinter-simulate.py [system] Hop interval: 2220 Deduced hop interval after 2 deltas: 8880 Deduced hop interval after 3 deltas: 4440 Deduced hop interval after 4 deltas: 4440 Deduced hop interval after 5 deltas: 2220 Deduced hop interval after 6 deltas: 2220 [...] Deduced hop interval after 10 deltas: 2220 /
  • 53. ra Guessing the hop interval Efficiency # of measures approx. success rate Max. me required (s) % % % % % % /
  • 54. ra From theory to prac ce: breaking CSA # on the field
  • 55. ra I bought some BLE compa ble devices /
  • 56. ra Improving Btlejack Channel map and hopInterval recovery • Btlejack can do the job but only for Mbps uncoded PHY • I modified Btlejack to compute hopInterval while mapping channels • This GCD-based technique works pre y well =) /
  • 57. ra Improving Btlejack Example output # btlejack -f 0x9af4493f -5 -d /dev/ttyACM2 BtleJack version 2.0 [i] Using cached parameters (created on 2019-07-23 00:47:59) [i] Detected sniffers: > Sniffer #0: fw version 2.0 [i] Synchronizing with connection 0x9af4493f ... ✓ CRCInit: 0x6f1c40 ✓ Channel Map = 0x0774ea8a3c ✓ Hop interval = 160 /
  • 58. ra /
  • 59. ra Improving Btlejack Implemen ng our sieve a ack on counter I implemented this algorithm and tested it: • First round went pre y well: I got about candidates filtered /
  • 60. ra Improving Btlejack Implemen ng our sieve a ack on counter I implemented this algorithm and tested it: • First round went pre y well: I got about candidates filtered • Next rounds messed up: I was not able to guess the counter value /
  • 61. ra Improving Btlejack Implemen ng our sieve a ack on counter Filter out candidates took a hell of a me, thus inducing a delay ! (Sor ng algorithms did not help) /
  • 62. ra /
  • 63. ra Improving Btlejack Re-designing our sieve a ack To solve this problem, I moved from a sieve to a pa ern-matching algorithm: • Measure first (number of hops between different consecu ve channels) /
  • 64. ra Improving Btlejack Re-designing our sieve a ack To solve this problem, I moved from a sieve to a pa ern-matching algorithm: • Measure first (number of hops between different consecu ve channels) • You end up with δT values (δT to δT ) /
  • 65. ra Improving Btlejack Re-designing our sieve a ack To solve this problem, I moved from a sieve to a pa ern-matching algorithm: • Measure first (number of hops between different consecu ve channels) • You end up with δT values (δT to δT ) • Look for this hopping pa ern in our sequence and deduce counter /
  • 66. ra counter guessing is now working, YAY ! /
  • 67. ra /
  • 68. ra Improving Btlejack hops why Pa ern matching took about hops to complete ! /
  • 69. ra Sniffing a BLE connec on with CSA # [i] Synchronizing with connection 0x31204f95 ... ✓ CRCInit: 0x40d64f ✓ Channel Map = 0x1fffffffff ✓ Hop interval = 160 ✓ CSA2 PRNG counter = 5137 [i] Synchronized, packet capture in progress ... LL Data: 0e 08 04 00 04 00 52 10 00 01 LL Data: 02 08 04 00 04 00 52 10 00 00 LL Data: 02 08 04 00 04 00 52 10 00 01 LL Data: 0e 08 04 00 04 00 52 10 00 00 LL Data: 0e 08 04 00 04 00 52 10 00 01 /
  • 70. ra Jamming a BLE connec on with CSA # # btlejack -f 0x91a7471f -m 0x1fffffffff -p 160 -5 -j BtleJack version 2.0 [..] [i] Synchronizing with connection 0x91a7471f ... ✓ CRCInit: 0x21a31e ✓ Channel map is provided: 0x1fffffffff ✓ Hop interval is provided: 160 ✓ CSA2 PRNG counter = 1199 [i] Synchronized, jamming in progress ... [!] Connection lost. [i] Quitting /
  • 73. ra Conclusion Bluetooth Low Energy CSA # PRNG is weak: • It is not really a PRNG • bits out of can be easily guessed from a public value • The last bits compose a counter that is periodically incremented /
  • 74. ra Conclusion This PRNG: • is thought to improve coexistence, not security • is designed to be easily implemented on low-power devices /
  • 75. ra Conclusion • We should use Nordic’s nRF rather than the old nRF • S ll a lot of work to port BtleJack to this pla orm • But luckily, Marcus Meng has done a great job with nRF /
  • 76. ra Research materials Python scripts and notes https://github.com/virtualabs/ble5-research /
  • 77. ra Thank you ! Ques ons ?  @virtualabs  damien.cauquil@digital.security /
  • 78. ra Further readings • https://virtualabs.fr/defcon26/ DC26-DamienCauquil-YoudBetterSecureYourBLEDevices.pdf • https://www.alchemistowl.org/pocorgtfo/pocorgtfo17.pdf • https://github.com/mame82/misc/blob/master/logitech_vuln_ summary.md /