1 00:00:01,510 --> 00:00:02,430 Hi, everyone. 2 00:00:02,430 --> 00:00:07,830 Welcome to Hacking IEEE 802.15.4 Low-Rate Wireless Networks. 3 00:00:07,830 --> 00:00:08,950 My name is Dan Perrette. 4 00:00:08,950 --> 00:00:12,110 I'm one of the volunteers with the RF Hacker Sanctuary. 5 00:00:12,290 --> 00:00:21,170 And I help design and run challenges for the Radio Frequency Capture the Flag that we run at several conferences throughout the country. 6 00:00:21,330 --> 00:00:24,930 And part of that is what prompted this talk. 7 00:00:25,650 --> 00:00:30,950 So what we're going to be talking about today is what is IEEE 802.15.4? 8 00:00:31,270 --> 00:00:36,650 It's not something that a lot of people have heard of, unless you're very familiar with some of these low-rate protocols. 9 00:00:37,130 --> 00:00:45,610 We're going to talk about sending and receiving IEEE 802.15.4 data and some hardware and software tools to do that. 10 00:00:45,810 --> 00:00:51,510 I think that's kind of the most basic you can get with hacking these types of networks. 11 00:00:51,510 --> 00:00:56,490 And then we're going to talk about some RF Capture the Flag 802.15.4 challenges. 12 00:00:57,510 --> 00:01:00,410 There's a basic IEEE 802.15.4 challenge. 13 00:01:00,410 --> 00:01:07,110 There's also a 6LowPan challenge that I've been running for a little while, and then a new challenge that I introduced very recently. 14 00:01:07,650 --> 00:01:14,930 So if you're looking for zero days or new novel research, that's not what's going to be in this talk. 15 00:01:14,930 --> 00:01:20,270 I'm going to be talking about how to interact at a basic level with some of these types of networks. 16 00:01:20,810 --> 00:01:29,110 It's something that I've seen people seem to struggle with a little bit, and I want to share what I've learned about interacting with some of these signals. 17 00:01:29,770 --> 00:01:40,330 Mandatory disclaimer, the viewpoints, opinions, and recommendations in this presentation are my own, and they're not representative of the views, opinions, or recommendations of my employer. 18 00:01:43,020 --> 00:01:45,720 So what is IEEE 802.15.4? 19 00:01:46,240 --> 00:01:52,360 IEEE 802.15.4 is a standard from the IEEE for low-rate wireless networks. 20 00:01:52,360 --> 00:01:55,840 It was first introduced in 2003. 21 00:01:55,840 --> 00:02:12,100 It defines the physical and the MAC layers, meaning how the physical signal is sent over the air, and then also the media access control layer, so addressing different devices on that network. 22 00:02:12,100 --> 00:02:16,200 So we're talking about point-to-point, from one device to another. 23 00:02:16,360 --> 00:02:20,600 That's the kind of thing that this standard specifies. 24 00:02:20,600 --> 00:02:26,940 The latest version is 802.15.4.2020, so that was released two years ago. 25 00:02:27,220 --> 00:02:31,340 You can get a PDF of that standard for free under the IEEE GET program. 26 00:02:31,460 --> 00:02:33,680 It's about an $800 paid standard. 27 00:02:34,160 --> 00:02:38,000 If you really want to read through the entire thing, have a good time. 28 00:02:38,430 --> 00:02:42,200 We're going to be focusing on just the most common things that are in there. 29 00:02:42,740 --> 00:02:52,680 So 802.15.4 can range anywhere from 169 MHz up to 10.2 GHz, depending on which physical layer implementation you're using. 30 00:02:52,820 --> 00:02:56,820 They actually do define a couple of different options for the physical layer. 31 00:02:57,380 --> 00:03:02,960 I don't know that some of those are all that common, but they are possibilities. 32 00:03:02,960 --> 00:03:09,900 In the U.S., the 2.4 GHz and the 915 MHz bands are the most common. 33 00:03:10,040 --> 00:03:23,100 The 915 MHz band is split up into 2 MHz channels from 1 to 10, and then the 2.4 GHz band is split up into 5 MHz channels, numbers 11 through 26. 34 00:03:23,860 --> 00:03:32,740 I would say the 2.4 GHz band is probably the most common, or at least those are what we're going to be talking about when we get to the challenges later. 35 00:03:35,000 --> 00:03:43,080 So I mentioned that IEEE 802.15.4 defines the physical and the MAC layers for sending these signals. 36 00:03:43,400 --> 00:03:55,820 And so let's talk just a little bit about the OSI model, and I'm going to talk about that just a little bit because the OSI model, I think, is the networking abstraction model that most people are familiar with. 37 00:03:56,420 --> 00:04:11,360 It's not perfect, and so we're not going to dive super deep into things like certain protocols kind of split some of these layers, like the data link layer in particular, and how IEEE defines things slightly differently than OSI. 38 00:04:12,120 --> 00:04:23,140 But the main thing I want people to take away from this is that there are different layers, and we're talking about those bottom two layers, the physical and the data link layer, or the physical and the MAC layer. 39 00:04:23,580 --> 00:04:29,980 So if you're talking about other protocols like Ethernet, that's at the same level, the physical and the data link layer. 40 00:04:29,980 --> 00:04:33,000 Same thing with Wi-Fi, physical and data link again. 41 00:04:33,180 --> 00:04:43,760 On top of that, you can use other protocols like IPv4, IPv6, TCP, UDP, TLS, PPTP, SOX, and all the way up to the application level, HTTP. 42 00:04:44,160 --> 00:04:48,640 So IEEE 802.15.4 lives down at those first and second layers. 43 00:04:48,640 --> 00:04:58,480 A very, very short rant and a nitpick, IEEE 802.15.4 is not the same as ZigBee. 44 00:04:58,480 --> 00:05:01,980 So a lot of people have heard of ZigBee. 45 00:05:01,980 --> 00:05:03,760 It's got a really catchy name. 46 00:05:03,800 --> 00:05:07,720 It's great in its own right, but it is not the same thing. 47 00:05:07,860 --> 00:05:12,680 So IEEE 802.15.4 is the MAC layer and the physical layer that ZigBee uses. 48 00:05:12,680 --> 00:05:15,380 However, they are not interchangeable terms. 49 00:05:16,080 --> 00:05:22,040 So taking a look back at the OSI model, IEEE 802.15.4 is at the physical and MAC layer. 50 00:05:22,140 --> 00:05:29,160 ZigBee, 6LowPan, Thread, there are some other things, too, that you can put over 802.15.4. 51 00:05:29,160 --> 00:05:32,980 Those are all in those higher level layers. 52 00:05:35,850 --> 00:05:39,930 So next up, receiving and sending 802.15.4. 53 00:05:39,950 --> 00:05:48,290 So again, I think this is sort of the most basic thing that you can do with some of these signals, aside from maybe just detecting that there might be a signal at all. 54 00:05:48,290 --> 00:05:59,770 So if you look in the background underneath the presentation, underneath the slides, you see a scrolling waterfall display that's actually centered up on a fairly active 802.15.4 channel. 55 00:05:59,770 --> 00:06:06,010 And you can see some things that are about 5 MHz wide, and those are very likely 802.15.4 packets. 56 00:06:06,230 --> 00:06:13,070 This is also overlapping in their range of Wi-Fi, so some of the more broad spectrum things are likely not 802.15.4 packets. 57 00:06:14,150 --> 00:06:20,590 But there's a decent number of 802.15.4 packets scrolling through that waterfall behind me. 58 00:06:21,390 --> 00:06:27,070 So some of the common tools for sending and receiving 802.15.4 packets that we're going to run through. 59 00:06:27,070 --> 00:06:46,630 Killer Bee, OpenLabs 802.15.4 radios for Raspberry Pis, Nordic, Nordic Dongle, SILO OpenSniffer, FreakLabs has a Freak USB dongle that is helpful, and also some SDR tools or software-defined radio tools for interacting with it. 60 00:06:47,070 --> 00:06:48,990 So first up is Killer Bee. 61 00:06:48,990 --> 00:06:55,970 This is kind of the OG for manipulating IEEE 802.15.4 traffic. 62 00:06:55,970 --> 00:07:01,930 Also ZigBee, the name Killer Bee comes from ZigBee. 63 00:07:01,930 --> 00:07:05,210 It's obviously some inspiration there. 64 00:07:06,110 --> 00:07:13,470 So this is an old tool set, and it's fantastic for capturing and manipulating traffic. 65 00:07:13,990 --> 00:07:27,610 Some of the hardware that you can get for it is, or that can be used with Killer Bee, so the App Remote V4 up at the top there, that's something that Ryan Spears and Sergey brought us, introduced at DEF CON a number of years ago. 66 00:07:27,950 --> 00:07:32,590 And that's a fantastic tool for interacting with some of these networks. 67 00:07:33,750 --> 00:07:35,910 Downside for a while, it was a little bit hard to get. 68 00:07:35,910 --> 00:07:40,790 I think there's actually a vendor now selling those for somewhere around $150 or something. 69 00:07:40,830 --> 00:07:43,790 I don't have any experience with that particular vendor. 70 00:07:44,390 --> 00:07:52,390 Sergey and Ryan were nice enough to give me one of these boards after their talk at DEF CON, and I very much appreciate that. 71 00:07:52,390 --> 00:07:59,650 That's enabled me to mess around with a number of different 802.15.4 protocol or devices. 72 00:07:59,650 --> 00:08:06,330 Also, the Atmel RZ USB stick, which unfortunately is not made any longer. 73 00:08:06,850 --> 00:08:10,150 So this was somewhere around $30 when it was available. 74 00:08:10,690 --> 00:08:13,150 Sadly, Atmel decided to stop making it. 75 00:08:13,150 --> 00:08:23,470 This is something that you could flash with the Killer Bee firmware, and then use that with the Killer Bee tools like zbdump, zbreplay, and all that sort of thing. 76 00:08:24,430 --> 00:08:34,090 Something that I haven't used, but I've heard that other people are using with some success, the TICC2531 dongle, which you can see down in the lower right there. 77 00:08:34,530 --> 00:08:45,470 That, as I understand it, is capable of sniffing only with Killer Bee, but that's another viable option for potentially capturing 802.15.4 traffic with Killer Bee. 78 00:08:47,710 --> 00:08:51,030 Next up, the OpenLabs 802.15.4 radio. 79 00:08:51,030 --> 00:08:56,790 So this is something that can transmit and receive 802.15.4 and 6LOPAN. 80 00:08:56,790 --> 00:08:58,610 It's open source hardware. 81 00:08:58,630 --> 00:09:05,190 You can sniff with TCPdump, at least within the channel that you're currently on. 82 00:09:06,390 --> 00:09:10,610 It's fairly inexpensive at around $13 when it's available. 83 00:09:10,910 --> 00:09:14,410 There unfortunately is intermittent availability with it. 84 00:09:14,410 --> 00:09:18,050 That said, it is open source hardware, so if you really want to, you can make your own. 85 00:09:18,050 --> 00:09:19,690 Not something I've tried yet. 86 00:09:19,810 --> 00:09:25,210 I might try to do that at some point, but it is something that is an option to you. 87 00:09:26,790 --> 00:09:32,450 Potential downside to using this is that you do need to compile the kernel for the Raspberry Pi and or the modules. 88 00:09:32,450 --> 00:09:38,930 So I think you might just be missing a module for the default Raspberry Pi images at this point. 89 00:09:39,350 --> 00:09:44,250 There's a helpful guide at the link that's in that slide right there. 90 00:09:44,490 --> 00:09:50,390 It's something I've followed to recompile the kernel and the kernel modules to make this module work. 91 00:09:50,550 --> 00:09:54,090 You also need WPAN Tools, which is another open source project. 92 00:09:55,990 --> 00:10:01,730 So that guide is not 100% perfect, but it's evolved over time. 93 00:10:01,730 --> 00:10:07,750 It makes mention of a few different kernel versions that were problematic at a certain point. 94 00:10:07,830 --> 00:10:16,930 I believe the current versions of the Raspberry Pi kernel are compatible with this module and with 6LoWPAN and all that fun stuff. 95 00:10:17,130 --> 00:10:21,170 I think the latest version I was running was 5.10 point something. 96 00:10:21,170 --> 00:10:28,090 Don't quote me on that exact version, something very recent, much more recent than is listed in those directions. 97 00:10:28,310 --> 00:10:30,350 Should be able to get things working. 98 00:10:34,110 --> 00:10:38,910 Also from OpenLabs, a couple of things I haven't tried yet, but I think are potentially interesting. 99 00:10:39,330 --> 00:10:42,230 There's a Pi 6LoWPAN slip radius. 100 00:10:42,230 --> 00:10:50,230 So basically what this does, it has some firmware on it that will just talk IPv6 over a slip link to the Raspberry Pi. 101 00:10:50,230 --> 00:10:54,330 So the kernel itself is not interacting with the radio. 102 00:10:55,530 --> 00:10:57,910 There's potential pros and cons to that. 103 00:10:57,910 --> 00:10:59,210 It's a potentially interesting thing. 104 00:10:59,210 --> 00:11:03,630 It's also a relatively inexpensive module just like the other one. 105 00:11:04,550 --> 00:11:10,610 Again, not something I've tried, but it looks interesting and I know the guy that made it is using them with success. 106 00:11:10,630 --> 00:11:19,070 Also this KW-41Z mini board that's got an ARM Cortex processor in it and it's also capable of Bluetooth Low Energy. 107 00:11:19,070 --> 00:11:21,110 It can run on a coin cell battery. 108 00:11:21,150 --> 00:11:30,070 Again, not something I've used myself, but it looks like a viable option for interacting with some of these 6LoWPAN networks in particular. 109 00:11:32,150 --> 00:11:36,630 Next up, the Nordic NRF-52840 dongle. 110 00:11:36,630 --> 00:11:40,570 This is a USB dongle that's very versatile. 111 00:11:40,570 --> 00:11:47,610 It's got firmware available that can sniff Bluetooth Low Energy and also firmware for sniffing 802.15.4 traffic. 112 00:11:48,170 --> 00:12:02,010 There's a Python script which is available to use as an XCAP interface for Wireshark, meaning you can have this external script captured directly into Wireshark and you can control this module from the GUI in Wireshark. 113 00:12:02,230 --> 00:12:11,750 It's relatively inexpensive at around $10 and you can get it on both DigiKey and Mouser and I'm sure some other vendors online. 114 00:12:15,660 --> 00:12:17,900 Next up, the Celo OpenSniffer. 115 00:12:17,900 --> 00:12:21,220 This is not something I have, but I've heard good things about it. 116 00:12:21,220 --> 00:12:24,440 It's a multiband 802.15.4 sniffer. 117 00:12:25,000 --> 00:12:29,520 It's very expensive at around $622 was when I checked. 118 00:12:29,520 --> 00:12:33,600 It was the price on it last I checked within a week or two ago. 119 00:12:34,120 --> 00:12:36,080 There is a killer B firmware available. 120 00:12:36,500 --> 00:12:51,620 Something I noticed about this particular sniffer when looking at it is that it's got two different transceivers on it using the chips listed there, the Atmel chips there, one for the sub-gigahertz bands and one for the 2.4 gigahertz band. 121 00:12:52,720 --> 00:13:02,460 Interestingly enough, that is the same transceiver chip that's used in a couple of the other things like the OpenLabs 802.15.4 board, also something that we're going to talk about next. 122 00:13:02,460 --> 00:13:06,860 There are a couple of different things that use that chip for interacting with 802.15.4. 123 00:13:06,860 --> 00:13:11,240 This just has two of them and does some processing to make everything a little bit easier. 124 00:13:11,240 --> 00:13:18,500 If you're looking for a more professional type sniffer, this might be something that you should look into. 125 00:13:21,060 --> 00:13:25,440 The FreakLabs Freak USB is another option for sniffing 802.15.4. 126 00:13:25,440 --> 00:13:28,900 This again uses the same chips depending on which version you get. 127 00:13:28,900 --> 00:13:32,360 So they have 2.4 gigahertz and 900 megahertz options. 128 00:13:32,480 --> 00:13:38,640 They use the same chips as the Saewoo OpenSniffer and it's basically an Arduino that's interacting with that chip. 129 00:13:38,640 --> 00:13:50,040 So there's a sniffing firmware which is available as an Arduino example sketch that you upload to the dongle and then you can sniff packets that way. 130 00:13:50,500 --> 00:13:52,780 Close to this, you can program it with an Arduino. 131 00:13:52,780 --> 00:13:58,720 So if you're looking to write some Arduino code that interacts with 802.15.4 stuff, this would be a really good thing to use. 132 00:13:59,360 --> 00:14:13,140 Unfortunately, in some of my testing, I found that it dropped packets, especially when trying to monitor six low-pin data and trying to monitor, say, repeating pings or ping sixes over six low-pin. 133 00:14:13,140 --> 00:14:20,060 I found that it seemed to drop some packets compared to some of the other sniffing solutions or some of the other sniffing options that I mentioned. 134 00:14:20,440 --> 00:14:23,420 And I also noticed that it seems to be currently unavailable. 135 00:14:23,420 --> 00:14:30,020 I'm not sure if that's a permanent thing or if that's just the particular website I was going to wasn't around. 136 00:14:30,300 --> 00:14:32,680 But that's something to consider when looking at these. 137 00:14:33,210 --> 00:14:35,620 Great, you can do some good stuff with it. 138 00:14:36,300 --> 00:14:40,080 But if you're looking to buy something new, you might not be able to find one of these. 139 00:14:42,440 --> 00:14:45,960 Last up, I wanted to mention GRIEE 802.15.4. 140 00:14:45,960 --> 00:14:51,560 This is an out-of-tree module for GNU Radio that can interact with 802.15.4. 141 00:14:51,560 --> 00:15:01,340 I think they have a couple of different physical layer implementations available in this out-of-tree module, both OQPSK and CSS. 142 00:15:02,040 --> 00:15:04,760 They might have others at this point, I'm not 100% sure. 143 00:15:05,020 --> 00:15:12,700 But this is something that you could potentially use to use a USRP as a transceiver or potentially a BladeRF or something like that. 144 00:15:13,360 --> 00:15:16,180 That said, this is a little bit more difficult to set up. 145 00:15:16,560 --> 00:15:19,560 It doesn't work just out of the box necessarily. 146 00:15:21,080 --> 00:15:24,420 It's not something that I've been able to get working, which doesn't mean that it doesn't work. 147 00:15:24,420 --> 00:15:28,300 It just means that I haven't spent enough time to get this working myself. 148 00:15:28,300 --> 00:15:34,300 But this is something that I'm sure it works based on the amount of work that's gone into it, and I have a lot of respect for the guy that made it. 149 00:15:34,600 --> 00:15:39,840 So I have no doubt that it does work if you get it set up correctly. 150 00:15:40,320 --> 00:15:50,760 But this is something that you could use to send and receive 802.15.4 packets and have a lot of control over every aspect of the physical layer, the Mac layer, everything you want. 151 00:15:54,730 --> 00:15:58,450 Next up, the RFCTF 802.15.4 challenges. 152 00:16:05,930 --> 00:16:14,710 So in the RFCTF flag, for anybody that's participated in that, you've probably seen some of these little devices. 153 00:16:14,710 --> 00:16:18,710 These are Arduino UNOs with little XB boards on them. 154 00:16:19,070 --> 00:16:21,730 So that is an XB-S1. 155 00:16:22,290 --> 00:16:27,790 So those are XBs that communicate over 802.15.4 if you configure them to do so. 156 00:16:29,090 --> 00:16:33,610 So these are simulating an industrial temperature sensor. 157 00:16:33,610 --> 00:16:46,170 The idea behind this challenge is I wanted something that was just plain 802.15.4, very basic point-to-point communication, just sending a little bit of data, which I think is what 802.15.4 is really designed for. 158 00:16:46,170 --> 00:16:50,130 Sending small amounts of data back and forth just between a couple of different points. 159 00:16:50,610 --> 00:17:08,410 You can be more complicated than that, but this is, I feel like, about a very small amount of data going back and forth between the simulated sensor on the right there without the LCD, and the simulated display, which is on the left with that LCD display on it. 160 00:17:08,610 --> 00:17:12,250 So the idea here is that there are a couple parts to the challenge. 161 00:17:12,270 --> 00:17:15,370 One is to receive the 802.15.4 traffic. 162 00:17:15,690 --> 00:17:26,830 And so in addition to sending the simulated temperature data from the transmitter to the display, there's also a key that's being transmitted in ASCII across that. 163 00:17:26,830 --> 00:17:37,290 So if you're sniffing this traffic for a little while, you'll see a bunch of simulated data, and then you'll also see an ASCII key go across in clear text at some point. 164 00:17:37,690 --> 00:17:48,650 The second part of the challenge is reverse engineering this basic protocol, decoding it, and then transmitting a value that's outside of the normal range. 165 00:17:48,650 --> 00:17:54,570 So I took the temperature ranges for this based on what's necessary for melting glass. 166 00:17:54,570 --> 00:18:09,610 And the idea is that this would be a glass oven, something that's heating up for a little while, it gets up to a certain level, and then it goes back down and kind of cools off, kind of fluctuating in temperature like an oven would. 167 00:18:10,470 --> 00:18:16,990 And it fluctuates within a certain range, and if you watch for long enough, you'll see what that range is. 168 00:18:17,110 --> 00:18:28,610 And the transmit part of this challenge is to transmit something outside of that range, hopefully triggering an alarm, transmitting something that's too hot for this particular oven, or this simulated oven. 169 00:18:31,130 --> 00:18:33,090 Couple possible solutions for this. 170 00:18:33,090 --> 00:18:41,610 When I designed the challenge originally, I intended for Killer Bee to be used to decode and to replay the traffic for this challenge. 171 00:18:42,070 --> 00:19:00,330 So one possible way you could do this is take Killer Bee with whatever dongle you happen to have, sniff the traffic with zbdump, and then take that traffic, you can extract the receive key, the RX key in ASCII out of Wireshark or whatever else you're using to look at that traffic, 172 00:19:00,330 --> 00:19:08,330 and then you can take that PCAP and either create a new one or modify that PCAP and replay that with zbreplay. 173 00:19:09,190 --> 00:19:19,590 You can also, at the same time that you're doing that, if you're sniffing with a second dongle, you'll be able to receive the transmit key once you successfully complete that part of the challenge. 174 00:19:20,470 --> 00:19:26,190 Alternate solution is sniffing traffic with the tool of your choice, doesn't necessarily have to be Killer Bee, could be anything. 175 00:19:27,070 --> 00:19:38,250 You can do things like identify the channel, the PAN ID, the source and destination for the sensor and the display. 176 00:19:38,730 --> 00:19:50,990 And then if you have an XBee module, an XBee Series 1 module, you can configure that to send and receive frames just through the configuration tool, XCTU, that's used for configuring XBee modules. 177 00:19:52,990 --> 00:19:57,970 So here's an example of what that data looks like when it's going across. 178 00:19:57,970 --> 00:20:05,650 So you can see here there are a bunch of data packets going from a source of all zeros to a destination of one. 179 00:20:05,650 --> 00:20:09,950 So that is the simulated sensor transmitting to the display. 180 00:20:10,170 --> 00:20:15,390 And you can see there's a very small amount of data, just five bytes at the end there. 181 00:20:15,830 --> 00:20:21,970 And that's all that's going back and forth, all that's going from the transmitter to the display. 182 00:20:25,930 --> 00:20:27,810 Go back real quick here. 183 00:20:27,810 --> 00:20:40,150 You also notice there's a destination PAN of 3332, and that's something else that we'll need to plug into the configuration if we want to interact with this. 184 00:20:41,450 --> 00:20:47,310 So in this case, the channel that I had set was channel F or 15. 185 00:20:47,710 --> 00:20:52,930 I have the PAN ID plugged in there, destination address of one. 186 00:20:52,930 --> 00:20:58,950 In this case, I also have my address set to one, so I could potentially receive data. 187 00:20:58,950 --> 00:21:04,790 You can mess around with those and have your destination and your source address be the same. 188 00:21:04,790 --> 00:21:06,230 You could have them be different. 189 00:21:06,230 --> 00:21:09,690 You could have them configured exactly like the transmitter or the receiver. 190 00:21:09,970 --> 00:21:16,390 There are a couple of different things you can do here in order to receive all the data and to be able to send the data to where you want to get it to go. 191 00:21:17,370 --> 00:21:20,490 Something important here is the MAC mode. 192 00:21:20,930 --> 00:21:23,790 I have that set to 802.15.4 with AX. 193 00:21:24,610 --> 00:21:27,550 There's a couple options in there with the MAC stream header. 194 00:21:27,550 --> 00:21:31,830 That's not necessary for what we're doing, and that could make it incompatible. 195 00:21:31,830 --> 00:21:36,290 So I was trying to make this as plain vanilla 802.15.4 as possible. 196 00:21:36,290 --> 00:21:40,810 Could have done no AX, but decided to go with AX for whatever reason. 197 00:21:41,230 --> 00:21:47,930 Once you have that all set up, in the console log, if you open that up, you can see a bunch of data scrolling past. 198 00:21:48,710 --> 00:21:55,890 You'll see there's a bunch of 5-byte hex values on the right there, and then a couple of longer ones. 199 00:21:55,890 --> 00:22:00,650 And you can see that the longer ones are just an ASCII DEF CON 30 demo RX key. 200 00:22:01,090 --> 00:22:03,270 So that's something I just set up just for demo. 201 00:22:03,310 --> 00:22:07,570 The other ones are simulating the actual temperature. 202 00:22:07,870 --> 00:22:12,170 You can see in there, there's a 53, which is an ASCII S. 203 00:22:12,170 --> 00:22:23,110 In this case, that's just to simulate, hey, this is the type of sensor I have, or it's something to identify the type of transmission. 204 00:22:23,110 --> 00:22:34,350 The next two bytes are the actual simulated temperature, and then that's followed by a one -byte checksum, and 0d is just a new line or a carriage return. 205 00:22:34,350 --> 00:22:38,750 It's an artifact of how the code is written to send stuff over the XP. 206 00:22:43,370 --> 00:22:53,550 So once you figure that stuff out, you've got the receive key, you can also try to craft packets to send them back to the simulated display. 207 00:22:53,790 --> 00:22:55,970 That's something you can do through XCTU. 208 00:22:55,970 --> 00:23:04,610 You can construct packets just like I have up on the screen here, and then you can send the packets either once or multiple times. 209 00:23:04,730 --> 00:23:05,750 And depending on what you send... 210 00:23:06,930 --> 00:23:12,130 So there are a couple different things I saw over the amount of time we've been running this challenge. 211 00:23:12,130 --> 00:23:21,070 The first one I implemented with no checksum at all, and saw people immediately just jump straight to changing the values to all Fs. 212 00:23:21,090 --> 00:23:23,250 Okay, that works. 213 00:23:24,070 --> 00:23:28,910 But what if we had some basic error checking, and that's where the checksum came into play. 214 00:23:29,410 --> 00:23:37,530 And so at this point, this iteration of the challenge, there are a couple different error states or a couple of different things that the challenge will detect. 215 00:23:37,530 --> 00:23:45,870 One is if you just kind of blindly send all Fs to it, including with a checksum, it'll send back a nope key. 216 00:23:45,870 --> 00:23:52,550 So basically, the display detected a really rudimentary attack. 217 00:23:52,550 --> 00:23:55,610 It knows that that should never happen. 218 00:23:55,890 --> 00:24:00,830 Everything was all Fs, so it just kind of blindly went in there and did that and sent it. 219 00:24:00,830 --> 00:24:06,470 So this is the one negative flag that we have in there. 220 00:24:06,470 --> 00:24:09,950 If you send this and submit that key, you'll get some negative points. 221 00:24:09,950 --> 00:24:16,210 Not a lot, but we figured that was kind of mean when people are doing that to go too negative with it. 222 00:24:16,570 --> 00:24:19,030 Next up is the try harder key. 223 00:24:19,650 --> 00:24:31,650 So basically, what this is, is you capture a packet, and then you modified the right bits for the temperature and modified that to something higher, but you didn't update the checksum. 224 00:24:31,650 --> 00:24:33,650 So this is a checksum mismatch. 225 00:24:33,650 --> 00:24:37,550 So that's like, you were real close, try a little harder. 226 00:24:38,030 --> 00:24:40,190 So that's the try harder key. 227 00:24:40,190 --> 00:24:50,630 Finally, down to the bottom there, we have modifying the packet to include both the updated temperature data and also the correct checksum for that data. 228 00:24:51,130 --> 00:24:54,430 And that gets you the actual TX key. 229 00:24:55,910 --> 00:24:57,150 And here's some examples. 230 00:24:57,150 --> 00:25:05,710 So if you modify the data and send a temperature outside of a valid range, just a little bit, you get the screen also turn yellow. 231 00:25:05,710 --> 00:25:13,070 And if you send it way over correctly, then the screen will start flashing red as though there were an alarm going off. 232 00:25:13,070 --> 00:25:16,190 And that's when it will transmit the key back to you. 233 00:25:26,430 --> 00:25:29,390 Next up is the 6LOPAN challenge. 234 00:25:31,070 --> 00:25:35,790 So 6LOPAN is IPv6 over IEEE 8215-4. 235 00:25:35,790 --> 00:25:41,970 And this is something that is defined in IETF RFC 4944, if you care to read up on that. 236 00:25:43,810 --> 00:25:50,070 Basically, all it's doing is defining a way of sending IPv6 packets over 802.15.4 networks. 237 00:25:50,070 --> 00:25:58,810 So you can have IPv6 addresses on your IoT network that is running 802.15.4 stuff. 238 00:26:00,190 --> 00:26:11,550 Interesting thing about 6LOPAN is that an IPv6 packet is a lot bigger than the max size of an IEEE 8215-4 packet. 239 00:26:12,870 --> 00:26:14,930 So an IPv6 packet needs... 240 00:26:16,030 --> 00:26:23,770 MTU on that is 1280 octets, and an IEEE 8215-4 frame is only 127. 241 00:26:23,850 --> 00:26:31,170 So there's a lot of overhead that you need to crunch down into a much smaller space to get this to work. 242 00:26:31,450 --> 00:26:40,930 So a lot of what the standard defines is how to compress the headers for IPv6 and also how to fragment those packets across multiple IPv6 packets. 243 00:26:41,670 --> 00:26:48,030 This is something to consider when looking at sniffing traffic for 6LOPAN networks. 244 00:26:48,750 --> 00:26:50,750 Something that I thought was a problem... 245 00:26:50,750 --> 00:26:51,330 I thought that... 246 00:26:52,030 --> 00:26:59,610 Something I learned while preparing for this talk was that I thought that 6LOPAN actually increased the MTU of 802.15.4. 247 00:26:59,610 --> 00:27:00,810 I think that's actually not right. 248 00:27:00,810 --> 00:27:10,010 I think it just compresses the headers and does some fragmentation to get the traffic to flow across those networks. 249 00:27:10,510 --> 00:27:15,310 And I thought that the MTU was bigger because there are some tools... 250 00:27:15,310 --> 00:27:20,550 Kilby in particular, the last time I tried to capture 6LOPAN traffic with it, wasn't capturing properly. 251 00:27:20,550 --> 00:27:21,710 And I wasn't sure why. 252 00:27:21,710 --> 00:27:23,290 I thought this was why it was. 253 00:27:23,290 --> 00:27:25,090 I might be wrong about that. 254 00:27:25,390 --> 00:27:30,130 But all that to say, there are some tools that capture 6LOPAN properly. 255 00:27:30,130 --> 00:27:31,770 There are some that do not. 256 00:27:31,770 --> 00:27:36,230 Double check what you're looking at if you're trying to monitor 6LOPAN traffic. 257 00:27:36,230 --> 00:27:45,370 Test and verify that your stuff is actually capturing 6LOPAN properly, displaying it correctly in Wireshark if that's what you're using to analyze the data. 258 00:27:47,850 --> 00:27:55,430 So the 6LOPAN challenge that I created is two Raspberry Pis that are communicating back and forth with each other over 6LOPAN. 259 00:27:55,670 --> 00:28:00,350 You see they're using the OpenLabs 802.15.4 radios. 260 00:28:01,290 --> 00:28:02,750 One of them is a client. 261 00:28:02,750 --> 00:28:04,730 One of them is a server. 262 00:28:04,730 --> 00:28:10,370 One of the challenges is that the client is running ping6 with an ASCII payload. 263 00:28:10,930 --> 00:28:18,250 That's something you could see, even if you're not properly decoding 6LOPAN, you might get lucky and see that text going by. 264 00:28:19,170 --> 00:28:21,630 And the keys are usually pretty obvious. 265 00:28:21,970 --> 00:28:24,150 But just ping6 with an ASCII payload. 266 00:28:24,890 --> 00:28:30,730 And then that client is also periodically getting a page over a web page over HTTP. 267 00:28:31,530 --> 00:28:34,010 And there's a key on that page. 268 00:28:34,010 --> 00:28:37,510 And also a link to a second web page with an additional key. 269 00:28:40,020 --> 00:28:47,820 So here's what that looks like if you're monitoring that traffic in Wireshark with whatever tool you choose to use. 270 00:28:48,140 --> 00:28:52,420 So on the left there, there's an ICMPv6 packets. 271 00:28:52,420 --> 00:28:57,020 And you see a Defcon 30 demo key going by there. 272 00:28:57,440 --> 00:29:01,480 Just regular ping6 between two different addresses. 273 00:29:01,480 --> 00:29:07,080 You'll see a WCTF in the payload down there. 274 00:29:07,080 --> 00:29:11,840 That is actually just part of the IPv6 addresses that I chose to use for this. 275 00:29:12,680 --> 00:29:15,400 I figured I'd throw a little Easter egg in there in addition to the key. 276 00:29:15,400 --> 00:29:20,680 And also something to make it more clear that this is part of the wireless capsule flag. 277 00:29:21,200 --> 00:29:26,980 Over on the right, you'll see the web page that the client is requesting. 278 00:29:27,600 --> 00:29:30,240 It's just getting a root. 279 00:29:30,240 --> 00:29:32,300 So it's getting index.html. 280 00:29:32,780 --> 00:29:39,160 And if you follow that stream, you'll see the entire GET request and the HTML that's coming across. 281 00:29:39,180 --> 00:29:44,520 You'll see the key, the demo, 6LOPAN RX key in there. 282 00:29:44,520 --> 00:29:47,780 And then you can see the link to that additional page. 283 00:29:49,060 --> 00:29:52,920 And if you open those up in a browser, this is what they look like. 284 00:29:52,920 --> 00:29:57,700 So it's just a little page saying, hey, 6LOPAN is fun, here's your key. 285 00:29:57,700 --> 00:30:00,240 Are you really on the network? 286 00:30:00,300 --> 00:30:01,500 Can you click this link? 287 00:30:01,500 --> 00:30:03,940 Can you also request this page? 288 00:30:03,940 --> 00:30:13,360 And that key link will take you into a second page with the TX key or a key that's only available if you go and request that page yourself. 289 00:30:14,620 --> 00:30:23,480 Something that was possible for a while, and I think a number of people were doing, were passively sniffing while other people were solving this portion of it. 290 00:30:23,480 --> 00:30:28,300 For the most recent iteration, I added HTTPS to the key page. 291 00:30:28,300 --> 00:30:34,680 So the client will request the regular page, the index.html over HTTP. 292 00:30:34,680 --> 00:30:38,020 And that goes across in clear text, and other people can see that. 293 00:30:38,020 --> 00:30:40,820 You can passively sniff that and get that flag. 294 00:30:41,080 --> 00:30:45,740 But now when you go to the key, that's encrypted over HTTPS. 295 00:30:45,740 --> 00:30:51,180 And so other people won't be able to passively steal flags if you're computing in the wireless capture flag. 296 00:30:53,000 --> 00:30:55,780 Next up, a new challenge for this year. 297 00:30:55,980 --> 00:31:00,420 I wanted to introduce an RFCTF 6LowPanFox. 298 00:31:01,860 --> 00:31:09,720 So for anybody that doesn't know what I mean by a fox within the confines of an RFCTF, fox hunting, a.k.a. 299 00:31:10,280 --> 00:31:13,580 finding mobile transmitters, is what we're talking about. 300 00:31:13,620 --> 00:31:23,040 So in this case, there will be a 6LowPan transmitter roving around whatever conference we're at, and the goal will be to go and find that transmitter. 301 00:31:23,680 --> 00:31:31,540 If you're unfamiliar with fox hunting, there's a DEF CON 22 talk in the wireless village by Adam Worth called Practical Fox Hunting 101. 302 00:31:31,680 --> 00:31:40,880 This is an excellent intro to fox hunting, and he talks about a number of different techniques and considerations that you need to think about when fox hunting. 303 00:31:40,940 --> 00:31:48,120 We're not going to go into all of those during this talk, but if that's something you're interested in, definitely go find that video and watch that talk. 304 00:31:48,120 --> 00:31:50,080 There's a lot of great information in there. 305 00:31:52,780 --> 00:32:04,500 So when I was creating this challenge, one of the most important things that you need for fox hunting is to be able to figure out where that signal is, figure out how far away from that signal am I. 306 00:32:04,500 --> 00:32:06,420 So where's the signal strength? 307 00:32:06,480 --> 00:32:16,340 And if you look in this capture from below, there's a bunch of information in that capture, but one of the things that's missing is signal strength. 308 00:32:16,340 --> 00:32:22,140 There's no RSSI, there's no other way of representing signal strength. 309 00:32:22,740 --> 00:32:25,640 And so I want to make sure that this is solvable. 310 00:32:25,640 --> 00:32:34,840 So when I created this challenge originally, I started looking through a bunch of my captures, started capturing a bunch with all the different tools that I had, and I found that none of them had signal strength available. 311 00:32:34,840 --> 00:32:40,660 It took me into this rabbit hole of, you know, why is signal strength missing? 312 00:32:40,660 --> 00:32:42,460 Where would I find that? 313 00:32:42,460 --> 00:32:44,420 Is there anything that will show me that? 314 00:32:44,420 --> 00:32:58,820 And I started thinking about, you know, this is something that shows up when I do, when I sniff Wi-Fi with Aircrack or some other tools, it usually shows up in a header above the, above that Mac layer stuff. 315 00:32:58,820 --> 00:33:02,400 It's an extra layer that shows up in Wireshark. 316 00:33:05,500 --> 00:33:14,500 And before we get into it, this is the, this XHCD comic is the most applicable to what I found in this rabbit hole that I went down. 317 00:33:14,500 --> 00:33:18,980 There, it turns out there are multiple ways to represent signal strength. 318 00:33:19,040 --> 00:33:21,880 And there are many different standards. 319 00:33:21,880 --> 00:33:24,040 There doesn't seem to be a clear winner. 320 00:33:24,040 --> 00:33:32,100 There's some that sort of win in Wi-Fi, but there's even less of a clear winner when it comes to 802.154. 321 00:33:33,880 --> 00:33:43,260 So in 802.11, there's a, most commonly if you're capturing with Aircrack or something like that, you'll see a radio tap header. 322 00:33:43,260 --> 00:33:46,160 You'll also see underneath that a WLAN radio header. 323 00:33:46,820 --> 00:33:55,220 Actually, both of those additional protocol layers will show you some form of signal strength that you can go and look in your PCAPs for that. 324 00:33:55,460 --> 00:33:59,340 And there's also a case PPI pattern or header. 325 00:33:59,480 --> 00:34:07,920 So case, like for anybody that remembers the Air PCAPs, the company that made those, case per packet information is what that stands for. 326 00:34:07,920 --> 00:34:13,820 And that's another way to represent a number of different extra data fields with additional information about each packet. 327 00:34:14,540 --> 00:34:22,000 So when we get to 802.154, there is an 802.154 radio tap header that's relatively new. 328 00:34:22,000 --> 00:34:26,060 I think, I want to say 2015 or so, somewhere in that range. 329 00:34:27,020 --> 00:34:37,540 With the NRF sniffer or that NRF dongle that I mentioned earlier, their dongle will let you do that as long as you specify an additional metadata field. 330 00:34:37,540 --> 00:34:41,140 So that IEEE 802.154 tap as the metadata. 331 00:34:41,900 --> 00:34:45,400 You can also select that in Wireshark, which I'll show in just a minute. 332 00:34:45,920 --> 00:34:53,400 With Killer Bee, Killer Bee uses another header. 333 00:34:53,400 --> 00:34:58,140 It uses the case PPI headers, so the old 802.11 standard. 334 00:34:58,580 --> 00:35:03,660 They kind of repurposed that for 802.154. 335 00:35:04,220 --> 00:35:07,240 ZBdump does not use that header by default. 336 00:35:07,240 --> 00:35:14,180 You need to use the dash P flag or double dash PPI flag in ZBdump. 337 00:35:14,340 --> 00:35:16,120 And then you'll get that per packet information. 338 00:35:16,120 --> 00:35:17,560 You'll get signal strength. 339 00:35:18,080 --> 00:35:26,000 This is something that took me a little while to figure out because in the help output for ZBdump, it doesn't tell you what that dash P stands for. 340 00:35:26,000 --> 00:35:32,360 So if you don't know that PPI stands for per packet information, you might miss that option in ZBdump. 341 00:35:33,100 --> 00:35:37,240 But both of those tools will capture signal strength for you. 342 00:35:37,260 --> 00:35:40,720 And that's something that you could use to potentially foxhunt. 343 00:35:43,080 --> 00:35:51,760 So I mentioned that the NRF dongle and the Python script for that is available as an XCAP interface for capturing data in Wireshark. 344 00:35:51,760 --> 00:35:53,800 And here's what that looks like when you're configuring it. 345 00:35:53,800 --> 00:35:55,960 So you can select the channel that you want to capture on. 346 00:35:55,960 --> 00:36:01,240 You can select 802.154 tap from that out-of-band metadata. 347 00:36:01,240 --> 00:36:09,540 And then if you look on the right there, you'll see that 802.154 tap layer above the 802.154 data. 348 00:36:09,540 --> 00:36:13,300 You can see we have an RSS, in this case, of negative 51 dBm. 349 00:36:13,380 --> 00:36:18,300 So that's the kind of information that we need to be able to foxhunt successfully. 350 00:36:21,720 --> 00:36:24,380 And that's all I've got for you today. 351 00:36:24,480 --> 00:36:31,040 So if you have any questions, the easiest place to find me is going to be on the RF Hacker Sanctuary Discord. 352 00:36:31,200 --> 00:36:32,940 My username on there is RedBaron. 353 00:36:33,420 --> 00:36:39,940 I'm also on Twitter with underscore TheRedBaron, underscore some number of underscores under there. 354 00:36:39,940 --> 00:36:45,720 You can find me from the RF Hacker Sanctuary website under the crew page. 355 00:36:45,720 --> 00:36:48,140 The bio listed there is 100% accurate. 356 00:36:50,160 --> 00:36:54,160 And like I said, this is not original research. 357 00:36:54,160 --> 00:37:07,420 You know, this talk was intended to tell people with some of the things that I've struggled with in interacting with some of these networks and to convey some of the lessons I've learned over the years of interacting with these things. 358 00:37:07,480 --> 00:37:20,360 So I'm hopeful that more people will interact with these types of networks, go find more devices, maybe do some more driving with it, interact with the RFCTF challenges a little bit more. 359 00:37:20,360 --> 00:37:24,420 Hopefully we get somebody to find the 6LopanFox at some point. 360 00:37:25,320 --> 00:37:26,860 That's all I've got for you today. 361 00:37:28,040 --> 00:37:29,500 Thanks and have a great day.