WEBVTT

00:01.680 --> 00:09.920
I would like to introduce our next two speakers because they are one of the very, very few that are actually doing Zigbee-style research and talking about it.

00:09.920 --> 00:19.340
So here's some really cool 802.15.4 stuff and I cannot begin to describe how awesome these guys are, so let's just get right on into it.

00:19.340 --> 00:21.060
This is Sergei and Ryan.

00:21.060 --> 00:21.980
Thank you.

00:21.980 --> 00:23.560
Hey guys.

00:31.180 --> 00:46.920
So what we want to talk about today is some hardware and some software to allow you to play with Zigbee and try to encourage you all that you want to screw with Zigbee and that you want to contribute to making the hardware and software more awesome so that you can continue to do this.

00:46.920 --> 00:51.520
So first of all, the requisite motivation slide, why do we even give a shit?

00:52.320 --> 00:55.140
Zigbee is used throughout a number of different things.

00:55.140 --> 00:58.760
Home automation, smart energy, security systems, healthcare, right?

00:58.800 --> 01:03.220
These are things we don't care about or maybe they're just called attack surfaces.

01:04.340 --> 01:15.700
And so what we're talking about today specifically is making sure that there's tools available for the practical exploration of these attack surfaces.

01:15.700 --> 01:24.700
So I recommend to you Wright's principle, security doesn't get better until tools for practical exploration of the attack surface are made available.

01:24.700 --> 01:28.320
This is something we believe in so much that we tried to get it on Wikipedia.

01:28.760 --> 01:36.420
Unfortunately we won that fight with one particular editor who didn't think it was noteworthy enough.

01:37.420 --> 01:41.880
He said we weren't allowed to cite all of our own papers as the fact that it exists.

01:42.500 --> 01:44.380
We cited a lot of papers.

01:44.380 --> 01:46.920
Joshua Wright said it, it's true.

01:51.320 --> 01:54.400
So specifically what we're going to talk about today, right?

01:54.400 --> 02:03.760
Zigbee is this whole stack and it goes into application specific things and has like huge 720 page specs and four of those.

02:03.760 --> 02:08.760
But what we're focusing on today is the physical and the Mac layer down here.

02:08.760 --> 02:18.700
And a lot of this stuff will be on the file layer because what we want to help people understand is just at the basis what's actually going on.

02:18.700 --> 02:25.560
So there's this like magic, you get a frame, you get an Ethernet packet, you get a Zigbee packet, it just magically appears.

02:25.560 --> 02:28.300
This diagram is a blatant lie.

02:28.660 --> 02:36.320
Sergey would call it a fairy tale told to small children to mislead them or something like that in a rant against higher education.

02:37.280 --> 02:46.800
But there was a talk given two days ago at B-Sides Las Vegas that talks about how all of this is a lie and breaks it down through the layers.

02:47.040 --> 02:52.300
But let's just say for the sake of this talk that a frame appears magically.

02:52.400 --> 02:56.860
And let's say that we could see the file layer, which you can't see in Wireshark, right?

02:56.860 --> 02:58.260
It doesn't show up there.

02:58.440 --> 03:01.400
What you see in Wireshark would be here on.

03:01.400 --> 03:04.040
That's the actual frame and the Mac layer.

03:04.040 --> 03:10.620
But for the frame to adjust to itself, you need for the radio reception to happen.

03:10.620 --> 03:13.400
There's a preamble, which synchronizes the clock.

03:13.400 --> 03:17.640
And then there's a starter frame delimiter, which says this is not just random noise you're hearing.

03:17.640 --> 03:19.140
This is a pack.

03:20.300 --> 03:35.640
And then, of course, the length of the packet is how many of those bytes will be taken for the body fed through a CRC and then compared with the frame check sum.

03:36.420 --> 03:38.600
Could you go back for a second?

03:38.600 --> 03:48.080
So the interesting thing about this is that we want to be able to manipulate not just the layer 2, but the layer 1.

03:48.100 --> 03:57.780
Say the preamble used for synchronization, mainly processed by the analog part of the chip for that reason.

03:57.780 --> 04:02.560
How much of this is actually enough to synchronize it?

04:02.560 --> 04:10.580
Are all of those 8 nibbles, symbols of ZigBee Phi, necessary?

04:10.580 --> 04:14.280
And the answer turns out to be it depends on the chip.

04:14.440 --> 04:16.620
Then the sync.

04:16.620 --> 04:31.220
It turns out that you can actually change the sync byte to something else, giving you the ability to transmit raw frames by using the packet-in-packet trick that neighbor Travis...

04:31.220 --> 04:32.740
Neighbor Travis...

04:32.740 --> 04:35.520
Who got distracted and went to find beer.

04:35.520 --> 04:37.920
Came up with...

04:37.920 --> 04:46.140
And our raw frame injection depends on that ability.

04:46.140 --> 05:05.260
So what we're going to show is that with these peripherals of ours, or any similar peripherals such as T-modes, you can actually construct raw frames with arbitrary preambles, arbitrary, well, syncs, and any length you like.

05:06.380 --> 05:10.500
Consider that the length is actually 7-bit.

05:10.820 --> 05:12.900
1-bit is reserved.

05:12.900 --> 05:14.900
It's not supposed to be set.

05:14.900 --> 05:16.940
What happens if you do set it?

05:17.600 --> 05:24.620
Again, you can distinguish between the chips based on that.

05:24.620 --> 05:37.840
So this is the neck layer, and it's pretty familiar to you if you have done 8211, except, of course, it expands, and then it expands some more.

05:37.840 --> 05:59.500
So in order to build frames where those relationships in yellow are violated only when you want them violated, say, for fuzzing, you can use our SCP modules, .15 D4, to build those frames.

05:59.760 --> 06:03.320
And so it's sort of like a complete package that you're getting.

06:03.320 --> 06:10.360
You're getting an injection and the construction kit for the frames together.

06:10.360 --> 06:18.660
Now, all of this was inspired by Joshua Wright's original Killer Bee framework, and we loved it so much that we sort of took over it.

06:19.040 --> 06:28.760
And Killer Bee 2 was largely rewritten by Ryan and Ricky.

06:28.760 --> 06:29.760
Where is Ricky?

06:29.760 --> 06:31.160
He's in Texas.

06:32.460 --> 06:33.860
What's up with that guy?

06:33.860 --> 06:38.640
I mean, he doesn't come out for DEF CON for like two consecutive years.

06:38.640 --> 06:40.520
Anyway, Ricky Milgaris.

06:41.460 --> 06:44.540
Now, we support a number of chips.

06:44.540 --> 06:46.200
We're going to talk about that.

06:46.200 --> 06:56.380
And the SCP Python thing is thrown in for your convenience.

06:56.380 --> 07:13.340
Now, using that raw frame injection, we did what we called a five-finger printing, and what we have in more official uses called active fingerprinting.

07:13.340 --> 07:24.940
The idea is that you lob a frame, say a beacon request, at a chip, and if it hears it, if it interprets it correctly, then it will respond.

07:24.940 --> 07:33.320
If it doesn't hear this frame for some reason, say this frame appears malformed, then it doesn't.

07:33.320 --> 07:38.120
And so we prod and listen for the move.

07:39.340 --> 07:51.900
Now, fingerprinting was sort of a ruse on my part, because yeah, you know, smart meters and all of that, you want to find if they are really legitimate and all that.

07:51.900 --> 07:55.560
But raw frame injection was really why we wanted to do it.

07:55.560 --> 08:02.160
And the little machines in the chips that do the handling of a frame, that was the goal.

08:02.780 --> 08:10.360
So now Ryan is going to talk about the actual mode that we built.

08:10.500 --> 08:38.440
Now, one of the reasons why we built this mode is that we found no convenient way of injecting raw frames if you can't find some of those T-modes, or yes, that would be them, T-mode skies.

08:38.440 --> 08:42.440
We used them initially, and they used to be littered around universities.

08:42.440 --> 08:56.640
We literally went up picking them off of walls after a wireless experiment, a wireless sensor network experiment that did not, you know, that ran its course and then was abandoned.

08:56.980 --> 09:10.240
But, of course, those things are hard to buy, and so we built a good fit with a, based on Travis's good fit, with a USB connection to your laptop.

09:10.240 --> 09:18.500
With a radio chip, the CC2420, which has some nice properties, which Ryan is going to cover.

09:18.500 --> 09:22.480
Now, besides that, there are other chips that do Zigbee.

09:22.480 --> 09:30.260
Atmel, Frigduino has one, T-mode sky, there is Kisbee, of course, the Raven chip.

09:31.500 --> 09:38.160
We stayed away from SDRs, because Travis said so, and because they are expensive.

09:38.160 --> 09:39.900
They are way beyond my budget.

09:40.600 --> 09:48.580
I was actually planning to do this originally with SDRs, and went begging, and then the neighbor showed up and said, hey, you know what?

09:48.760 --> 09:50.440
There is no need for that.

09:50.440 --> 09:55.140
It will be cooler if it's done with commodity chips.

09:55.140 --> 09:56.860
And we did it with commodity chips.

09:58.300 --> 10:08.120
So, one of the main things we want to do, and we're going to be handing these out at the end, or at least as many of them as we have, is try to show why did we build this.

10:08.120 --> 10:11.820
So, Sergei went over some of the limitations of the old hardware.

10:11.840 --> 10:13.460
What did we put in this one?

10:14.400 --> 10:30.700
This is the basic requisite block diagram, but it really boils down to, you can connect to your laptop and control it in Python or C or whatever, and out the other end, you can have very low level control over radio frames.

10:30.700 --> 10:50.340
The reason we use the CC2420 chip, which is tough to get a hold of anymore, these are some of the last ones that were available, and we keep trying to snatch them up, is that it has registers exposed, which allow you to violate the protocol, to do the raw layer injection.

10:51.940 --> 10:53.740
And so it looks like this, right?

10:53.740 --> 10:54.720
This is the blow-up.

10:55.460 --> 11:08.800
USB, FTDI chip to convert it to serial, MSP430 to hold your firmware, and then this new radio with the CC2420 chip to actually inject it.

11:08.800 --> 11:11.840
Yeah, notice the two antennas, right?

11:11.840 --> 11:14.540
The external antenna and the internal antenna.

11:14.940 --> 11:19.260
You should run it with the right one, or else you might hurt the chip.

11:19.260 --> 11:23.860
So all the ones we hand out are configured for the external antenna.

11:24.060 --> 11:31.660
We can show you how to change that, probably in the hardware hacking village next door, but if you would like to.

11:31.800 --> 11:33.480
So what do we support out of the box?

11:33.480 --> 11:39.380
These are already flashed with firmware, so please don't reflash until you know what you're trying to do.

11:40.140 --> 11:41.500
But you can sniff.

11:41.500 --> 12:00.080
The nice thing we have in this one out of the box is injection, as well as some jamming that you should only use in a controlled and legal lab environment, along with reflexive jamming, and then obviously the low-level control over the registers, and the ability to reprogram them if you want.

12:00.780 --> 12:09.860
But really what I'm here... really my motivation for being here is to try to convince you guys to take this hardware that we're going to give out and make it better.

12:11.260 --> 12:15.120
These are just a few of my ideas, and I'm sure you have better ones, right?

12:15.480 --> 12:19.060
We've wired it to support a battery pack.

12:19.060 --> 12:26.800
We've put flash on it, so you could sort of put a battery pack and flash and throw it over the fence and let it log some stuff for you.

12:26.880 --> 12:29.820
You could put more business logic in the firmware.

12:30.540 --> 12:33.720
And yeah, yeah, there's expansion headers so that you can actually do that.

12:39.290 --> 12:41.810
So now we're going to go into sort of two sections.

12:41.810 --> 12:44.250
One of which is like how to use it for defense.

12:44.250 --> 12:49.350
Here's some ideas how you can do some defensive wireless intrusion detection systems with it.

12:49.350 --> 12:53.270
And then the next one will be how do you totally break the idea of doing WIDS with it.

12:53.430 --> 12:57.430
We like to bundle it in the same talk, so you can't tell me that I told you so.

12:59.310 --> 13:02.370
What we did is we released an open source WIDS framework.

13:02.370 --> 13:04.390
It looks something like this.

13:05.590 --> 13:12.410
Basically you deploy drone devices out around your network where you want to detect attacks.

13:12.650 --> 13:15.410
And it has a backhaul and analytic portion.

13:15.410 --> 13:20.390
I'm going to really glaze over this, so please come talk to us more if you want.

13:20.390 --> 13:28.310
Or see our full presentation from Troopers 2014 this year that gives you a lot of detail about this.

13:28.310 --> 13:34.050
Long story short, together with making packets you can, of course, disassemble packets.

13:34.050 --> 13:38.470
And have rules fire when you disassemble a particular kind of packet.

13:38.470 --> 13:40.490
So you can roll your own WIDS.

13:41.590 --> 13:43.790
Wireless Intrusion Detection System.

13:43.850 --> 13:44.830
Sorry.

13:45.610 --> 13:46.590
It just keeps...

13:46.590 --> 13:47.810
Oh, WIDS WIPS.

13:47.810 --> 13:49.870
Intrusion Detection, Intrusion Prevention.

13:50.650 --> 13:55.750
You know, WIDS have been dead and not quite dead.

13:55.750 --> 13:57.110
Maybe like zombie.

13:57.930 --> 14:01.470
For, what, 10 years?

14:02.630 --> 14:07.790
So, hey, here is another dead baby, if you will.

14:08.430 --> 14:12.590
And, of course, we are going to kill it right now.

14:13.010 --> 14:17.970
But first, before we kill it, let's show that you could try to do something useful with a WIDS.

14:17.970 --> 14:23.810
So one very basic attack on 802.15.4 is doing network discovery.

14:23.810 --> 14:28.670
So if you do an 802.15.4 on a pen test, you have one of these devices hooked up.

14:28.670 --> 14:30.850
You want to find your target network.

14:30.970 --> 14:32.470
This is what you are going to do.

14:32.470 --> 14:35.430
You are going to go active, if you are allowed to.

14:35.550 --> 14:40.930
And you are going to basically do an equivalent of a TCP SIM scan, sending out beacon requests.

14:41.390 --> 14:47.890
So this is all well and good because, of course, even the documentation itself makes it clear that there is no security supported on these.

14:47.890 --> 14:49.530
Because why would you do that?

14:49.530 --> 15:11.710
And so this is just to show you that with a minimal amount of code inside the framework that is supposed to be highlighted but is not, you can request to get certain packets and then run some very basic statistics over those packets to show there is an increased number of beacon request frames.

15:11.710 --> 15:28.210
And really what this boils down to is if somebody runs out of our Killer Bee Toolkit, the tool ZB Stumbler, which is like, again, if you are on a pen test, one of the first things you might want to do, the WIDS is going to start popping these alerts.

15:28.430 --> 15:31.390
You know, that it saw beacon detection.

15:32.390 --> 15:35.230
The same thing goes for disassociation frames, right?

15:35.230 --> 15:38.010
We all saw this with Wi-Fi years and years ago.

15:38.010 --> 15:40.510
So let's have another protocol that has the same issue.

15:41.730 --> 15:49.750
Which is that you can either figure out, you can do some recon and do this smartly, or you can start spamming them all over the place.

15:50.350 --> 15:52.610
Let's say you want to spam them all over the place.

15:52.610 --> 15:55.570
We made a tool because why make you do the work?

15:56.130 --> 15:57.330
So you configure it.

15:57.330 --> 16:01.170
You actually do need some recon to do this from ZB Stumbler.

16:02.570 --> 16:05.990
But of course a WIDS would say that you could detect this.

16:05.990 --> 16:08.010
You start seeing a ton of these frames.

16:23.170 --> 16:28.810
So we have posted up on our website, obviously the talk was at 2-14.

16:28.810 --> 16:30.370
It goes a lot over this.

16:30.490 --> 16:32.270
The code is up on GitHub.

16:32.570 --> 16:36.150
And you can either build it into it or break it if you want.

16:36.330 --> 16:38.090
But let's talk about breaking it.

16:38.090 --> 16:43.010
Yeah, because now that we brought this little thing into the world, we're going to kill it.

16:43.790 --> 16:44.670
Badly.

16:45.690 --> 16:49.590
So here's your FIFRAME, right?

16:49.590 --> 16:53.430
This is the part that Wireshark would not show.

16:54.510 --> 16:58.890
This is the preamble, this is the SMD, and this is the frame.

16:59.070 --> 17:02.770
From that point on, you have your link layer frame.

17:03.390 --> 17:12.990
But these are the ones, these fields, are the ones that control the actual machinery inside the file.

17:12.990 --> 17:16.830
Now, when you say the file layer, that's already a lie.

17:16.830 --> 17:21.530
Because the file layer consists of several sub-layers, if you will.

17:21.530 --> 17:24.050
They're never really called that.

17:24.490 --> 17:30.050
But, you know, there is machinery that does synchronization.

17:30.050 --> 17:37.010
There is a shift register that looks for the specific SFD, A7, in the standard.

17:37.010 --> 17:42.910
And there is the machinery that then does the control summing.

17:42.910 --> 17:46.930
But, you know, you can ask yourself, what happens if you play with it?

17:46.930 --> 17:53.570
Say, what if you make the frame length longer than your actual frame?

17:53.650 --> 17:54.990
What will happen?

17:55.110 --> 18:02.730
Well, the file layer is just the chip, it's just a machine for pulling symbols out of the air.

18:03.110 --> 18:12.190
And so it will pull whatever symbols follow in the noise, and that will become a part of the frame.

18:12.190 --> 18:34.430
And if you're lucky, and the garbage symbols that make up the frame control sum actually does match, and this happens, you will get basically to hear at the end of your frame what the noise sounds like.

18:34.430 --> 18:35.870
And that's interesting, right?

18:35.870 --> 18:43.050
Because people believe in boundaries around the frame, but there are no boundaries.

18:43.050 --> 18:47.290
People believe in boundaries between symbols, but there are no boundaries.

18:47.290 --> 18:59.790
Travis showed that with his 8th oven nibble shift, that allows you to receive a frame that was never sent as such.

18:59.790 --> 19:05.910
No symbol in the received frame in his trick is shared with the sent frame.

19:05.910 --> 19:07.230
How cool is that?

19:07.230 --> 19:26.710
So, go over to the vendor area, find the samizdat booth, print yourself the previous issue of the International Journal of POC or GTFO, and that knowledge will be yours, together with a paper cutout game.

19:26.710 --> 19:34.030
But we're going to exploit this exactly along the same lines.

19:34.190 --> 19:38.330
The fact that the chip is just a machine for pulling bytes out of the air.

19:41.270 --> 19:47.150
And the trick that we're going to use is the packet-in-packet trick.

19:47.410 --> 19:59.850
So, one important thing, the most important thing about ZigBee as a protocol, is that the preamble, the sync and the length, are encoded exactly the same way as the rest of the frame.

20:00.150 --> 20:03.880
So, signaling is done the same way as data.

20:04.810 --> 20:10.390
So, one thing about the air is that there is always noise in it.

20:10.550 --> 20:25.710
And so if something steps on this sync, and radio noise tends to step on a single symbol, or on a single byte, no more, so if this A7 turns into a pumpkin due to noise,

20:29.150 --> 20:33.530
then all of this preamble will have been for noise.

20:33.750 --> 20:39.890
And your card will not, your chip, will not go into, oh, I am in a frame mode.

20:39.890 --> 20:47.610
And so it will continue to see these symbols in the air as noise, outside of a frame.

20:47.610 --> 20:59.490
And then, when your payload contains a valid preamble, and a valid sync, these things are perceived as the beginning of a new frame.

20:59.490 --> 21:05.890
So this is the packet-in-packet trick which got Travis his pony two years ago.

21:05.890 --> 21:24.650
So, the body of the injected frame will be basically at the higher layer, and so you can inject into PHY if you control the app layer.

21:24.650 --> 21:26.330
Now, how nifty is that?

21:26.630 --> 21:33.610
But, in our case, we don't really need to wait for the noise to come and do its magic.

21:33.610 --> 21:43.780
We can simply reset the configuration register, where the SFD is stored, to something else, and so there will be no SFD.

21:44.150 --> 21:58.830
And so we can transmit with arbitrary preambles, arbitrary garbage between the preamble and the sync, whatever length we want, and that's your raw frame injected.

22:01.050 --> 22:08.350
So, packet-in-packet basically serves as a vehicle for this injection with this chip.

22:08.910 --> 22:13.290
So, packet-in-packet is providing us sort of a layer-one injection.

22:13.290 --> 22:17.550
You can do this with a USRP or a software-defined radio as well.

22:18.610 --> 22:29.150
The differences in the state machines of the radio chips themselves exist, and together what that does is allow us to do a PHY layer fingerprint of the chips.

22:29.490 --> 22:34.370
A PHY layer fingerprint or something that would be a WIDS evasion.

22:34.510 --> 22:53.570
Because what you can do in this case, just to totally kill that WIDS that we just talked about, was if you're receiving your actual devices deployed in your network are not the exact same chips, or one that we cannot fingerprint differently than the ones being used in your WIDS deployment,

22:53.570 --> 23:09.610
so if you have two different vendor chips, even if they're both 802.15.4 and ZigBee compliant, there's differences between them so that you can transmit a frame which is seen by one as a perfectly valid frame with a high success rate, whereas another one will not see it.

23:09.790 --> 23:13.890
And what we're going to show you next is how to do that and how to find those differences.

23:15.450 --> 23:17.890
So, this is a really basic setup, right?

23:17.890 --> 23:25.470
You have your target device, and your target device for this needs to just, like, listen for something and respond with something else.

23:25.530 --> 23:28.170
So, the protocol supports this, right?

23:28.170 --> 23:41.050
Either beacon requests and beacon responses, or sending a data packet and getting an acknowledgement frame, any way that you can, or you could, you know, if you control this one fully in the firmware, you can just sniff out of it.

23:41.230 --> 23:50.310
And what you want to do is see if that radio chip, when you stimulate it with, say, a beacon request, if a beacon response comes back to your other chip.

23:50.550 --> 23:57.570
So, we've done this sort of thing with H.211 in a talk from a few schmuckons ago.

23:57.570 --> 24:19.110
If you remember, we simply used the frame control bits, the flag bits, one full byte of those, set them to all sorts of nonsensical combinations, say, a management frame claiming to come from the distribution system, or similar ridiculous things, or, you know,

24:19.110 --> 24:24.670
an app with a whole bunch of flags, like a Christmas tree packet that nmap sends.

24:24.670 --> 24:31.970
And we actively fingerprinted various chips, and lo and behold, they responded differently.

24:32.650 --> 24:38.490
So, the same is true on the lower layer, on the PHY layer.

24:38.490 --> 24:40.990
The chip has its own state machine.

24:40.990 --> 24:45.270
Here is the state machine of the C2420 chip.

24:45.710 --> 24:49.810
And, of course, all of those things would be different.

24:50.270 --> 24:54.730
And for some, a shorter preamble will be a killer.

24:54.770 --> 25:05.690
For others, garbage between the preamble and the SFD would be what would make them not hear the packet, while others would hear them perfectly.

25:05.690 --> 25:14.950
So, we came up with a bunch of methods to malform that PHY part of the frame.

25:15.330 --> 25:18.330
And, where is Travis?

25:21.940 --> 25:29.420
He's probably drinking beer while we're, you know, while we're introducing people to his native culture.

25:29.420 --> 25:36.400
This is Cumberland Gap, which is, of course, quite important in the Tennessee history.

25:37.300 --> 25:43.620
And Travis would have told you about this if he had the good fortune to.

25:43.620 --> 25:50.020
And now, of course, I have to sing the song, you know, drink a little whiskey, take a little nap.

25:50.020 --> 25:52.260
We're 15 miles from the Cumberland Gap.

25:56.760 --> 25:59.220
My vocals are horrible.

26:01.000 --> 26:05.740
So, that was actually the first method that we used, which didn't work out.

26:05.740 --> 26:08.560
So, we transplanted it on New Hampshire soil.

26:08.560 --> 26:10.320
And this is the Franconian Notch.

26:10.320 --> 26:18.280
This is how you would drive up to Dartmouth from Massachusetts, although I can't imagine why you want to go there.

26:20.860 --> 26:24.000
So, New Hampshire is a free state, right?

26:24.180 --> 26:26.000
Massachusetts, not so much.

26:29.020 --> 26:32.460
So, what we're going to do now is show you the three techniques that worked.

26:32.460 --> 26:36.380
We left off Cumberland Gap because Tennessee just didn't live up to Travis's...

26:36.380 --> 26:38.960
I'm trying to taunt him, but...

26:38.960 --> 26:52.280
So, in Franconian Notch, the technique here is that we take those eight nibbles of zeros that should be there, put this back as part of the preamble, and let's start changing some of them to Fs.

26:52.280 --> 27:02.380
So, when you start doing that, using the packet and packet to have control over this layer that you usually don't control, what do you see differently between chips?

27:02.740 --> 27:04.960
And what you see differently between chips...

27:04.960 --> 27:16.000
Say, this is an Atmel chip on an RZ USB stick, this is a CC2420 on either the Appemote or the Temote Sky, and you start seeing the numbers are very different.

27:17.360 --> 27:18.940
If you were to send...

27:18.940 --> 27:22.680
You know, the Appemote wants all zeros to be able to synchronize, right?

27:22.680 --> 27:29.740
If it doesn't have those eight nibbles, it's not doing well receiving the frames, except test results.

27:30.060 --> 27:38.120
But on the other hand, the RZ USB stick is a lot more resilient to this attack, or to this technique.

27:38.240 --> 27:56.220
And so, if you send something in this range, in these two, let's say, you're getting a 99% success rate getting that received on an RZ USB stick, whereas you're getting below 1% chance of it being received by a CC2420.

27:56.220 --> 27:59.400
And that's where you can see a device fingerprint difference.

27:59.400 --> 28:07.340
And now imagine that this chip is your intrusion detection chip.

28:07.920 --> 28:14.460
And this chip is the target, and the frame carries something interesting, such as an export.

28:15.720 --> 28:20.400
You really, really want to have it the other way around, right?

28:21.220 --> 28:29.160
So, we don't know what specifically in that state machine causes those responses.

28:29.620 --> 28:49.340
But we've gone through all possible preamble replacements, and noticed that some of those frames arrived with a completely botched preamble, if you believe the standard.

28:49.340 --> 29:05.760
And so, because I wouldn't believe this, in fact, I didn't believe this until we had 5,000 test runs done, in different cities, and I still couldn't figure out why, these are the PCAPs of, say, an example test run.

29:05.780 --> 29:12.960
And what I've done is overlaid, used on correlating with the sequence numbers, what the preamble of this packet was injected with.

29:12.960 --> 29:17.700
And these were captured at the exact same time, so the yellow lines are connecting two of them.

29:17.700 --> 29:31.500
So , what you see is the CC2420 chip is receiving, but it's all zero, which the RZUSB stick is usually doing as well, but it's also receiving a lot with other preambles set.

29:32.980 --> 29:43.900
Now, because Sergei said, obviously, the way around this is to simply switch which chips you use for your intrusion detection and not, we want to get rid of that notion as well.

29:43.900 --> 29:48.660
So, let's do another technique where you change the length of the preamble.

29:48.660 --> 29:58.740
So, instead of replacing it with garbage, what if you either have, you know, a two nibble preamble, or a four, or a six, or the full eight nibble preamble.

29:59.000 --> 30:06.880
Basically, how long does it take the analog portion of the radio chip to synchronize the clock?

30:07.280 --> 30:10.560
Or at least that's what we hypothesize is this difference.

30:10.560 --> 30:27.260
And here's the test results, which show that a CC2420 chip takes less time to synchronize than an Atmel chip, which we should have the eight nibble bar on here, oh no, it's at the top.

30:27.460 --> 30:34.600
There's something strange that happened in this test run with the Atmel, because this blue bar should be higher here.

30:34.600 --> 30:41.480
But you still see some difference, and you see the Zigduino, which is another chip, behaves differently as well.

30:42.820 --> 30:54.380
The Franconian bridge, because we just keep making up names for this stuff, or he does, says you keep the full eight nibble preamble, and then you put some junk in between.

30:54.380 --> 31:14.640
So you put different numbers, in this case Fs, between it and the SFD, which goes into what we hypothesize is how long is that shift register continually looking for the right SFD before it gives up and resets.

31:14.640 --> 31:18.220
So this is really bizarre, right?

31:18.220 --> 31:31.720
Because you see those nice images of those frames in your protocol and in the textbooks and everywhere, and you sort of assume that this is how those chips work.

31:31.720 --> 31:34.660
I mean, everything is a parser, right?

31:34.660 --> 31:54.180
So that silicon that matches the frame out of the surrounding noise, that magic that makes it start, you know, at this particular noise symbol and end at this particular noise symbol, and somehow what's in the middle is not noise but the payload, this is,

31:54.180 --> 31:57.660
I mean, this is a complete pack of lies, right?

31:57.660 --> 32:04.880
There are no boundaries except those that those machines like the shift register make.

32:04.880 --> 32:09.840
And those parsers are quite not what you expect, right?

32:09.840 --> 32:20.120
For example, you can run a whole bunch of Fs in there as the bridge between the full preamble and the SFD, and they don't care.

32:20.680 --> 32:22.240
Isn't that interesting?

32:22.240 --> 32:34.320
So, of course, we approach everything as parsers, and we approach everything as what we call recognizers, for the languages that are the respective data structures.

32:34.320 --> 32:45.280
And, of course, the first thing you want to do is to exercise the corner cases of those parsers, and just give them something to chew on until they croak.

32:45.280 --> 32:53.840
And normally people do this in the process of fuzzing, but we're really interested in those simple machines themselves for their own sake.

32:54.040 --> 33:00.980
And then it turns out that, yeah, all of those things are implemented differently on different chips, right?

33:00.980 --> 33:11.360
So here you inject that little bridge, and your RZ USB stick just doesn't care, right?

33:11.360 --> 33:16.120
Whereas your Zigduino, well, kind of cares, right?

33:16.120 --> 33:20.740
And the Teemo cares a lot, right?

33:20.740 --> 33:25.080
This is the only red that you're seeing here.

33:25.420 --> 33:32.800
Again, you could call this a width evasion, if you know what your width chip is.

33:32.800 --> 33:35.580
You could call it a shaped charge.

33:35.580 --> 33:49.020
You speak the right dialect to deliver your payload, to deliver your scan, and you could be talking to your fancy building energy management system without touching any other ZigBees around.

33:49.020 --> 33:58.480
Or you could be talking to this medical thingy without touching your thermostat.

33:59.420 --> 34:04.160
It's kind of like the battle language, right?

34:04.160 --> 34:19.100
The Dune, all of those super cool warrior casts and all of that, they speak this special language in battle that is unintelligible to the opposing faction.

34:19.100 --> 34:21.800
You could actually do it with ZigBee chips.

34:22.740 --> 34:30.220
With nothing but the PHY preamble SFD and some garbage in between.

34:31.580 --> 34:34.600
This was deeply satisfying.

34:34.900 --> 34:38.900
I hope it was as good for you as it was for us.

34:41.680 --> 34:48.060
So what we've showed you today is the App Emote hardware so that you can play with this and expand on it.

34:48.900 --> 34:56.280
A WID system which is very limited in its functionality and more limited when you try to evade it.

34:56.640 --> 34:58.600
You could work on improving that.

34:58.600 --> 35:10.600
In fact, using some of the packet-in-packet for sniffing, or what we would call packet-out-of-packet, you could start using commodity chips to get sort of a spectrum sniffing capability.

35:11.260 --> 35:14.680
And then Isotope, which is the name for the fingerprinting project.

35:14.680 --> 35:25.320
We've done such limited tests, the three we showed you today, and the one that didn't work, on doing fingerprinting that there's so much more that could be done there.

35:25.360 --> 35:33.420
Adding Fs in probably has a lot of unintended consequences because of how chipping is done, compared to using other symbols.

35:33.820 --> 35:38.200
So there's a whole variety of basically PHY layer fuzzing that could be done there.

35:38.260 --> 35:41.760
The code for all of this is posted online.

35:41.760 --> 35:44.460
If you have any questions, please reach out to us.

35:44.460 --> 35:49.460
We'll take questions, which will be rewarded with chips.

35:49.460 --> 35:51.240
That's how I get questions.

36:03.370 --> 36:13.710
Mainly by not having the metadata in the same encoding, in the same modulation, as the data.

36:13.750 --> 36:19.570
The ZigBee Consortium apparently took this decision to simplify things.

36:19.570 --> 36:24.930
Wi-Fi switches through modulations in the middle of the frame.

36:24.930 --> 36:28.410
And this is ugly and nasty.

36:28.410 --> 36:36.770
And so they decided to keep it nice, except, you know, how do you know where the frame actually begins?

36:36.950 --> 36:37.770
Right?

36:37.770 --> 36:41.950
Yes, encryption will help.

36:43.390 --> 36:54.990
In particular, the packet-in-packet trick with other people's hardware is broken by making the bits of the payload unpredictable to the attacker.

36:55.410 --> 36:58.530
So encryption would break that.

36:58.530 --> 37:04.050
Of course, you know, since we control the chip here, it would not hurt us.

37:04.050 --> 37:08.070
But then, of course, we would find it difficult to inject into an encrypted network.

37:08.070 --> 37:15.290
On the other hand, the file layer is not encrypted.

37:15.630 --> 37:22.310
So it's these particular symbols, and that's just it.

37:22.830 --> 37:32.470
Yeah, when people are doing networking for ZigBee and they do proper encryption on the actual application level phase, it makes it a lot more of a pain.

37:32.470 --> 37:37.090
But the radio chips have only two crypto key registers in them.

37:37.090 --> 37:44.030
Actually, if somebody knows of a ZigBee chip that has more than two key registers, please let me know.

37:44.270 --> 37:49.950
Because what that does is it forces you to really do network keying instead of per-device keying.

38:06.850 --> 38:08.310
Well, yes.

38:09.410 --> 38:18.370
Basically, again, you want to have symbols in your set that do not occur in the payload.

38:19.350 --> 38:29.190
Otherwise, you're solving a parsing problem that in the presence of noise becomes hard, and there is always noise.

38:34.970 --> 38:36.610
Symbols in what set?

38:37.210 --> 38:44.970
Symbols as in what you send encoded over the air with your error-correcting code.

38:45.070 --> 38:57.770
The symbol in ZigBee is a nibble, but in fact it's 32 chips, ones and zeros, physical ones and zeros.

38:57.770 --> 39:06.090
And the modulation is QPSK, I believe.

39:09.220 --> 39:10.580
That's correct.

39:10.580 --> 39:11.980
It's 32 bits.

39:14.300 --> 39:24.020
How to build a phi layer that doesn't fall to those ruses.

39:25.060 --> 39:33.380
It's good to have a symbol in your set that just doesn't appear in the data, so that you know where your metadata is.

39:33.380 --> 39:39.660
And Mike Ossman has an interesting talk that was built out of packet-in-packet called Unambiguous Encapsulation.

39:39.660 --> 39:43.660
And how do you do that across a wide range of protocols, including some radio ones?

39:43.660 --> 39:51.660
You can find that in his ShmooCon talk.

39:52.200 --> 39:56.900
His technical report on this is online.

39:57.120 --> 40:08.640
He uses error-correcting codes that cluster their symbols for data and metadata as far from each other as possible.

40:09.080 --> 40:12.160
And he enumerated a bunch of those codes.

40:12.160 --> 40:34.920
If you look at our Language Theoretic Security Workshop, LANGSEC Workshop, this year at IEEE, and look at Travis's paper that describes his one-eighth of a nibble chipping misalignment trick, that paper quotes the TR and gives a brief overview of the issues of how to build a better phi.

40:34.920 --> 40:39.580
And generally, I recommend to you the Language Theoretic LANGSEC approach.

40:39.580 --> 40:46.160
Just go to langsec.org, and there will be a bunch of papers there.

40:55.870 --> 41:00.810
So everything that we talk about in this presentation doesn't even touch on the ZigBee layers.

41:00.810 --> 41:04.370
It's all in the IEEE 802.15.4 spec.

41:04.370 --> 41:10.510
Which, I should have been clear, that's to find the phi in the math layers that ZigBee is based on top of.

41:27.510 --> 41:37.930
So, I think that really depends on how you use those different methods.

41:38.430 --> 41:42.710
There are different ones that are more effective, but it's not.

41:42.710 --> 41:45.750
I promise you that we have plenty... well, I'm not going to say plenty.

41:45.750 --> 41:50.530
We have a lot of these, but I'm going to continue doing questions for...

41:50.530 --> 41:53.290
How long do we have?

41:53.890 --> 42:01.670
I'm going to continue doing 10 more minutes of questions, and then my voice will not work, and then I will be drinking a beer, and then we can do more questions.

42:02.910 --> 42:04.590
You've had your hand up for a while.

42:04.590 --> 42:06.650
I wonder what the SFD value is that

42:09.840 --> 42:10.540
you built.

42:10.960 --> 42:17.440
So, the firmware allows you to configure the SFD value from Python at runtime.

42:18.000 --> 42:20.360
You do have to be careful about it.

42:20.360 --> 42:25.060
I'd have to look in our paper for which one we set it to in these tests.

42:25.440 --> 42:32.000
With, actually going back to the eighth of a nibble, misalignment because of how the error correcting codes work.

42:32.020 --> 42:40.020
Like, B0 can change into A7, depending on a slight clock drift, which happens in cheap hardware.

42:41.980 --> 42:48.720
I think we set it... you can't set it to FF because the chip decides that that actually means A7.

42:51.280 --> 43:00.320
And so, I think we set it to F0, which is actually 0F by the time it goes on the wire.

43:15.660 --> 43:19.060
Yeah, that was Cumberland Gap.

43:19.060 --> 43:21.460
Well, Cumberland Gap was meant to be that.

43:27.650 --> 43:31.490
Yeah, we didn't present Cumberland Gap.

43:31.490 --> 43:35.610
We can show you the results, or they're in our paper, but it didn't work so well.

43:36.910 --> 43:40.550
Well, I mean, we actually know how we messed up.

43:42.050 --> 43:43.550
Start the frame delimiter.

43:47.530 --> 43:53.310
Okay, I'm sorry, I'm having trouble keeping track of which order people raised their hands.

43:53.310 --> 43:55.270
I've seen your hand up for a while.

44:12.000 --> 44:16.000
Well, now you have something you can go test that with, legally.

44:31.620 --> 44:38.940
So, let me channel Dan Geer for a moment here.

44:38.940 --> 44:40.800
Risk is dependence.

44:40.800 --> 44:50.100
Introducing those new dependencies of technologies that we don't really know much about yet is not a smart thing, right?

44:50.100 --> 45:01.480
This whole smart grid is amazing, as in, whoa, not enough attack surface in our infrastructure.

45:01.480 --> 45:03.140
Let's add some more.

45:03.700 --> 45:05.420
Right?

45:05.420 --> 45:14.660
It's, you know, it defies understanding.

45:14.740 --> 45:18.140
But, yeah, shiny, right?

45:22.100 --> 45:25.520
Speak up, please.

45:36.730 --> 45:38.310
Yeah, yeah.

45:38.310 --> 45:42.450
So, it's really about the resistance on the antenna.

45:42.530 --> 45:47.290
They say it's got to be... I heard it has to be 50 ohms, right?

45:47.290 --> 45:54.510
So, if you try to run it without the external antenna while switched to that socket, it will be bad.

45:54.510 --> 45:56.930
The internal antenna has the proper...

45:56.930 --> 46:05.230
I assume the radio front end, which Ryan has been debugging for, you know, months, has been...

46:05.230 --> 46:07.990
Well, somebody else has been debugging for me for months.

46:08.110 --> 46:10.210
Yeah, the internal antenna works.

46:10.210 --> 46:13.990
You have to move a capacitor.

46:13.990 --> 46:15.230
There's a capacitor at the end.

46:15.230 --> 46:17.730
I'll be happy to show you guys or help you move it.

46:20.730 --> 46:23.510
It's a 603 landing, so it's sort of small.

46:23.790 --> 46:26.170
So, drink a beer before you try to solder it.

46:26.170 --> 46:27.510
Yes, sir.

46:41.580 --> 46:44.980
If somebody wants to buy Sergey the rest of them...

46:45.660 --> 46:53.260
No, there's at least 10 major chips that are doing 802.15.4 from different vendors on the market.

46:54.500 --> 47:00.700
And these are just ones that we had available in the lab to do this research on.

47:01.600 --> 47:11.980
So, we would love to have you basically around our framework and fingerprint what you have, right?

47:11.980 --> 47:13.980
We call this isotope.

47:13.980 --> 47:18.460
It's, you know, it's a joke on fingerprinting being useless.

47:18.460 --> 47:25.400
I had this discussion with Travis over beer, over multiple beers, over multiple, multiple beers.

47:25.400 --> 47:28.680
And I finally convinced him that it was not.

47:28.680 --> 47:31.100
And isotope, the name came from that.

47:31.100 --> 47:37.400
Because, you know, so some kernels have more neutrons than others, right?

47:37.400 --> 47:38.460
Who cares?

47:38.580 --> 47:40.880
Besides the chemistry geeks, right?

47:40.880 --> 47:46.680
Turns out that there is this thing called uranium-238 and 235.

47:47.080 --> 47:49.600
And this thing called the chain reaction.

47:49.600 --> 47:51.080
So, boom.

47:55.280 --> 47:56.960
Fingerprinting matters.

47:56.960 --> 48:02.180
Although, the kind of fingerprinting matters is fingerprinting receivers.

48:02.740 --> 48:04.460
Sanders, nah.

48:04.460 --> 48:05.720
I mean, forensics.

48:05.720 --> 48:08.120
Forensics is fun, but hey.

48:08.300 --> 48:13.160
But fingerprinting receivers gives you attack paths and those shape charges.

48:23.890 --> 48:25.290
Uh...

48:36.510 --> 48:37.910
Um...

49:02.610 --> 49:10.270
So, okay.

49:39.650 --> 49:42.330
Yeah, yeah, yeah.

49:42.330 --> 49:43.210
Yeah, yeah, yeah.

49:43.210 --> 49:44.630
I think what...

49:57.010 --> 49:58.990
Sergei, one behind you.

50:03.460 --> 50:05.120
Anyway, so...

50:05.740 --> 50:08.040
I think we're imposing another people's time.

50:08.040 --> 50:11.140
So, come up and, you know, buy us a beer.

50:17.420 --> 50:20.900
I mean, as usual, students do all the work, right?

