WEBVTT

00:00.000 --> 00:01.520
All the way from France.

00:02.020 --> 00:06.740
One for all and all for WHD, wireless shenanigans made easy.

00:06.740 --> 00:10.080
Please welcome to the stage Damien and Roman.

00:13.610 --> 00:14.930
Hello DEF CON!

00:17.190 --> 00:30.110
Okay so this is uh last talk for today on this track and we are going to present you uh something we've been working on uh since more than two years now and this is what?

00:32.470 --> 00:34.650
Oh as usual.

00:35.110 --> 00:37.930
Okay so uh let me introduce ourselves.

00:37.930 --> 00:41.210
I'm Damien, Damien Coquille from Quarkstab.

00:41.210 --> 00:46.690
I'm the maintainer of a tool called BTE Jack or Beto Jack, call it what you want.

00:46.690 --> 00:53.090
Uh this is a BLE Swiss Army tool and uh I love reversing stuff as well on embedded systems.

00:53.090 --> 00:58.110
And this is Roman, the maintainer of Mirage, another BLE Swiss Army tool.

00:58.110 --> 01:01.930
But not only BLE does ZigBee and some other protocol as well.

01:01.930 --> 01:08.090
And uh he loves cross protocol attacks and we are going to talk a bit uh about this later in the talk.

01:08.510 --> 01:14.810
So what is what and why we had to create this uh framework?

01:14.970 --> 01:17.610
So basically wireless tools are a mess.

01:17.610 --> 01:23.270
A lot of researchers did a lot of research on wireless protocols and they create a lot of tools.

01:23.270 --> 01:27.830
Different tools with different protocols and different devices and different firmwares.

01:27.830 --> 01:34.970
Uh each firmware communicates with the host or computer with a specific protocol designed by each person.

01:34.970 --> 01:38.810
And basically everyone revents the wheel because why not?

01:38.890 --> 01:47.450
And if you are into, yep, if you are into wireless protocol hacking, you may have to use a lot of different tools.

01:47.450 --> 01:58.950
So for BLE, the classic tools, BTD, Mirage, uh Gattacurl, SniffID, uh are the best way to to capture information and test some devices.

01:59.090 --> 02:02.910
And in the end, you end up with a lot of devices.

02:02.910 --> 02:09.250
So if you want to be able to tackle with all these protocols, you need to buy at least all of these.

02:09.570 --> 02:13.210
And the problem is um that it takes a lot of space.

02:13.210 --> 02:15.450
It costs a lot uh as well.

02:15.450 --> 02:19.350
And most of this hardware uh can be discontinued at any time.

02:19.350 --> 02:26.630
So if you want to to hack some wireless protocol, there is this tiny hardware you didn't buy 2 years ago.

02:26.630 --> 02:31.010
And it's the only hardware that is supported for hacking this specific protocol.

02:31.010 --> 02:33.530
So that's uh that's a shame.

02:33.530 --> 02:36.030
And basically this is just a waste of time.

02:36.090 --> 02:52.610
And because uh you need to create a different uh each researcher create different firmware and uh um each researcher or each person trying to hack a wireless protocol uh is going to face the same issues other people have already had before and uh with the same solution as well.

02:52.850 --> 02:56.190
And uh all of this in fact creates fragmentation.

02:56.190 --> 03:00.610
And uh this is uh this is not good for us uh this kind of fragmentation.

03:03.120 --> 03:14.760
So we uh talked a lot together and uh we try to find a solution to solve this fragmentation issue.

03:14.980 --> 03:21.000
So uh it leads us to uh come with a three main ideas.

03:21.000 --> 03:33.900
So uh the first one uh would be to design uh communication protocol for the communication between the host and uh the other world that would be extensible.

03:33.900 --> 03:40.400
And either these that would support multiple wireless protocols, multiple physical layers uh at the same time.

03:40.400 --> 03:45.720
And of course uh that could be open source and easy to extend.

03:45.800 --> 04:06.840
Uh the second uh big idea uh would be to uh create a set of libraries, a framework, and basically a world ecosystem uh that will allow uh some use of uh values uh ready to use features for different hardware, different platforms.

04:06.840 --> 04:11.600
And that would be available both for the host and the firmware.

04:12.060 --> 04:28.300
And uh the third main uh idea we came with is uh that for uh these two works uh it must uh from the beginning encourage the interoperability and the collaboration between the researchers.

04:28.300 --> 04:41.900
So uh it motivated us to build everything as open source software and to uh evenly document both the use uh of the tools but also uh its design.

04:43.020 --> 04:54.360
So uh here comes the main uh part uh of WAD for this project, which is the WAD protocol.

04:54.360 --> 04:59.100
So we have several guidelines that have motivated uh its development.

04:59.100 --> 05:05.160
So first uh it's a standardized protocol so we we properly defined it.

05:05.160 --> 05:08.780
Everything uh is uh documented and explained.

05:08.840 --> 05:18.500
It's uh generic so it covers uh a set of wireless capabilities that are uh already uh in the ecosystem.

05:18.500 --> 05:23.900
It's modular so you can support multiple uh wireless protocols.

05:23.900 --> 05:30.480
Uh and uh if you want to add more and put your own, it's a protocol which is evolutive.

05:30.480 --> 05:36.360
So the protocol has been designed to be easily extended and improved over time.

05:36.700 --> 05:42.520
And finally uh we also tried to make it as user friendly as possible.

05:42.520 --> 05:56.080
So uh we developed a set of C, C++, and Python parsing libraries uh allowing to facilitate uh its integration into uh your framework uh and so on.

05:56.440 --> 06:08.240
So another uh key uh idea behind WAD is uh to offload most of the complexity from the firmware side to the uh outside.

06:08.480 --> 06:13.760
So of course on the firmware side we have some CPU uh some memory limitations.

06:13.780 --> 06:19.360
And so the idea was uh to keep only uh what is uh needed.

06:19.360 --> 06:25.260
So some atomic uh wireless primitives uh as basic as possible.

06:25.280 --> 06:31.800
Uh and of course the operations that are time critical and that could not be offloaded to the host.

06:31.800 --> 06:34.020
So for example the channel opening, this kind of stuff.

06:34.200 --> 06:45.560
So we keep uh a minimal logic in the firmware and all the attack, the protocol stacks, the packet detectors and so on are implemented on the host.

06:46.540 --> 06:59.320
So finally uh WAD has been designed uh not only uh for hackers, if any, if we are in a hacker conference, but uh also for uh everyone.

06:59.320 --> 07:02.720
So if you are a security researcher uh you can use it.

07:02.720 --> 07:18.960
If you are just a wireless uh enthusiast and you want to control uh your IoT devices uh or if you are just a curious user and you want to understand how uh your favorite wireless toy works.

07:22.000 --> 07:26.280
Alright so uh what is WAD in fact?

07:26.340 --> 07:39.860
Uh Romain introduced the main concept behind this uh this framework but in fact uh technically uh first the name because you know when you start a project you get you got to find a name and it's always a pain in the ass to find something yeah meaningful.

07:40.080 --> 08:05.640
Uh so WAD stands originally for Wireless Hacking Devices because it was uh supposed to support a lot of wireless uh so a lot of devices to hack into wireless protocols and after having used this projects uh during more than a year uh yeah wireless hacking for them is also a great name because it's uh makes things easier and we are going to show that in multiple demos.

08:06.200 --> 08:36.060
Uh like Romain said it's more than a protocol uh because designing a protocol, a communication protocol between a host and a device that's a thing and this is something uh we we already did uh two of us uh for our respective tools but in fact providing uh uh an ecosystem with uh the protocol all libraries in Python and in C and C++ that you can embed in your firmware and use to communicate with the host without having uh you know uh without worrying about how the data is encoded and so on.

08:36.060 --> 08:39.200
This is uh this is a lifesaver.

08:39.200 --> 08:51.480
Uh you when you develop a firmware compatible with this uh ecosystem you the only thing you need to worry about is the specific code that runs and that handles all the radio frequency stuff.

08:52.160 --> 09:01.120
And uh also we provide a lot of tools uh command line interface tools and uh maybe some are more evolved and provide more features.

09:01.120 --> 09:08.540
But if you want to create your own applications based on a web on this ecosystem you can do uh as do it as well.

09:08.540 --> 09:12.860
And you can just use the Python client library and use it uh yeah.

09:12.860 --> 09:15.880
It's very simple to to develop something.

09:15.880 --> 09:21.320
From the protocol perspective it's based on protocol buffers so yeah no surprise here.

09:21.320 --> 09:32.800
And um the protocol has been thought uh in a way that the uh host can query the device uh about what uh the devices or capabilities are.

09:32.800 --> 09:48.100
So basically each device compatible device can announce itself to the uh wild ecosystem and especially to the host telling okay I I support this protocol uh I can do this with this protocol packet injection or just sniffing scanning anything.

09:48.140 --> 09:55.520
And the host adapts uh the the tools based on the uh capabilities announced by the device.

09:55.520 --> 10:01.460
And this is a discovery protocol that has been included in wild and uh this one is mandatory for any device.

10:01.460 --> 10:11.620
Uh you can have uh uh some hardware on the ZigBee protocol and the BLE or or even just modulation modulation and demodulation as well.

10:11.620 --> 10:19.320
Uh but in fact you can have some you can have multiple protocols supported by a single device with using this uh this system.

10:20.040 --> 10:24.420
Um we created a lot of firmware uh a lot of firmware.

10:24.420 --> 10:33.500
We actually we support uh if you have a look at the top uh top half of the screen, we support basically and natively 4 devices.

10:33.520 --> 10:40.820
Um some of them are based on Nordic Semiconductor NRF52 uh system and chips.

10:40.860 --> 10:45.100
Uh so basically the there is the ESP32WROOM from Espressif.

10:45.100 --> 10:58.280
The Nucleo WL55 which is uh uh Lora and the Sigfox uh transceiver from STMicro uh that's supported and uh also yeah I told you about the NRF52.

10:58.280 --> 11:09.400
But the most interesting part is that we uh managed to create some uh adaptation layer between WAD and the old tools such as the uh Yardstick one or the Herbatools.

11:09.700 --> 11:15.040
And in fact we we we can use all these old devices if you can say with WAD.

11:15.040 --> 11:17.080
And this is totally transparent for you.

11:17.080 --> 11:22.540
So it's uh just it appears like a classic WAD tool or WAD device and you can use it to do whatever you want.

11:24.940 --> 11:31.300
The WAD protocol supports a lot of uh modulations uh file layers and other protocols.

11:31.300 --> 11:36.420
So basically this is the FSK, GFSK, MSK modulation on the physical layer.

11:36.420 --> 11:40.900
Uh so you can do demodulate and modulate signals using a specific device.

11:40.900 --> 11:45.020
And uh obviously the BLE protocol, ZigBee and so on also support it.

11:45.060 --> 11:53.380
Uh based on some previous research we made, Romain and I, we also added into WAD the result of this research.

11:53.380 --> 11:58.120
So Romain published in uh 2021 uh the Wasabi uh attack.

11:58.120 --> 12:01.440
So basically this is an attack on uh well not an attack.

12:01.440 --> 12:14.280
This is uh just a uh a way to divert the uh radio transceiver from an NRF50 to a system and chip to to make it able to sniff and inject ZigBee packets.

12:14.460 --> 12:31.900
And uh last year we presented also uh some uh research at WOOD uh which is basically how to turn an ESP32 into a uh a device uh that can sniff and inject raw PDUs in Bluetooth low energy uh communication.

12:31.900 --> 12:36.740
So yeah this uh this is also supported in the firmware and uh in the WAD protocol.

12:36.960 --> 12:39.080
Not WAD protocol but WAD ecosystem.

12:39.420 --> 12:43.940
Uh if you want to add new protocols to this uh like Romain said it's extensible.

12:43.940 --> 12:49.440
So you can uh just modify the protocol and add what you need to to implement it.

12:49.440 --> 12:55.820
All the uh uh all the translation between these messages and so on is performed by the framework.

12:55.820 --> 12:59.220
And uh the protocol is versioned as well so it is Blackboard compatible.

12:59.220 --> 13:07.780
If you have a device with version 1 protocol version 1 it will be supported uh as well as a device with a protocol version 2 and so on.

13:07.780 --> 13:22.100
And uh obviously we hope that uh many hackers may want to contribute to to WAD and add new protocols we didn't think about because we maybe don't know this protocol or so on.

13:23.400 --> 13:27.700
Um we also design our own flexible stack model.

13:27.700 --> 13:34.840
So speaking of wireless protocol we provide a specific flexible stack model sorry uh that is easy to modify.

13:34.840 --> 13:37.800
So basically take a BLE stack.

13:37.800 --> 13:42.900
You can just swap uh a specific layer and replace it with your one with your own.

13:42.900 --> 13:47.720
You can develop your own stack layer and replace it in a in the stack.

13:47.720 --> 13:55.340
So basically you can implement some very specific behavior if you want to test some uh unexpected uh behavior this is a way to to do.

13:55.380 --> 14:01.600
Uh there is a complete stack snapshot that is implemented from scratch uh in the in this model.

14:01.600 --> 14:09.240
So for each every protocol supported every protocol stack we got in WAD you can do at any time a snapshot of the old stack.

14:09.240 --> 14:16.780
Uh save this snapshot on the on your disk and reload this snapshot later if you want to test uh something on this uh this framework.

14:16.780 --> 14:25.260
And also this uh older flexible stack model uh makes uh writing unique tests very easy because you can just isolate a layer.

14:25.280 --> 14:31.900
Send inputs and check what outputs uh came and if it uh what you are expected from this layer.

14:32.580 --> 14:38.040
And um in WAD actually we provide uh multiple protocol stack.

14:38.040 --> 14:41.540
Uh BLE for version 4, version 5 is on its way.

14:41.540 --> 14:48.200
Uh Logitech Unifying, uh NShark Burst from Nordic, ZigBee, RF um RFOC, and LoRaWAN.

14:48.200 --> 14:57.920
So all these stacks have been uh implemented from scratch and are flexible in a way that you can make the stack behave the way it's not really expected by the specifications.

14:57.940 --> 15:04.720
So this uh allows uh security research uh if you want to try uh unexpected ways to to go through the stack.

15:04.720 --> 15:09.960
And uh if you want just want to use the protocol as well you can just use them and it works as expected.

15:09.960 --> 15:21.320
So this is uh this is why Romain said it was made for uh secure cyber security specialists, researchers, and also uh just uh enthusiast, wireless protocol enthusiast, or just user.

15:21.400 --> 15:29.880
Um and uh we also love KISS uh not the uh rug band uh obviously but the keep it simple stupid uh principle.

15:29.980 --> 15:40.720
And WAD provides a set of simple common tools and um a mean to combine them uh to combine all these tools into uh in order to create more complex tools.

15:41.160 --> 15:46.860
Uh and we also provide some full feature tools for those who want to just to experiment with uh a protocol .

15:46.940 --> 15:54.540
And um yeah if you're a newcomer in wireless protocol exploitation or or just if you want to play with some protocol you we got you covered.

15:56.140 --> 16:00.520
Uh just to give you an an idea of what's going on with WAD and this uh KISS principle.

16:00.820 --> 16:11.240
Um I don't know if it's really readable in the screen but uh basically we are using uh a first program called WBD connect to initiate a WBD connection into a device.

16:11.380 --> 16:16.600
Then there is a pipe with a W-shark which is a uh wrapper for Wireshark.

16:16.600 --> 16:25.220
And then another pipe with WBD central profile and basically what this command does is just tells what to first initiate a connection to the device.

16:25.460 --> 16:31.100
Then to ask uh the the device it's a BAD services and characteristics.

16:31.100 --> 16:35.180
So it's basically an enumeration performed by the uh WBD central.

16:35.320 --> 16:44.400
And every packet sent between the connection and the uh central which is a GATT client is monitored by Wireshark in real time.

16:44.840 --> 16:48.280
And you can compose all the tools this way.

16:48.280 --> 16:50.320
You create a processing packet chain.

16:50.560 --> 16:53.020
Uh yeah that's it.

16:53.020 --> 16:53.400
I don't know.

16:53.400 --> 16:55.300
Maybe I I get it wrong.

16:55.300 --> 17:00.100
But um you create a chain of uh of packet processing and you can do whatever you want.

17:00.100 --> 17:02.800
We are going to show you some other tool we developed.

17:02.800 --> 17:11.940
And it allows some yeah some a lot of flexibility you know in the um what can be done with this uh this uh these things.

17:11.940 --> 17:19.340
And obviously we also created in the framework a lot of uh um wrappers for creating uh command line applications.

17:19.340 --> 17:29.480
So if you need to create some command line tools or do your own tools, you you got everything you need to um wrap the connection to the hardware and so on.

17:31.240 --> 17:32.360
Yep.

17:32.760 --> 17:33.980
Uh the clicker.

17:33.980 --> 17:34.940
Yeah.

17:34.940 --> 17:37.480
So uh I'm going to start with the first demo.

17:37.480 --> 17:43.080
This is uh we we got uh 13 demos to to show you what what is capable of.

17:43.200 --> 17:46.700
Uh so the first one is the BLE exploring demo.

17:46.700 --> 17:52.380
So basically we are I'm going to to show you the WBD central tool.

17:52.380 --> 17:52.980
So this is the WBD central.

17:52.980 --> 18:06.940
This is basically uh a GATT client and uh and what I'm going to do here is to scan devices, connect to the device, a specific device, in a way so this is BLE services and characteristics and return what's on data from this.

18:06.940 --> 18:09.000
So I guess nope.

18:09.440 --> 18:15.220
Okay so the setup is just should be this one.

18:19.220 --> 18:23.660
So basically we launch a scan using WBD central.

18:23.660 --> 18:26.860
We are using uh an HCI adapter for BLE.

18:26.860 --> 18:32.820
We can get all the information, all the advertising records sent by the uh the device.

18:32.820 --> 18:38.420
Once you found your your device or target device you can connect to it through the connect command.

18:38.420 --> 18:41.440
So this is an interactive shell provided by WBD central.

18:41.440 --> 18:48.800
Then the connection is made and we uh launch a profile command to start enumerating services and characteristics.

18:48.800 --> 19:01.100
We can find uh we have found a device name characteristic uh and a manufacturer name characteristics in two different services and we're going to read the content of this characteristics using a read command.

19:01.100 --> 19:07.360
And we get everything and uh we can also write into characteristics and subscribe for notification.

19:07.360 --> 19:09.900
The basics a GATT client can do.

19:09.900 --> 19:14.020
Oh this is for the next demo.

19:14.160 --> 19:20.260
So basically this is just an example of a full feature tool uh in WAD and this is a very basic one.

19:35.310 --> 19:53.130
So uh second uh full feature tool we developed uh is a tool named uh ZigBee and device uh that will allow us to interact with uh ZigBee networks uh and uh emulate basically a ZigBee and device.

19:53.130 --> 20:16.770
So thanks to this tool you will be able to detect uh the surrounding ZigBee networks uh to join a specific network uh perform all the cryptographic operation this kind of stuff and get the network key uh associated with the network enumerate the devices on the network and interact uh with the various ZigBee devices.

20:16.990 --> 20:28.510
So uh here you have a small demo showing a small ZigBee network uh on the camera and you have an example of the use of this tool.

20:28.510 --> 20:34.470
So first we perform a scan operation to discover the surrounding networks.

20:34.510 --> 20:44.250
So it takes some time but uh finally uh we can see that we have one uh ZigBee network.

20:44.250 --> 21:01.670
So let's join uh this network and perform the association procedure so we are able to see the network key and now we are associated and we can uh interact and discover the nodes in the networks and the endpoints for every nodes.

21:02.650 --> 21:23.630
So then uh we have a list of clusters that allows us to uh interact with uh the nodes and we can use the cluster command to toggle uh a light bulb for example uh to get it off and so on.

21:52.180 --> 22:04.220
So sorry uh we have also uh another tool named what sniff which is a generic tool so it's a multi-protocol sniffing tool.

22:04.220 --> 22:22.860
Uh so what sniff uh works with all uh the protocols that are supported uh by WAD so ZigBee, BLE, RFC, you can even uh directly sniff uh PHY uh so uh physical layer um configured as you want.

22:22.860 --> 22:36.040
Uh it provide different uh output formats so you can directly display the SCAPI packets uh with the different fields uh correctly dissected uh or directly a next dump uh version of the packet.

22:36.040 --> 22:46.220
Uh and it allow to uh when it was a traffic and do value stuff like exporting data to a PCAP uh when it's a ring uh with Wireshark.

22:46.220 --> 22:55.320
So here you have uh some uh basic uh use cases of uh what sniff.

22:55.320 --> 23:02.520
So here we are going uh to uh display uh some BLE advertisements.

23:02.520 --> 23:07.980
So here you can see the SCAPI uh representation.

23:08.880 --> 23:16.800
Then we can switch the formats to xdump and so here we have the xdump version of our packets.

23:17.620 --> 23:29.020
We can uh also uh collect these uh packets using uh uh directly the physical uh layer of Bluetooth energy.

23:29.020 --> 23:33.600
So we provide the modulation, Gaussian frequency shift scaling, then the deviation.

23:34.700 --> 23:44.340
Uh we provide the frequency uh and uh uh finally the size uh of the packets.

23:44.340 --> 23:50.000
And here we get a raw dump uh straight out the demodulator output.

23:50.000 --> 23:54.300
So uh it can be useful for specific analysis.

23:55.500 --> 24:12.660
And uh uh finally we can also uh for with this what sniff tool uh directly export the traffic to uh PCAP for further analysis.

24:12.660 --> 24:19.440
So here all the traffic is simultaneously displayed on the screen and exported to PCAP.

24:36.800 --> 24:46.100
So uh an interesting uh feature uh of WAD is that you can combine uh several tools uh with pipes.

24:46.140 --> 24:50.900
So what sniff can be chained with uh several tools.

24:50.900 --> 24:59.640
So for example you can uh use what filter that uh may allow to apply some filtering uh on the received packets.

24:59.640 --> 25:07.380
Uh you can transform uh the packets on the fly uh if it matches a specific filter.

25:07.380 --> 25:19.920
Or you can also use some tools like uh WAD extract uh that may allow to extract uh a specific uh field uh from the packets.

25:20.000 --> 25:23.920
So let's go uh for an example of that.

25:23.920 --> 25:27.760
So here it's uh the same example with what sniff.

25:28.620 --> 25:33.880
And uh we are going to pipe uh what sniff with uh what filter.

25:34.000 --> 25:41.120
And in what filter we are going to provide a filter to keep only a specific kind of other types of packets.

25:41.120 --> 25:43.020
So the add and packets.

25:43.600 --> 25:50.180
And finally if we want uh to extract a specific field we can use uh WAD extract.

25:50.220 --> 25:53.480
We provide the field we want to extract.

25:53.480 --> 25:56.040
So here is the bid address.

25:56.040 --> 26:01.540
And we also export a part of the metadata so the RSSI.

26:01.880 --> 26:09.680
And of course you can then grab this output and provide it uh to classical Unix tool.

26:10.820 --> 26:22.040
So uh what sniff uh has a lot of uh usage and it may even allow to perform uh some uh complex uh attacks.

26:22.040 --> 26:32.000
So typically uh in this demo we are going to attack an RF4C communication between a remote uh controller and a setup box.

26:32.000 --> 26:39.840
So uh typically RF4C is a lightweight variant uh of ZigBee for remote controller.

26:39.840 --> 26:46.580
So here you have a setup uh with the remote controller on one side and what sniff on the other side.

26:47.060 --> 26:52.620
So here we are performing a pairing with the remote controller.

26:53.200 --> 26:59.940
And uh what sniff has been configured to automatically perform a brute force uh attack.

26:59.980 --> 27:13.820
And so in the input you can notice that the key uh has been uh automatically uh derived and extracted from the communication.

27:13.820 --> 27:21.580
And the packet uh which is uh normally encrypted can be uh decrypted uh on the fly.

27:21.580 --> 27:30.180
So it allows to sniff the various buttons that are pressed on the remote control.

27:32.020 --> 27:46.160
And uh it uh can also sniff the audio stream which can be transmitted uh using the mic of the remote controller.

27:46.500 --> 27:55.160
And uh uh we can even export uh the voice command.

27:57.940 --> 28:05.160
To a bad uh uh WAV file but yeah it's working.

28:09.360 --> 28:14.880
So uh next demonstration is about uh using Wireshark to sniff uh some traffic.

28:14.880 --> 28:21.520
So basically uh we showed this uh a bit earlier but uh we're going to go a bit deeper in this uh demo.

28:21.520 --> 28:24.320
So uh we can monitor everything with WShark.

28:24.320 --> 28:39.100
So this example is about BLE but it's if it could be ZigBee or even your if your if you are trying to demodulate packets through the through the file layer you can get it in Wireshark in real time and you can monitor everything you're working on.

28:39.100 --> 28:46.880
If you're uh use WFilter to modify your packet on the fly you can see the result in real time with the DWShark.

28:47.920 --> 28:49.940
So uh the demo is the following.

28:49.940 --> 28:53.320
I'm going to be very quick about this one.

28:54.220 --> 29:04.940
Yeah so basically we are again connecting to a device and so on and performing uh um uh services and characteristics is imminent uh enumeration.

29:04.980 --> 29:13.760
And uh everything uh can be monitored uh in Wireshark while the terminal shows you the uh results of this uh of this operation.

29:13.760 --> 29:17.100
So this is basically uh what WShark can do.

29:17.100 --> 29:24.180
And the most interesting thing is that uh we talked about uh Gatacore and BTDJuice at the beginning of the talk.

29:24.180 --> 29:33.640
So basically these tools are based on not on some Node.js uh library uh which are not no more maintained at the moment.

29:33.640 --> 29:42.900
So if you want to perform a man-in-the-middle attack on BLE with WAD this is very simple because you can combine tools.

29:42.900 --> 29:49.280
You can create for instance if you want to you know set up a man-in-the-middle attack on a device uh like Gatacore.

29:49.280 --> 30:00.200
You uh just create a command line starting with WBAD-spawn that will spawn a device with the corresponding parameters that will mimic the target device.

30:00.200 --> 30:08.000
And then you can pipe all the packets that will go uh from the this uh fake device or spoof device into Wireshark.

30:08.000 --> 30:10.260
You can so you can monitor in real time what's going on.

30:10.260 --> 30:20.600
And then uh once the smartphone for instance is uh is connected onto the spoof device uh then you are going to initiate a connection into the target device.

30:20.600 --> 30:31.160
And every packet sent by the smartphone uh or the target or the target device will be uh just forwarded as uh uh as it goes.

30:31.160 --> 30:32.980
And you can monitor everything in WShark.

30:32.980 --> 30:36.160
So this is uh the next demo I'm going to show you.

30:36.160 --> 30:44.100
Uh here so we are setting up uh Gatacore-like man-in-the-middle attack using uh WAD.

30:44.100 --> 30:46.780
Using simple tools again WBAD-spawn.

30:46.780 --> 30:49.400
This is a very small tool like WBAD-connect.

30:49.400 --> 30:59.940
And um we first the system is going to spawn a spoof device that just advertise itself like the target device.

30:59.940 --> 31:03.800
And the smartphone uh here is going to detect this device.

31:03.800 --> 31:12.500
When we initiate the connect when we push the connect button on the on the smartphone then the connection to the our spoof device is uh initiated.

31:12.500 --> 31:16.120
We can see on Wireshark what's going on with the BLE PDUs.

31:16.180 --> 31:25.460
And if you really try to read the characteristics for instance then all the PDUs are directly forwarded to the target device and back and forth and we can monitor everything.

31:25.580 --> 31:27.620
With Wireshark you can see what's going on.

31:27.620 --> 31:29.800
You can save it at the as a backup.

31:30.040 --> 31:40.180
And what we do here with Wireshark you can do it with any other generic tool we develop such as WFilter or WX well not WX but WFilter.

31:40.180 --> 31:46.220
And you can if you want make some changes into the packets using some specific filters.

31:46.220 --> 31:53.860
If you want to modify the answer uh the um response uh from a read operation on the characteristics you can do it on the fly.

31:53.860 --> 31:58.420
And you can also monitor what's going on because you can pipe WFilter with WShark as well.

31:59.260 --> 32:04.720
So this this is powerful even if this demo is not uh really powerful but yeah.

32:04.860 --> 32:05.900
Anyway.

32:06.420 --> 32:13.000
And if you want to emulate a BLE peripheral you can you can use uh the full feature of WBLE Perif.

32:13.000 --> 32:15.020
Uh so basically it goes like this.

32:15.040 --> 32:22.960
This is a command line tool you can use to just uh spawn a BLE device and populate the device with whatever you want.

32:22.960 --> 32:28.260
So basically you can change the name of the device and say that I'm going to create a device called Defcon32.

32:28.680 --> 32:31.840
Uh add a service and a characteristic to the device.

32:32.360 --> 32:36.680
Um I'm going to write the value of this characteristic as well.

32:36.680 --> 32:38.840
It should be Defcon32 I guess.

32:38.840 --> 32:44.040
And then uh I'm going to start a device on the uh right hand side of the screen.

32:44.040 --> 32:46.400
You got the uh screen of the smartphone.

32:47.420 --> 32:51.580
So let's start this uh spoof device or emulated device to be more precise.

32:51.580 --> 32:54.240
Uh yeah come on.

32:55.220 --> 33:01.640
Okay so it will pop on uh the um smartphone and we can connect to it.

33:01.780 --> 33:06.560
Um it will start the discovery process of services and characteristics.

33:06.560 --> 33:10.120
There is a single service with a single characteristic.

33:10.140 --> 33:12.320
And we can read the content.

33:12.320 --> 33:18.660
Each time we read from the smartphone the content of this characteristic this is caught by the BLE PRF uh tool.

33:18.660 --> 33:25.800
And uh if uh the smartphone subscribe to notification then it got nothing notified by the uh the system and so on.

33:25.800 --> 33:39.320
So this is a good way to play with uh uh applications and BLE applications to mimic some device if you want to see what happens when you are modifying some uh some properties of this uh of this device.

33:39.720 --> 33:50.960
Uh uh in practical situation this is not what we are going to use because it's uh you know just uh uh interesting when you want to play uh with uh a device.

33:50.960 --> 33:53.980
But uh a more interesting use is the following.

33:53.980 --> 34:01.800
Uh if you want to implement a very specific device with specific services and characteristics with a specific behavior for the characteristics here are a small example.

34:01.800 --> 34:05.660
We are going to create a battery device exposing your battery service with a battery level.

34:06.160 --> 34:12.060
Except that each time we are going to read the battery level we will decrease the level by 10%.

34:12.060 --> 34:17.060
And it goes like this when you emulate this uh peripheral.

34:17.720 --> 34:23.040
So basically uh we start the Python script that uh instruments everything.

34:23.040 --> 34:26.300
The device appears on the screen so there is a battery device.

34:26.300 --> 34:32.620
When the discovery goes with the services and characteristics we get one service with one battery level characteristics.

34:32.620 --> 34:40.580
And each time I read the characteristic value getting the percentage of uh battery level percentage then it is decreased.

34:40.580 --> 34:43.460
So this is just 10 lines of Python to do this.

34:47.460 --> 34:52.240
And uh we did the same with other protocols because we are talking a lot about BLE.

34:52.240 --> 34:55.200
Uh we got a lower one gateway implemented in WAD.

34:55.200 --> 35:05.640
So if you want to create a lower one network and get some device uh to associate with this uh with this uh fake network you can do it and it works pretty well.

35:05.640 --> 35:10.620
Uh I guess the demo will be a nightmare on the screens so I will skip it.

35:11.380 --> 35:20.360
Um but the media server of DEF CON has this uh has this demo so if you want to have a look at it uh please do.

35:20.560 --> 35:22.860
But uh I'm going to still skip this one.

35:22.860 --> 35:25.460
Uh and let Romain explain the rest.

35:25.890 --> 35:26.700
Yeah.

35:26.700 --> 35:38.860
So uh another uh example of what you can do uh with uh WAD is uh the emulation of various uh devices.

35:38.860 --> 35:57.460
And for example uh you can take a proprietary protocol like Logitech Unifying and you have a protocol stack which is implemented and various tools that will allow to uh perform uh a keyboard emulation, a mouse emulation uh for Logitech Unifying devices.

35:57.460 --> 36:05.600
So typically here we are going to use it to perform a scan uh operation of uh surrounding Unifying devices.

36:05.680 --> 36:09.920
Uh spoof uh the address of uh mouse.

36:09.920 --> 36:20.430
And then we are going to emulate the keyboard with this address to reproduce a vulnerability uh from mouse jack to inject an encrypted keystrokes to the computer.

36:20.920 --> 36:32.120
So here we start by uh using a small command line tool to perform a scan operation.

36:32.120 --> 36:44.180
It allows us to get the address of a mouse and we provide it uh in uh as argument of a Python script that will perform the injection.

36:44.180 --> 36:51.640
And as you can see uh we have a keystroke injection uh performed and fully emulated by WAD.

36:53.860 --> 36:54.720
Yeah.

36:54.720 --> 36:58.440
So you can see a lot of code written.

37:04.230 --> 37:09.390
So uh we can uh emulate a Logitech Unifying keyboard.

37:09.390 --> 37:13.330
We can also emulate a Logitech Unifying uh dongle.

37:13.590 --> 37:22.590
Uh and uh on the other uh side on BLE we are able to emulate a peripheral.

37:22.590 --> 37:41.610
So here comes a very useless idea which is to uh create a bridge uh which is cross protocol between a Logitech Unifying uh keyboard for example and a smartphone uh that will be connected to an emulated uh BLE keyboard.

37:41.990 --> 37:45.010
So uh we have a small script.

37:45.010 --> 37:55.970
You can see the screen uh of the smartphone and uh you can see uh a video with the keyboard uh at the bottom.

37:55.970 --> 37:59.970
So first we connect uh we emulate the BLE keyboard.

37:59.970 --> 38:06.090
We connect and pair the smartphone uh with this uh emulated BLE keyboard.

38:10.760 --> 38:30.740
And once the pairing uh is uh successful, now we can just press some key on the Logitech Unifying keyboard and it will be forwarded uh through the uh BLE emulated keyboard to the smartphone.

38:30.980 --> 38:33.100
So yeah.

38:33.100 --> 38:35.680
Completely useless but funny.

38:36.640 --> 39:00.460
And finally, our last demo uh is uh uh based on the idea that it's uh cool that WAD allows to uh access various hardware uh perform uh different operations uh but it would be even cooler if you could access it over internet.

39:00.460 --> 39:08.360
So uh we wrote uh a WAD server that will allow uh you to expose a WAD device uh over TCP.

39:08.780 --> 39:21.020
And so uh with any tool, any script, you will be able to connect uh to this WAD uh TCP server uh like if it was a local device.

39:21.400 --> 39:27.440
And uh for example, it can be useful to build relay attacks and that kind of stuff.

39:28.000 --> 39:37.260
So as uh in this next demo, so we are in two different uh cities in France.

39:37.340 --> 39:44.620
And I'm exposing uh my uh Bluetooth dongle uh using WAD server.

39:45.140 --> 39:57.420
Damien will use uh BLE central to connect to uh this uh remote devices and is able to connect to the light bulb next to me.

39:58.080 --> 40:01.240
Perform a profile uh discovery.

40:02.040 --> 40:18.000
And uh now he will be able to uh turn the light bulb on, turn the light bulb off, and modify uh the color.

40:18.240 --> 40:24.560
So typically uh it's interesting uh for building relay attacks.

40:24.560 --> 40:29.160
It can be interesting in various experiment uh setups.

40:29.380 --> 40:30.800
So sky is the limit here.

40:31.240 --> 40:38.580
Yeah uh and the interesting part here is yeah again we show it with BLE, but it can be done with any protocol as well.

40:38.580 --> 40:46.860
You can uh accept the Logitech unifying because you have some keep-alives that are messed up with the network.

40:46.860 --> 40:51.780
But in fact, you can once you are connected to a device, you can just discover everything.

40:52.500 --> 40:58.120
Yeah just like uh yeah it's the same if you connect the device on your computer.

40:58.120 --> 41:01.780
So basically it opens a wide range of possibility.

41:06.340 --> 41:14.520
So uh we are developing this project uh since a few years now.

41:14.520 --> 41:24.520
And uh it has been used uh internally so in Damien's company and in my research lab.

41:24.520 --> 41:45.560
So for example, one intern at Quark's lab, Baptiste Boyer, developed a BLE GAT fuzzer using WAD that leads to a CV linked to the expressive controller expressive BLE stack, sorry.

41:45.620 --> 41:55.620
And we also used it in a research project uh to evaluate the screaming channel attacks.

41:55.620 --> 42:04.020
So it allowed us to instrument the BLE protocol with custom link layer traffic.

42:04.020 --> 42:11.280
It's also a project which is already heavily used in some hardware CTFs.

42:11.280 --> 42:21.340
So for example, this year's edition of hardware IO, all the BLE challenges were fully emulated with WAD.

42:21.340 --> 42:28.080
And WAD has also been used in a lower one challenge to emulate a lower one gateway.

42:29.000 --> 42:38.820
So to conclude this talk, we are releasing today publicly this project.

42:38.820 --> 42:41.720
So it's available on pip.

42:41.720 --> 42:46.420
The documentation is available on read.docs.

42:46.420 --> 42:52.920
So we are going to improve the documentation and the project over time.

42:52.920 --> 42:55.660
Feel free to contribute to it.

42:55.660 --> 43:05.040
We have also the firmware files that are available on GitHub in some sub repositories.

43:05.040 --> 43:11.580
And globally, all the code is available on GitHub under MIT license.

43:11.580 --> 43:20.700
So of course, we also are making a call for contributors.

43:20.700 --> 43:33.260
So feel free to create compatible firmwares for your preferred hardware to report any bugs, any issues you would encounter on GitHub.

43:33.260 --> 43:45.120
And if you want to help us by writing some documentation, by adding support for other protocols or other devices, we would be happy to have contributors.

43:45.880 --> 43:50.660
And if you like it, spread the word and tell your friends.

43:51.400 --> 43:53.860
So two last words.

43:53.860 --> 43:58.600
So this is a work we initiated two years ago.

43:58.680 --> 44:03.040
And here it was a very high-level presentation.

44:03.040 --> 44:08.060
So we only scratched the surface of what WAD is capable of.

44:08.060 --> 44:22.680
And we also want to warmly thank the many researchers that have beta access to this project and that helped us and provided some feedback on it.

44:22.680 --> 44:26.120
So I won't name them all, but they know.

44:26.520 --> 44:28.560
Thank you very much.

44:28.720 --> 44:32.680
And sorry for the small technical issues.

44:32.680 --> 44:34.500
We are ready if you have any questions.

