start	end	text
1680	9920	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.
9920	19340	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.
19340	21980	This is Sergei and Ryan. Thank you.
21980	23560	Hey guys.
31180	36740	So what we want to talk about today is some hardware and some software to allow you to play with Zigbee
36740	46920	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.
46920	51520	So first of all, the requisite motivation slide, why do we even give a shit?
52320	58760	Zigbee is used throughout a number of different things. Home automation, smart energy, security systems, healthcare, right?
58800	63220	These are things we don't care about or maybe they're just called attack surfaces.
64340	75700	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.
75700	84700	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.
84700	88320	This is something we believe in so much that we tried to get it on Wikipedia.
88760	96420	Unfortunately we won that fight with one particular editor who didn't think it was noteworthy enough.
97420	101880	He said we weren't allowed to cite all of our own papers as the fact that it exists.
102500	104380	We cited a lot of papers.
104380	106920	Joshua Wright said it, it's true.
111320	114400	So specifically what we're going to talk about today, right?
114400	123760	Zigbee is this whole stack and it goes into application specific things and has like huge 720 page specs and four of those.
123760	128760	But what we're focusing on today is the physical and the Mac layer down here.
128760	138700	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.
138700	145560	So there's this like magic, you get a frame, you get an Ethernet packet, you get a Zigbee packet, it just magically appears.
145560	148300	This diagram is a blatant lie.
148660	156320	Sergey would call it a fairy tale told to small children to mislead them or something like that in a rant against higher education.
157280	166800	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.
167040	172300	But let's just say for the sake of this talk that a frame appears magically.
172400	178260	And let's say that we could see the file layer, which you can't see in Wireshark, right? It doesn't show up there.
178440	184040	What you see in Wireshark would be here on. That's the actual frame and the Mac layer.
184040	190620	But for the frame to adjust to itself, you need for the radio reception to happen.
190620	193400	There's a preamble, which synchronizes the clock.
193400	197640	And then there's a starter frame delimiter, which says this is not just random noise you're hearing.
197640	199140	This is a pack.
200300	210180	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
210180	215640	and then compared with the frame check sum.
216420	218600	Could you go back for a second?
218600	228080	So the interesting thing about this is that we want to be able to manipulate not just the layer 2, but the layer 1.
228100	237780	Say the preamble used for synchronization, mainly processed by the analog part of the chip for that reason.
237780	242560	How much of this is actually enough to synchronize it?
242560	250580	Are all of those 8 nibbles, symbols of ZigBee Phi, necessary?
250580	254280	And the answer turns out to be it depends on the chip.
254440	256620	Then the sync.
256620	262220	It turns out that you can actually change the sync byte to something else,
262220	271220	giving you the ability to transmit raw frames by using the packet-in-packet trick that neighbor Travis...
271220	272740	Neighbor Travis...
272740	275520	Who got distracted and went to find beer.
275520	277920	Came up with...
277920	286140	And our raw frame injection depends on that ability.
286140	295380	So what we're going to show is that with these peripherals of ours, or any similar peripherals such as T-modes,
295380	305260	you can actually construct raw frames with arbitrary preambles, arbitrary, well, syncs, and any length you like.
306380	310500	Consider that the length is actually 7-bit.
310820	312900	1-bit is reserved.
312900	314900	It's not supposed to be set.
314900	316940	What happens if you do set it?
317600	324620	Again, you can distinguish between the chips based on that.
324620	332580	So this is the neck layer, and it's pretty familiar to you if you have done 8211,
332580	337840	except, of course, it expands, and then it expands some more.
337840	348720	So in order to build frames where those relationships in yellow are violated only when you want them violated,
348720	359500	say, for fuzzing, you can use our SCP modules, .15 D4, to build those frames.
359760	363320	And so it's sort of like a complete package that you're getting.
363320	370360	You're getting an injection and the construction kit for the frames together.
370360	375260	Now, all of this was inspired by Joshua Wright's original Killer Bee framework,
375260	378660	and we loved it so much that we sort of took over it.
379040	388760	And Killer Bee 2 was largely rewritten by Ryan and Ricky.
388760	389760	Where is Ricky?
389760	391160	He's in Texas.
392460	398640	What's up with that guy? I mean, he doesn't come out for DEF CON for like two consecutive years.
398640	400520	Anyway, Ricky Milgaris.
401460	406200	Now, we support a number of chips. We're going to talk about that.
406200	416380	And the SCP Python thing is thrown in for your convenience.
416380	426580	Now, using that raw frame injection, we did what we called a five-finger printing,
426580	433340	and what we have in more official uses called active fingerprinting.
433340	438840	The idea is that you lob a frame, say a beacon request, at a chip,
438840	444940	and if it hears it, if it interprets it correctly, then it will respond.
444940	453320	If it doesn't hear this frame for some reason, say this frame appears malformed, then it doesn't.
453320	458120	And so we prod and listen for the move.
459340	464080	Now, fingerprinting was sort of a ruse on my part,
464660	471900	because yeah, you know, smart meters and all of that, you want to find if they are really legitimate and all that.
471900	475560	But raw frame injection was really why we wanted to do it.
475560	482160	And the little machines in the chips that do the handling of a frame, that was the goal.
482780	490360	So now Ryan is going to talk about the actual mode that we built.
490500	496100	Now, one of the reasons why we built this mode
496100	506880	is that we found no convenient way of injecting raw frames
506880	518440	if you can't find some of those T-modes, or yes, that would be them, T-mode skies.
518440	522440	We used them initially, and they used to be littered around universities.
522440	528140	We literally went up picking them off of walls after a wireless experiment,
528200	536640	a wireless sensor network experiment that did not, you know, that ran its course and then was abandoned.
536980	544280	But, of course, those things are hard to buy, and so we built a good fit with a,
544280	550240	based on Travis's good fit, with a USB connection to your laptop.
550240	558500	With a radio chip, the CC2420, which has some nice properties, which Ryan is going to cover.
558500	562480	Now, besides that, there are other chips that do Zigbee.
562480	570260	Atmel, Frigduino has one, T-mode sky, there is Kisbee, of course, the Raven chip.
571500	578160	We stayed away from SDRs, because Travis said so, and because they are expensive.
578160	579900	They are way beyond my budget.
580600	585720	I was actually planning to do this originally with SDRs, and went begging,
585720	588580	and then the neighbor showed up and said, hey, you know what?
588760	590440	There is no need for that.
590440	595140	It will be cooler if it's done with commodity chips.
595140	596860	And we did it with commodity chips.
598300	602460	So, one of the main things we want to do, and we're going to be handing these out at the end,
602460	604920	or at least as many of them as we have,
605460	608120	is try to show why did we build this.
608120	611820	So, Sergei went over some of the limitations of the old hardware.
611840	613460	What did we put in this one?
614400	619260	This is the basic requisite block diagram, but it really boils down to,
619260	623920	you can connect to your laptop and control it in Python or C or whatever,
625080	630700	and out the other end, you can have very low level control over radio frames.
630700	636080	The reason we use the CC2420 chip, which is tough to get a hold of anymore,
636080	640460	these are some of the last ones that were available, and we keep trying to snatch them up,
640460	647680	is that it has registers exposed, which allow you to violate the protocol,
647680	650340	to do the raw layer injection.
651940	653740	And so it looks like this, right?
653740	654720	This is the blow-up.
655460	662760	USB, FTDI chip to convert it to serial, MSP430 to hold your firmware,
663380	668800	and then this new radio with the CC2420 chip to actually inject it.
668800	671840	Yeah, notice the two antennas, right?
671840	674540	The external antenna and the internal antenna.
674940	679260	You should run it with the right one, or else you might hurt the chip.
679260	683860	So all the ones we hand out are configured for the external antenna.
684060	689220	We can show you how to change that, probably in the hardware hacking village next door,
689220	691660	but if you would like to.
691800	693480	So what do we support out of the box?
693480	699380	These are already flashed with firmware, so please don't reflash until you know what you're trying to do.
700140	701500	But you can sniff.
701500	704940	The nice thing we have in this one out of the box is injection,
704940	710840	as well as some jamming that you should only use in a controlled and legal lab environment,
710840	716960	along with reflexive jamming, and then obviously the low-level control over the registers,
716960	720080	and the ability to reprogram them if you want.
720780	724640	But really what I'm here... really my motivation for being here
724640	729860	is to try to convince you guys to take this hardware that we're going to give out and make it better.
731260	735120	These are just a few of my ideas, and I'm sure you have better ones, right?
735480	739060	We've wired it to support a battery pack.
739060	743900	We've put flash on it, so you could sort of put a battery pack and flash and throw it over the fence
743900	746800	and let it log some stuff for you.
746880	749820	You could put more business logic in the firmware.
750540	753720	And yeah, yeah, there's expansion headers so that you can actually do that.
759290	761810	So now we're going to go into sort of two sections.
761810	764250	One of which is like how to use it for defense.
764250	769350	Here's some ideas how you can do some defensive wireless intrusion detection systems with it.
769350	773270	And then the next one will be how do you totally break the idea of doing WIDS with it.
773430	777430	We like to bundle it in the same talk, so you can't tell me that I told you so.
779310	782370	What we did is we released an open source WIDS framework.
782370	784390	It looks something like this.
785590	792410	Basically you deploy drone devices out around your network where you want to detect attacks.
792650	795410	And it has a backhaul and analytic portion.
795410	800390	I'm going to really glaze over this, so please come talk to us more if you want.
800390	808310	Or see our full presentation from Troopers 2014 this year that gives you a lot of detail about this.
808310	814050	Long story short, together with making packets you can, of course, disassemble packets.
814050	818470	And have rules fire when you disassemble a particular kind of packet.
818470	820490	So you can roll your own WIDS.
821590	823790	Wireless Intrusion Detection System.
823850	824830	Sorry.
825610	826590	It just keeps...
826590	827810	Oh, WIDS WIPS.
827810	829870	Intrusion Detection, Intrusion Prevention.
830650	835750	You know, WIDS have been dead and not quite dead.
835750	837110	Maybe like zombie.
837930	841470	For, what, 10 years?
842630	847790	So, hey, here is another dead baby, if you will.
848430	852590	And, of course, we are going to kill it right now.
853010	857970	But first, before we kill it, let's show that you could try to do something useful with a WIDS.
857970	863810	So one very basic attack on 802.15.4 is doing network discovery.
863810	868670	So if you do an 802.15.4 on a pen test, you have one of these devices hooked up.
868670	870850	You want to find your target network.
870970	872470	This is what you are going to do.
872470	875430	You are going to go active, if you are allowed to.
875550	880930	And you are going to basically do an equivalent of a TCP SIM scan, sending out beacon requests.
881390	887890	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.
887890	889530	Because why would you do that?
889530	900490	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,
900490	911710	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.
911710	919370	And really what this boils down to is if somebody runs out of our Killer Bee Toolkit, the tool ZB Stumbler,
919370	923710	which is like, again, if you are on a pen test, one of the first things you might want to do,
924610	928210	the WIDS is going to start popping these alerts.
928430	931390	You know, that it saw beacon detection.
932390	935230	The same thing goes for disassociation frames, right?
935230	938010	We all saw this with Wi-Fi years and years ago.
938010	940510	So let's have another protocol that has the same issue.
941730	946990	Which is that you can either figure out, you can do some recon and do this smartly,
946990	949750	or you can start spamming them all over the place.
950350	952610	Let's say you want to spam them all over the place.
952610	955570	We made a tool because why make you do the work?
956130	961170	So you configure it. You actually do need some recon to do this from ZB Stumbler.
962570	965990	But of course a WIDS would say that you could detect this.
965990	968010	You start seeing a ton of these frames.
983170	988810	So we have posted up on our website, obviously the talk was at 2-14.
988810	990370	It goes a lot over this.
990490	992270	The code is up on GitHub.
992570	996150	And you can either build it into it or break it if you want.
996330	998090	But let's talk about breaking it.
998090	1001670	Yeah, because now that we brought this little thing into the world,
1001670	1003010	we're going to kill it.
1003790	1004670	Badly.
1005690	1009590	So here's your FIFRAME, right?
1009590	1013430	This is the part that Wireshark would not show.
1014510	1018890	This is the preamble, this is the SMD, and this is the frame.
1019070	1022770	From that point on, you have your link layer frame.
1023390	1032990	But these are the ones, these fields, are the ones that control the actual machinery inside the file.
1032990	1036830	Now, when you say the file layer, that's already a lie.
1036830	1041530	Because the file layer consists of several sub-layers, if you will.
1041530	1044050	They're never really called that.
1044490	1050050	But, you know, there is machinery that does synchronization.
1050050	1057010	There is a shift register that looks for the specific SFD, A7, in the standard.
1057010	1062910	And there is the machinery that then does the control summing.
1062910	1066930	But, you know, you can ask yourself, what happens if you play with it?
1066930	1073570	Say, what if you make the frame length longer than your actual frame?
1073650	1074990	What will happen?
1075110	1082730	Well, the file layer is just the chip, it's just a machine for pulling symbols out of the air.
1083110	1092190	And so it will pull whatever symbols follow in the noise, and that will become a part of the frame.
1092190	1104310	And if you're lucky, and the garbage symbols that make up the frame control sum actually does match,
1104310	1114430	and this happens, you will get basically to hear at the end of your frame what the noise sounds like.
1114430	1115870	And that's interesting, right?
1115870	1123050	Because people believe in boundaries around the frame, but there are no boundaries.
1123050	1127290	People believe in boundaries between symbols, but there are no boundaries.
1127290	1139790	Travis showed that with his 8th oven nibble shift, that allows you to receive a frame that was never sent as such.
1139790	1145910	No symbol in the received frame in his trick is shared with the sent frame.
1145910	1147230	How cool is that?
1147230	1161510	So, go over to the vendor area, find the samizdat booth, print yourself the previous issue of the International Journal of POC or GTFO,
1161890	1166710	and that knowledge will be yours, together with a paper cutout game.
1166710	1174030	But we're going to exploit this exactly along the same lines.
1174190	1178330	The fact that the chip is just a machine for pulling bytes out of the air.
1181270	1187150	And the trick that we're going to use is the packet-in-packet trick.
1187410	1191630	So, one important thing, the most important thing about ZigBee as a protocol,
1191630	1199850	is that the preamble, the sync and the length, are encoded exactly the same way as the rest of the frame.
1200150	1203880	So, signaling is done the same way as data.
1204810	1210390	So, one thing about the air is that there is always noise in it.
1210550	1221150	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,
1221150	1225710	so if this A7 turns into a pumpkin due to noise,
1229150	1233530	then all of this preamble will have been for noise.
1233750	1239890	And your card will not, your chip, will not go into, oh, I am in a frame mode.
1239890	1247610	And so it will continue to see these symbols in the air as noise, outside of a frame.
1247610	1253650	And then, when your payload contains a valid preamble, and a valid sync,
1254270	1259490	these things are perceived as the beginning of a new frame.
1259490	1265890	So this is the packet-in-packet trick which got Travis his pony two years ago.
1265890	1278950	So, the body of the injected frame will be basically at the higher layer,
1278950	1284650	and so you can inject into PHY if you control the app layer.
1284650	1286330	Now, how nifty is that?
1286630	1293610	But, in our case, we don't really need to wait for the noise to come and do its magic.
1293610	1301650	We can simply reset the configuration register, where the SFD is stored, to something else,
1301650	1303780	and so there will be no SFD.
1304150	1313170	And so we can transmit with arbitrary preambles, arbitrary garbage between the preamble and the sync,
1313170	1318830	whatever length we want, and that's your raw frame injected.
1321050	1328350	So, packet-in-packet basically serves as a vehicle for this injection with this chip.
1328910	1333290	So, packet-in-packet is providing us sort of a layer-one injection.
1333290	1337550	You can do this with a USRP or a software-defined radio as well.
1338610	1344290	The differences in the state machines of the radio chips themselves exist,
1344290	1349150	and together what that does is allow us to do a PHY layer fingerprint of the chips.
1349490	1354370	A PHY layer fingerprint or something that would be a WIDS evasion.
1354510	1360550	Because what you can do in this case, just to totally kill that WIDS that we just talked about,
1360550	1368230	was if you're receiving your actual devices deployed in your network are not the exact same chips,
1368230	1373570	or one that we cannot fingerprint differently than the ones being used in your WIDS deployment,
1373570	1378750	so if you have two different vendor chips, even if they're both 802.15.4 and ZigBee compliant,
1378750	1384970	there's differences between them so that you can transmit a frame which is seen by one as a perfectly valid frame
1385570	1389610	with a high success rate, whereas another one will not see it.
1389790	1393890	And what we're going to show you next is how to do that and how to find those differences.
1395450	1397890	So, this is a really basic setup, right?
1397890	1402990	You have your target device, and your target device for this needs to just, like, listen for something
1402990	1405470	and respond with something else.
1405530	1408170	So, the protocol supports this, right?
1408170	1414850	Either beacon requests and beacon responses, or sending a data packet and getting an acknowledgement frame,
1414850	1419310	any way that you can, or you could, you know, if you control this one fully in the firmware,
1419310	1421050	you can just sniff out of it.
1421230	1427090	And what you want to do is see if that radio chip, when you stimulate it with, say, a beacon request,
1427090	1430310	if a beacon response comes back to your other chip.
1430550	1437570	So, we've done this sort of thing with H.211 in a talk from a few schmuckons ago.
1437570	1445830	If you remember, we simply used the frame control bits, the flag bits, one full byte of those,
1445830	1449190	set them to all sorts of nonsensical combinations,
1449190	1457650	say, a management frame claiming to come from the distribution system, or similar ridiculous things,
1457650	1464670	or, you know, an app with a whole bunch of flags, like a Christmas tree packet that nmap sends.
1464670	1471970	And we actively fingerprinted various chips, and lo and behold, they responded differently.
1472650	1478490	So, the same is true on the lower layer, on the PHY layer.
1478490	1485270	The chip has its own state machine. Here is the state machine of the C2420 chip.
1485710	1489810	And, of course, all of those things would be different.
1490270	1494730	And for some, a shorter preamble will be a killer.
1494770	1502870	For others, garbage between the preamble and the SFD would be what would make them not hear the packet,
1502870	1505690	while others would hear them perfectly.
1505690	1514950	So, we came up with a bunch of methods to malform that PHY part of the frame.
1515330	1518330	And, where is Travis?
1521940	1529420	He's probably drinking beer while we're, you know, while we're introducing people to his native culture.
1529420	1536400	This is Cumberland Gap, which is, of course, quite important in the Tennessee history.
1537300	1543620	And Travis would have told you about this if he had the good fortune to.
1543620	1550020	And now, of course, I have to sing the song, you know, drink a little whiskey, take a little nap.
1550020	1552260	We're 15 miles from the Cumberland Gap.
1556760	1559220	My vocals are horrible.
1561000	1565740	So, that was actually the first method that we used, which didn't work out.
1565740	1568560	So, we transplanted it on New Hampshire soil.
1568560	1570320	And this is the Franconian Notch.
1570320	1578280	This is how you would drive up to Dartmouth from Massachusetts, although I can't imagine why you want to go there.
1580860	1584000	So, New Hampshire is a free state, right?
1584180	1586000	Massachusetts, not so much.
1589020	1592460	So, what we're going to do now is show you the three techniques that worked.
1592460	1596380	We left off Cumberland Gap because Tennessee just didn't live up to Travis's...
1596380	1598960	I'm trying to taunt him, but...
1598960	1606640	So, in Franconian Notch, the technique here is that we take those eight nibbles of zeros that should be there,
1606640	1612280	put this back as part of the preamble, and let's start changing some of them to Fs.
1612280	1619820	So, when you start doing that, using the packet and packet to have control over this layer that you usually don't control,
1619820	1622380	what do you see differently between chips?
1622740	1624960	And what you see differently between chips...
1624960	1628680	Say, this is an Atmel chip on an RZ USB stick,
1628680	1633140	this is a CC2420 on either the Appemote or the Temote Sky,
1633140	1636000	and you start seeing the numbers are very different.
1637360	1638940	If you were to send...
1638940	1642680	You know, the Appemote wants all zeros to be able to synchronize, right?
1642680	1646660	If it doesn't have those eight nibbles, it's not doing well receiving the frames,
1646660	1649740	except test results.
1650060	1658120	But on the other hand, the RZ USB stick is a lot more resilient to this attack, or to this technique.
1658240	1663820	And so, if you send something in this range, in these two, let's say,
1663820	1669840	you're getting a 99% success rate getting that received on an RZ USB stick,
1669840	1676220	whereas you're getting below 1% chance of it being received by a CC2420.
1676220	1679400	And that's where you can see a device fingerprint difference.
1679400	1687340	And now imagine that this chip is your intrusion detection chip.
1687920	1694460	And this chip is the target, and the frame carries something interesting, such as an export.
1695720	1700400	You really, really want to have it the other way around, right?
1701220	1709160	So, we don't know what specifically in that state machine causes those responses.
1709620	1717740	But we've gone through all possible preamble replacements,
1717740	1729340	and noticed that some of those frames arrived with a completely botched preamble, if you believe the standard.
1729340	1736800	And so, because I wouldn't believe this, in fact, I didn't believe this until we had 5,000 test runs done,
1736800	1740700	in different cities, and I still couldn't figure out why,
1740700	1745760	these are the PCAPs of, say, an example test run.
1745780	1750000	And what I've done is overlaid, used on correlating with the sequence numbers,
1750000	1752960	what the preamble of this packet was injected with.
1752960	1757700	And these were captured at the exact same time, so the yellow lines are connecting two of them.
1757700	1763400	So, what you see is the CC2420 chip is receiving, but it's all zero,
1763400	1766800	which the RZUSB stick is usually doing as well,
1766800	1771500	but it's also receiving a lot with other preambles set.
1772980	1780820	Now, because Sergei said, obviously, the way around this is to simply switch which chips you use for your intrusion detection and not,
1780820	1783900	we want to get rid of that notion as well.
1783900	1788660	So, let's do another technique where you change the length of the preamble.
1788660	1794780	So, instead of replacing it with garbage, what if you either have, you know, a two nibble preamble,
1794780	1798740	or a four, or a six, or the full eight nibble preamble.
1799000	1806880	Basically, how long does it take the analog portion of the radio chip to synchronize the clock?
1807280	1810560	Or at least that's what we hypothesize is this difference.
1810560	1823040	And here's the test results, which show that a CC2420 chip takes less time to synchronize than an Atmel chip,
1823040	1827260	which we should have the eight nibble bar on here, oh no, it's at the top.
1827460	1830800	There's something strange that happened in this test run with the Atmel,
1830800	1834600	because this blue bar should be higher here.
1834600	1841480	But you still see some difference, and you see the Zigduino, which is another chip, behaves differently as well.
1842820	1848440	The Franconian bridge, because we just keep making up names for this stuff, or he does,
1849120	1854380	says you keep the full eight nibble preamble, and then you put some junk in between.
1854380	1863840	So you put different numbers, in this case Fs, between it and the SFD,
1863840	1874640	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.
1874640	1887140	So this is really bizarre, right? Because you see those nice images of those frames in your protocol and in the textbooks and everywhere,
1887140	1894660	and you sort of assume that this is how those chips work. I mean, everything is a parser, right?
1894660	1906680	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
1906680	1912660	and end at this particular noise symbol, and somehow what's in the middle is not noise but the payload,
1913260	1917660	this is, I mean, this is a complete pack of lies, right?
1917660	1924880	There are no boundaries except those that those machines like the shift register make.
1924880	1929840	And those parsers are quite not what you expect, right?
1929840	1940120	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.
1940680	1942240	Isn't that interesting?
1942240	1949120	So, of course, we approach everything as parsers, and we approach everything as what we call recognizers,
1949120	1954320	for the languages that are the respective data structures.
1954320	1961520	And, of course, the first thing you want to do is to exercise the corner cases of those parsers,
1961520	1965280	and just give them something to chew on until they croak.
1965280	1973840	And normally people do this in the process of fuzzing, but we're really interested in those simple machines themselves for their own sake.
1974040	1980980	And then it turns out that, yeah, all of those things are implemented differently on different chips, right?
1980980	1991360	So here you inject that little bridge, and your RZ USB stick just doesn't care, right?
1991360	1996120	Whereas your Zigduino, well, kind of cares, right?
1996120	2000740	And the Teemo cares a lot, right?
2000740	2005080	This is the only red that you're seeing here.
2005420	2012800	Again, you could call this a width evasion, if you know what your width chip is.
2012800	2015580	You could call it a shaped charge.
2015580	2020920	You speak the right dialect to deliver your payload, to deliver your scan,
2020920	2029020	and you could be talking to your fancy building energy management system without touching any other ZigBees around.
2029020	2038480	Or you could be talking to this medical thingy without touching your thermostat.
2039420	2044160	It's kind of like the battle language, right?
2044160	2053500	The Dune, all of those super cool warrior casts and all of that,
2053500	2059100	they speak this special language in battle that is unintelligible to the opposing faction.
2059100	2061800	You could actually do it with ZigBee chips.
2062740	2070220	With nothing but the PHY preamble SFD and some garbage in between.
2071580	2074600	This was deeply satisfying.
2074900	2078900	I hope it was as good for you as it was for us.
2081680	2088060	So what we've showed you today is the App Emote hardware so that you can play with this and expand on it.
2088900	2096280	A WID system which is very limited in its functionality and more limited when you try to evade it.
2096640	2098600	You could work on improving that.
2098600	2104720	In fact, using some of the packet-in-packet for sniffing, or what we would call packet-out-of-packet,
2104720	2110600	you could start using commodity chips to get sort of a spectrum sniffing capability.
2111260	2114680	And then Isotope, which is the name for the fingerprinting project.
2114680	2121080	We've done such limited tests, the three we showed you today, and the one that didn't work,
2121080	2125320	on doing fingerprinting that there's so much more that could be done there.
2125360	2131160	Adding Fs in probably has a lot of unintended consequences because of how chipping is done,
2131160	2133420	compared to using other symbols.
2133820	2138200	So there's a whole variety of basically PHY layer fuzzing that could be done there.
2138260	2141760	The code for all of this is posted online.
2141760	2144460	If you have any questions, please reach out to us.
2144460	2149460	We'll take questions, which will be rewarded with chips.
2149460	2151240	That's how I get questions.
2163370	2173710	Mainly by not having the metadata in the same encoding, in the same modulation, as the data.
2173750	2179570	The ZigBee Consortium apparently took this decision to simplify things.
2179570	2184930	Wi-Fi switches through modulations in the middle of the frame.
2184930	2188410	And this is ugly and nasty.
2188410	2196770	And so they decided to keep it nice, except, you know, how do you know where the frame actually begins?
2196950	2197770	Right?
2197770	2201950	Yes, encryption will help.
2203390	2214990	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.
2215410	2218530	So encryption would break that.
2218530	2224050	Of course, you know, since we control the chip here, it would not hurt us.
2224050	2228070	But then, of course, we would find it difficult to inject into an encrypted network.
2228070	2235290	On the other hand, the file layer is not encrypted.
2235630	2242310	So it's these particular symbols, and that's just it.
2242830	2252470	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.
2252470	2257090	But the radio chips have only two crypto key registers in them.
2257090	2264030	Actually, if somebody knows of a ZigBee chip that has more than two key registers, please let me know.
2264270	2269950	Because what that does is it forces you to really do network keying instead of per-device keying.
2286850	2298370	Well, yes. Basically, again, you want to have symbols in your set that do not occur in the payload.
2299350	2309190	Otherwise, you're solving a parsing problem that in the presence of noise becomes hard, and there is always noise.
2314970	2316610	Symbols in what set?
2317210	2324970	Symbols as in what you send encoded over the air with your error-correcting code.
2325070	2337770	The symbol in ZigBee is a nibble, but in fact it's 32 chips, ones and zeros, physical ones and zeros.
2337770	2346090	And the modulation is QPSK, I believe.
2349220	2350580	That's correct.
2350580	2351980	It's 32 bits.
2354300	2364020	How to build a phi layer that doesn't fall to those ruses.
2365060	2373380	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.
2373380	2379660	And Mike Ossman has an interesting talk that was built out of packet-in-packet called Unambiguous Encapsulation.
2379660	2383660	And how do you do that across a wide range of protocols, including some radio ones?
2383660	2391660	You can find that in his ShmooCon talk.
2392200	2396900	His technical report on this is online.
2397120	2408640	He uses error-correcting codes that cluster their symbols for data and metadata as far from each other as possible.
2409080	2412160	And he enumerated a bunch of those codes.
2412160	2418700	If you look at our Language Theoretic Security Workshop, LANGSEC Workshop, this year at IEEE,
2418700	2425480	and look at Travis's paper that describes his one-eighth of a nibble chipping misalignment trick,
2425920	2434920	that paper quotes the TR and gives a brief overview of the issues of how to build a better phi.
2434920	2439580	And generally, I recommend to you the Language Theoretic LANGSEC approach.
2439580	2446160	Just go to langsec.org, and there will be a bunch of papers there.
2455870	2460810	So everything that we talk about in this presentation doesn't even touch on the ZigBee layers.
2460810	2464370	It's all in the IEEE 802.15.4 spec.
2464370	2470510	Which, I should have been clear, that's to find the phi in the math layers that ZigBee is based on top of.
2487510	2497930	So, I think that really depends on how you use those different methods.
2498430	2502710	There are different ones that are more effective, but it's not.
2502710	2505750	I promise you that we have plenty... well, I'm not going to say plenty.
2505750	2510530	We have a lot of these, but I'm going to continue doing questions for...
2510530	2513290	How long do we have?
2513890	2518230	I'm going to continue doing 10 more minutes of questions, and then my voice will not work,
2518230	2521670	and then I will be drinking a beer, and then we can do more questions.
2522910	2524590	You've had your hand up for a while.
2524590	2530540	I wonder what the SFD value is that you built.
2530960	2537440	So, the firmware allows you to configure the SFD value from Python at runtime.
2538000	2540360	You do have to be careful about it.
2540360	2545060	I'd have to look in our paper for which one we set it to in these tests.
2545440	2552000	With, actually going back to the eighth of a nibble, misalignment because of how the error correcting codes work.
2552020	2560020	Like, B0 can change into A7, depending on a slight clock drift, which happens in cheap hardware.
2561980	2568720	I think we set it... you can't set it to FF because the chip decides that that actually means A7.
2571280	2580320	And so, I think we set it to F0, which is actually 0F by the time it goes on the wire.
2595660	2601460	Yeah, that was Cumberland Gap. Well, Cumberland Gap was meant to be that.
2607650	2615610	Yeah, we didn't present Cumberland Gap. We can show you the results, or they're in our paper, but it didn't work so well.
2616910	2620550	Well, I mean, we actually know how we messed up.
2622050	2623550	Start the frame delimiter.
2627530	2633310	Okay, I'm sorry, I'm having trouble keeping track of which order people raised their hands.
2633310	2635270	I've seen your hand up for a while.
2652000	2656000	Well, now you have something you can go test that with, legally.
2671620	2678940	So, let me channel Dan Geer for a moment here.
2678940	2680800	Risk is dependence.
2680800	2690100	Introducing those new dependencies of technologies that we don't really know much about yet is not a smart thing, right?
2690100	2701480	This whole smart grid is amazing, as in, whoa, not enough attack surface in our infrastructure.
2701480	2703140	Let's add some more.
2703700	2705420	Right?
2705420	2714660	It's, you know, it defies understanding.
2714740	2718140	But, yeah, shiny, right?
2722100	2725520	Speak up, please.
2736730	2738310	Yeah, yeah.
2738310	2742450	So, it's really about the resistance on the antenna.
2742530	2747290	They say it's got to be... I heard it has to be 50 ohms, right?
2747290	2754510	So, if you try to run it without the external antenna while switched to that socket, it will be bad.
2754510	2756930	The internal antenna has the proper...
2756930	2765230	I assume the radio front end, which Ryan has been debugging for, you know, months, has been...
2765230	2767990	Well, somebody else has been debugging for me for months.
2768110	2770210	Yeah, the internal antenna works.
2770210	2773990	You have to move a capacitor.
2773990	2775230	There's a capacitor at the end.
2775230	2777730	I'll be happy to show you guys or help you move it.
2780730	2783510	It's a 603 landing, so it's sort of small.
2783790	2786170	So, drink a beer before you try to solder it.
2786170	2787510	Yes, sir.
2801580	2804980	If somebody wants to buy Sergey the rest of them...
2805660	2813260	No, there's at least 10 major chips that are doing 802.15.4 from different vendors on the market.
2814500	2820700	And these are just ones that we had available in the lab to do this research on.
2821600	2831980	So, we would love to have you basically around our framework and fingerprint what you have, right?
2831980	2833980	We call this isotope.
2833980	2838460	It's, you know, it's a joke on fingerprinting being useless.
2838460	2845400	I had this discussion with Travis over beer, over multiple beers, over multiple, multiple beers.
2845400	2848680	And I finally convinced him that it was not.
2848680	2851100	And isotope, the name came from that.
2851100	2857400	Because, you know, so some kernels have more neutrons than others, right?
2857400	2858460	Who cares?
2858580	2860880	Besides the chemistry geeks, right?
2860880	2866680	Turns out that there is this thing called uranium-238 and 235.
2867080	2869600	And this thing called the chain reaction.
2869600	2871080	So, boom.
2875280	2876960	Fingerprinting matters.
2876960	2882180	Although, the kind of fingerprinting matters is fingerprinting receivers.
2882740	2884460	Sanders, nah.
2884460	2885720	I mean, forensics.
2885720	2888120	Forensics is fun, but hey.
2888300	2893160	But fingerprinting receivers gives you attack paths and those shape charges.
2903890	2905290	Uh...
2916510	2917910	Um...
2942610	2950270	So, okay.
2979650	2982330	Yeah, yeah, yeah.
2982330	2983210	Yeah, yeah, yeah.
2983210	2984630	I think what...
2997010	2998990	Sergei, one behind you.
3003460	3005120	Anyway, so...
3005740	3008040	I think we're imposing another people's time.
3008040	3011140	So, come up and, you know, buy us a beer.
3017420	3020900	I mean, as usual, students do all the work, right?
