1 00:00:00,000 --> 00:00:06,420 Again, thank you all for coming. Sub gigahertz wireless. A couple years ago I was doing some 2 00:00:06,420 --> 00:00:11,400 work as a consultant and I was approached by a power company saying, you know, we're 3 00:00:11,400 --> 00:00:17,560 deploying these smart meters. And we hear that you like to break things. We'd like them 4 00:00:17,560 --> 00:00:23,420 broken. And they paid a good amount of money to invest in a lot of things, including 5 00:00:24,700 --> 00:00:32,520 standards on how to do secure computing and, yeah, I know, boring. But it paid the bills and 6 00:00:32,520 --> 00:00:39,580 they got me lots of gear and they paid me to poke at it and have fun. So I figured the 7 00:00:39,580 --> 00:00:44,500 standards work was kind of the crap of the job and I got a whole bunch out of it. One of the 8 00:00:44,500 --> 00:00:49,020 things that I ran into, in fact, that's one of the things that got Mr. Cutaway here and I to 9 00:00:49,020 --> 00:00:53,400 work together some, who here went to his eye of the meter and said, you know, I'm going to 10 00:00:53,400 --> 00:00:58,940 talk at Black Hat or DEF CON. Have you given it yet? How about Black Hat? Anybody see 11 00:00:58,940 --> 00:01:10,400 that? Sweet. Very good. Oh, Saturday, what? Get your time machines. If you don't have one you do 12 00:01:10,400 --> 00:01:15,780 have time to build one if you head over to the hardware hacking workshop. But Sunday at 13 00:01:15,780 --> 00:01:23,380 noon, he's giving the talk again here about using optical ports to break in meters. Today we're 14 00:01:25,480 --> 00:01:34,020 Hi. We'll talk more about the wireless side. One of the most annoying parts about attacking a 15 00:01:34,020 --> 00:01:39,380 power meter or coming up with actually a plan of attack because there was no such thing three 16 00:01:39,380 --> 00:01:50,720 years ago. The annoying thing was all the attacks that we could do, there really wasn't a tool 17 00:01:50,720 --> 00:01:55,520 that you could build on very easily and turn it into a network adapter to talk to power meters. 18 00:01:55,780 --> 00:02:00,640 And since the majority of what was interesting about power meters was over their wireless mesh 19 00:02:00,640 --> 00:02:07,060 networking, this was a pretty big gap. In fact, trying to scope gigs became a real problem 20 00:02:07,060 --> 00:02:17,400 because how do you wrap in a ton of research into one engagement? It turns out, power company 21 00:02:17,400 --> 00:02:20,480 that came to pay me was more than happy to 22 00:02:21,220 --> 00:02:26,700 invest in a great deal of that. Oh, you're going to do that? Okay. Getting screwed up 23 00:02:26,700 --> 00:02:36,780 here. And they taught or they invested in me working with a team growing us in sub gigahertz 24 00:02:36,780 --> 00:02:42,860 radio. Why? Because, like, one-tenth of all power meters are running in over a gigahertz. 25 00:02:42,920 --> 00:02:50,700 And everybody else is running in typically 900 megahertz. So that's one of the things that 26 00:02:50,720 --> 00:02:56,560 was interesting. So what the heck is this sub gigahertz thing? Many of you know that the FCC 27 00:02:56,560 --> 00:03:03,420 and actually outside of them globally, the international ITU have put down regulations on 28 00:03:03,420 --> 00:03:11,180 frequency. This is so that your cell phone, for example, doesn't get cut out by somebody's 29 00:03:11,180 --> 00:03:19,240 hair dryer and an overpowered CB doesn't tend to break into your television. They realize that 30 00:03:21,480 --> 00:03:28,500 the frequency is a way of broadcasting into the air. It's kind of a freedom, a rights, a 31 00:03:28,500 --> 00:03:35,740 liberty's issue, right? I have the right to transmit. But rights have to end when they stop on 32 00:03:35,740 --> 00:03:40,080 somebody else's rights, right? Unless they're mine, of course, because my rights no, sorry, 33 00:03:40,220 --> 00:03:49,700 just kidding. So the FCC has regulated many of the frequency bands that we use in the United States. 34 00:03:50,720 --> 00:03:57,320 And probably will as we discover new bands and probably move into quarks and other really cool 35 00:03:57,320 --> 00:04:04,860 things that we don't know much about yet. And they have designated several bands, ISM. Who can 36 00:04:04,860 --> 00:04:12,500 tell me what ISM is? Just shout it out. I love that. It's like a round. Industrial, 37 00:04:12,720 --> 00:04:20,700 scientific and medical. Yes. This is unregulated band that the FCC says as long as you have a 38 00:04:20,700 --> 00:04:27,380 frequency, you don't transmit more than this amount of power or if you're going to go over that up to 39 00:04:27,380 --> 00:04:35,900 this amount of power and you hop over a spread spectrum, we don't need any licensing. HAM radio 40 00:04:35,900 --> 00:04:44,540 folk. What's that about licensing and the ISM bands? Well, you see, we hams, we get to abiding 41 00:04:44,540 --> 00:04:50,360 by other rules. We are allowed to transmit with more power. We get to do other cool things and we have 42 00:04:50,360 --> 00:04:54,320 have a lot more frequency at our fingertips. But most companies don't have that. They have to 43 00:04:54,320 --> 00:05:01,660 pay a lot more for it. So they like to stay in the ISM bands. Your original cordless telephone, 44 00:05:01,900 --> 00:05:08,520 for example, 900 megahertz. Then they bumped into one of the upper ISM bands, the 2.4 gigahertz 45 00:05:08,520 --> 00:05:15,940 range, and your microwave started your cell phone and your Wi-Fi access point and your cordless 46 00:05:15,940 --> 00:05:24,420 phone were all competing for band and then the microwave took them all out. So what else is 47 00:05:24,420 --> 00:05:31,220 using ISM? We have insulin pumps and other medical devices and trust me, not everybody who wears 48 00:05:31,220 --> 00:05:36,820 them is that good looking. We have the little CB replacements, you know, the ones that we use 49 00:05:45,940 --> 00:05:53,180 on the internet. Thank you, my son. You may go in peace. Yes, that is mine. Suitcase. Big, big, 50 00:05:53,180 --> 00:06:03,120 big freaking suitcase. Sorry. This will get more amusing. Trust me. So little pink girl toys. 51 00:06:04,320 --> 00:06:10,220 A little instant messaging, you know, hey, not on the real internets so that stalkers can't get, 52 00:06:10,300 --> 00:06:15,920 oh, what the heck. Stalkers can buy IMEs, too. Power meters, our own devices, the ones that we use, 53 00:06:15,920 --> 00:06:19,820 the things that we create, especially in this audience right here, the things that we create is 54 00:06:19,820 --> 00:06:25,940 a big deal. I got a buddy of mine here who likes do-it-yourself copters and he's built a great 55 00:06:25,940 --> 00:06:31,360 deal of really cool things. And he just hands me something in black and he says, that's my 56 00:06:31,360 --> 00:06:42,020 target. Show me how to go break it. So really cool stuff. TI is making a push. Their TI Chronos 57 00:06:42,020 --> 00:06:45,900 watch is an evaluation kit designed to be used to test the performance of the device. The 58 00:06:45,900 --> 00:06:47,860 device is a little bit more complicated. You know, not because everybody wants to wear around 59 00:06:47,860 --> 00:06:54,420 something that bulky, but it shows developers how they can implement MSP430 based radios, much 60 00:06:54,420 --> 00:07:00,400 like what we're going to be talking here today, and transmit or receive in sub gigahertz. Now 61 00:07:00,400 --> 00:07:07,020 it's kind of lame. They have a boot loader that they can flash the watch wirelessly. Yay. I'm 62 00:07:07,020 --> 00:07:11,640 thinking wirelessly attacking power meters from my watch. . 63 00:07:17,260 --> 00:07:25,500 Don't bother. It should be going. Is it number two? No. I don't have any firmware. Oh. I am in 64 00:07:25,500 --> 00:07:37,580 game one. Very cool. All right. So how do we play with it? I mean, it's really cool to talk 65 00:07:37,580 --> 00:07:41,620 about things. But unless I can twiddle with it, I don't really ‑‑ I don't really have a lot of 66 00:07:41,640 --> 00:07:47,980 time. I don't really find it that interesting. I'm not kind of a learner. Well, in the early 67 00:07:47,980 --> 00:07:53,700 stages of my research into sub gigahertz talking, I thought it would be really easy. And my crew 68 00:07:53,700 --> 00:07:59,720 and I were sitting down with the little pink toys saying, how do we make that break into a 69 00:07:59,720 --> 00:08:07,400 meter? And it set us down a road, which ended up with me actually cut away here showing up with 70 00:08:07,400 --> 00:08:11,620 this stupid little green thing instead of a really cool pink thing. And this is the first time I've 71 00:08:11,620 --> 00:08:14,440 seen this. This stupid little green thing had these pins sticking out of it. It looked like 72 00:08:14,440 --> 00:08:21,840 something out of Frankenstein's wireless show. And you ‑‑ turns out it's a chip con 1111, 73 00:08:23,220 --> 00:08:29,400 microcontroller, radio and USB controller all wrapped up into one. After about two months of 74 00:08:29,400 --> 00:08:34,700 banging our head up against pink stuff, I just started writing a library and thinking, yeah, I 75 00:08:34,700 --> 00:08:37,840 can do that. I've written emulators. I've written dissemblers. Blah, blah, blah. No big deal. 76 00:08:38,060 --> 00:08:41,600 Let's just follow the spec and, you know, read the documentation. And I was like, I'm going to do this. 77 00:08:41,600 --> 00:08:47,300 And it was a great learning experience. It was amazing, actually. I still have my head shaking 78 00:08:47,300 --> 00:08:55,440 and it's distracting. But it was not easy. The documentation covered the semantics of how the 79 00:08:55,440 --> 00:09:00,740 thing did its task and expected me to know everything there is to know about USB. And I knew 80 00:09:00,740 --> 00:09:09,800 nothing at the time. So that begat the CC 1111 USB project, probably up on Google code still, 81 00:09:09,800 --> 00:09:16,660 that basically allows the computer to talk to this microcontroller and that's about it. I mean, 82 00:09:17,380 --> 00:09:23,900 it's just poke memory here, read ‑‑ or peek memory there, whatever. It was a good base. And I 83 00:09:23,900 --> 00:09:29,980 started adding some more functionality into it. And I came up with what I affectionately call 84 00:09:29,980 --> 00:09:39,240 RF cat. RF cat supports the little ugly beautiful thing up there in the corner, the green one. That 85 00:09:39,800 --> 00:09:45,920 kind of 1111 evaluation module. If you've bought a TI chronos watch, you'll recognize this 86 00:09:45,920 --> 00:09:52,060 picture down here in the lower right corner. The watch, a CD, and two dongles, one to flash 87 00:09:52,060 --> 00:10:00,880 wired and one that's just really awesome hacking wireless toy that's used to flash the watch. And 88 00:10:00,880 --> 00:10:07,520 then I still really have an affection for the pink girl toy. So we have invested a great deal of 89 00:10:07,520 --> 00:10:09,780 work into its firmware as well. So I'm going to go ahead and show you what we've done with it. 90 00:10:09,780 --> 00:10:15,080 Wow. You see the picture there. That is Mike Osman's spectrum analyzer firmware actually 91 00:10:15,080 --> 00:10:19,460 running. He's an amazing guy. And you'll notice also in the lower right hand corner, a good 92 00:10:19,460 --> 00:10:26,040 FET. Travis Goodspeed if you're here. Ciao. Awesome. There's some catches to sub gigahertz 93 00:10:26,040 --> 00:10:32,420 wireless. It's not all fun and games. The tool that I'm putting out will allow you to go learn 94 00:10:33,420 --> 00:10:38,980 and attack. But it may take some tweaking. It may take some coding on your part. Why? Because 95 00:10:38,980 --> 00:10:44,500 everybody thinks that their way is the best. And they've done about a bazillion different ways of 96 00:10:44,500 --> 00:10:49,120 sub gigahertz wireless. It's very interesting with frequency hopping, spread spectrum, which we'll 97 00:10:49,120 --> 00:10:55,780 talk about in a few minutes. One thing to point out. Just because we're in the sub gigahertz 98 00:10:55,780 --> 00:11:01,180 range, the 900 megahertz range or whatnot, does not mean that we will be able to talk to 99 00:11:01,180 --> 00:11:06,460 everything. There are two different types of frequency hopping that I will get into later. And 100 00:11:06,460 --> 00:11:08,960 one is simply not compatible with RFCAD at this point. And the other one is not compatible with RFCAD 101 00:11:08,980 --> 00:11:16,120 at this time. So why do you care? Why are you here and not walking out? Well, apparently some 102 00:11:16,120 --> 00:11:23,160 people are here and not ‑‑ just kidding. I personally think that most of us, if we have any 103 00:11:23,160 --> 00:11:32,540 technology bent at all, we marvel at the power of radio frequency. I do. It's distracting. If 104 00:11:32,540 --> 00:11:38,820 you're a security researcher, you may find that you, like I, have need to go poke at stuff. And 105 00:11:38,980 --> 00:11:43,460 even if you're not a security researcher but you maybe are a security professional at a large 106 00:11:43,460 --> 00:11:49,340 manufacturing plant, perhaps, that runs Telzon gear, you may find that you need to prove to your 107 00:11:49,340 --> 00:12:00,080 bosses that the Telzon gear is running Telnet, clear text, over the wire. Hello? All 108 00:12:00,080 --> 00:12:04,840 right. Since we are crammed in time anyway and I didn't want to cut the value from the slide 109 00:12:04,840 --> 00:12:08,960 deck so that you can take this with you, I'm going to blow through slides. I'm going to show you 110 00:12:08,980 --> 00:12:17,760 my email address and my ‑‑ did you see my email address on the front slide? If not, we'll go 111 00:12:17,760 --> 00:12:24,600 back to it later. Email me. Seriously. This is an awesome area. I want to keep working on it. 112 00:12:24,880 --> 00:12:31,000 Anybody who is familiar with 8051 core will know most of what that means. It is the most popular 113 00:12:31,840 --> 00:12:35,780 microcontroller in the world. It's been sucked into everybody. It's like the BSD license of 114 00:12:35,780 --> 00:12:44,860 microcontrollers. The microcontroller is the thing that you control and you write code for and you 115 00:12:44,860 --> 00:12:50,300 control its entire execution. However, you have this peripheral that's called a radio. It's the 116 00:12:50,300 --> 00:12:58,240 1101 radio core that TI, that ChipCon puts out. And it has its own state engine. It's got its own 117 00:12:58,240 --> 00:13:03,400 code that it follows. So you and your firmware have to tell it, go into TX mode. I want to 118 00:13:03,400 --> 00:13:05,020 transmit. And then wait. 119 00:13:05,780 --> 00:13:09,640 It's going to have a timer for it to actually get there. Then you tell it to go to idle mode and you 120 00:13:09,640 --> 00:13:15,100 have to wait. And at times, it has its own error modes that it will go into. So keep in mind, 121 00:13:15,100 --> 00:13:23,140 there are two different things going on within the RF cat. Configuring this thing is actually very 122 00:13:23,140 --> 00:13:29,520 interesting. I like low‑level programming because I like the idea of sticking bits into a 123 00:13:29,520 --> 00:13:35,700 register and having them actually make real things happen. So these registers are the ones that 124 00:13:35,700 --> 00:13:40,440 make the radio work the way that it does. TI basically took everything that they wanted to do in a 125 00:13:40,440 --> 00:13:46,940 sub‑gigahertz range in almost every kind of modulation that they wanted to use and they wrapped 126 00:13:46,940 --> 00:13:54,240 it all into one radio and let you just configure the snot out of it. And then they gave you SmartRF 127 00:13:54,240 --> 00:14:01,040 Studio, which after many hours of banging our heads up against a wall, we realized is the answer 128 00:14:01,040 --> 00:14:05,680 to learning how different configuration items impact each other. So we're going to talk a little bit 129 00:14:05,700 --> 00:14:08,960 about the different ways we can use this. If you have troubles and you are doing your own really 130 00:14:08,960 --> 00:14:16,540 hardcore stuff with RF cat, like your own firmware and doing really interesting configurations, you 131 00:14:16,540 --> 00:14:22,600 might want to check SmartRF Studio and get to know how things relate. For those of you that could 132 00:14:22,600 --> 00:14:27,780 be developing, I included this slide. We're not going to go over it. But it basically lays out the 133 00:14:28,380 --> 00:14:35,400 internal firmware API and how to use it. So what do we want to know when we're hacking wireless 134 00:14:35,400 --> 00:14:40,820 systems. There's a checklist. If you're going to do some research, you've got to know, do I 135 00:14:40,820 --> 00:14:46,940 know enough to even go poke at this thing? Could I possibly hear it if I just set it a 136 00:14:46,940 --> 00:14:52,380 channel and listened? First of all, you need to know the frequency or in a frequency hopping 137 00:14:52,380 --> 00:14:59,500 system you need to know what frequencies are used and if you can, how they're used. I'll talk 138 00:14:59,500 --> 00:15:07,880 about that in a bit. Modulation. So who here listens to AM radio? Besides the hams, who here 139 00:15:07,880 --> 00:15:14,260 listens to ‑‑ yeah, like 90 hams go down. You remember AM radio? You remember going to a 140 00:15:14,260 --> 00:15:19,180 drive ‑‑ no, you guys wouldn't remember a drive‑in. At a drive‑in it was really cool 141 00:15:19,180 --> 00:15:23,400 because you used to have this thing you set out the window. I was like five years old. And you 142 00:15:23,400 --> 00:15:27,100 rolled down the window, you set this thing there and it would speak into your left ear. It was 143 00:15:27,100 --> 00:15:29,280 kind of annoying. And then they got cool. 144 00:15:29,500 --> 00:15:35,220 They did AM radio broadcasts. And you could hear the movie in AM radio. Until like whatever 145 00:15:35,220 --> 00:15:44,600 distortion might happen to hit and you hear . Hello, Batman. AM radio is 146 00:15:44,600 --> 00:15:51,040 represented today in wireless hacking. FM radio is represented today in wireless hacking. 147 00:15:51,180 --> 00:15:56,540 You may not have heard of it. It's called amplitude shift key and frequency shift key. See 148 00:15:56,540 --> 00:15:59,480 they threw on that SK there so that you didn't think, hey, am I going to be able to hear this? 149 00:15:59,480 --> 00:16:09,480 Cool. Let's tune into whatever. Radio station. Intermediate frequency. Anybody heard of 150 00:16:09,480 --> 00:16:14,820 super heterodyne? Or heterodyne and super heterodyne radios? Yeah, hams, you can show it. 151 00:16:15,020 --> 00:16:23,100 All right. This is the idea of slingshotting a frequency from its original up to a target. So 152 00:16:23,100 --> 00:16:29,460 let's say that you have a radio that you want to deal with in your ‑‑ it's in the middle of your 153 00:16:29,460 --> 00:16:36,860 system. It's a low frequency radio signal. This is very common because the components that 154 00:16:36,860 --> 00:16:44,420 operate at low frequencies are cheap and they're accurate. And then using heterodyne, which 155 00:16:44,420 --> 00:16:53,100 means mixing in a different frequency and getting the difference on both sides as transmit or 156 00:16:53,100 --> 00:16:58,620 actually receive works the same way. And then filtering out the signal that we don't want, we're 157 00:16:58,620 --> 00:17:04,140 able to actually just move the frequency to where we want. We'll talk more about that later. 158 00:17:04,800 --> 00:17:11,160 Intermediate frequency can impact the quality of your radio signal. Baud rate. We'll talk about 159 00:17:11,160 --> 00:17:17,800 baud rate in a minute. Channel width, spacing and hopping. What kind of bandwidth filter you 160 00:17:17,800 --> 00:17:24,020 need. These are things that are just really all about radio. If you don't like radio, well, you 161 00:17:24,020 --> 00:17:28,600 might not want to be on the talk. But I think you probably do. Sync words. Sync words. It's a 162 00:17:29,420 --> 00:17:35,060 typically to block out noise, radios will look for a specific 163 00:17:35,060 --> 00:17:39,160 bite pattern or bit pattern and when it sees this bit pattern it 164 00:17:39,160 --> 00:17:42,420 says, all right, this is the start of frame delimiter. It's 165 00:17:42,420 --> 00:17:46,200 right here and then anything we receive after that is actually a 166 00:17:46,200 --> 00:17:52,020 wireless RF frame. What kind of length goes into this? We'll 167 00:17:52,020 --> 00:17:55,980 talk about this in a minute. CRC, data whitening, other 168 00:17:55,980 --> 00:18:01,160 encoding mechanisms, things that allow us to reduce error and 169 00:18:01,160 --> 00:18:07,440 reduce the number of things that we see that we don't want. Many 170 00:18:07,440 --> 00:18:10,880 frequencies are interesting but these are the most at this time. 171 00:18:14,200 --> 00:18:17,140 That is the right one, sir. Thank you. Everybody give Paul 172 00:18:17,140 --> 00:18:21,540 Melson a hand. Thank you. Or do you go by Duncan? 173 00:18:26,280 --> 00:18:31,480 So 315 megahertz, very popular. You may have 315 megahertz stuff 174 00:18:31,480 --> 00:18:36,080 in your pocket right now. Most of you own American cars, I'm going 175 00:18:36,080 --> 00:18:40,620 to imagine, and they almost all come with remote keyless entry 176 00:18:40,620 --> 00:18:45,760 systems and they almost all live at 315 megahertz. 433 megahertz, 177 00:18:45,820 --> 00:18:49,720 also actually a lot of European and other nations, they like to 178 00:18:49,720 --> 00:18:53,200 put their cars on 433. Medical devices like to live here, too. 179 00:18:55,020 --> 00:18:55,960 868, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 968, 180 00:18:55,980 --> 00:19:03,260 968. 915 center, it's 902 to 928. They are just like everything. I 181 00:19:03,260 --> 00:19:11,060 told you cordless phones. They cover parts of cell phones and other industrial 182 00:19:11,060 --> 00:19:16,460 equipment. Maybe even your power meters. 2.4 gigahertz. You guys have 183 00:19:16,460 --> 00:19:25,660 never used that. And 5.8. A little example of modulations here. I cover the 184 00:19:25,660 --> 00:19:36,080 the three main sections that the chip con 1111 supports. FSK, remember, that's FM radio. Only 185 00:19:36,080 --> 00:19:43,660 in a digital world. There's ASK, AM radio in the digital world. And MSK, a minimum shift key, 186 00:19:43,840 --> 00:19:49,940 it's something that allows for much higher bandwidth or much higher speed. So look at the 187 00:19:49,940 --> 00:19:55,940 top picture, you'll see frequency shift key. You notice in the time domain, the waves are 188 00:19:55,940 --> 00:20:00,920 really fast and then they slow down, they get really fast and they slow down. That is called a 189 00:20:00,920 --> 00:20:08,140 deviation from the frequency. And that deviation is used to figure out when you have bits, zero 190 00:20:08,140 --> 00:20:16,300 or one. Your ASK and also another well-known one that's used for everything called OOCH. It's a 191 00:20:16,300 --> 00:20:19,920 special form of ASK. So why don't you ask me a question. I'm going to ask you a question. 192 00:20:21,380 --> 00:20:31,660 What's OOCH? On-off keying. Yes. So amplitude shift key, as you can see in the picture, has 193 00:20:32,140 --> 00:20:40,180 high power fluctuations of waves and then lower power and then high power and lower power, which 194 00:20:40,180 --> 00:20:46,280 is why it's more susceptible to distortion because the power tends to fluctuate anyway by, you 195 00:20:46,280 --> 00:20:49,920 know, a passing wave of solar activity. So it's more susceptible to distortion because the power 196 00:20:49,940 --> 00:20:54,960 is higher than the power of the solar activity or whatever. On-off keying is basically if there's 197 00:20:54,960 --> 00:21:02,360 wave, it's a one or a zero. And if it's not, then it's the opposite. Now, minimal shift key, if 198 00:21:02,360 --> 00:21:07,600 you look at this bottom thing, you'll notice that you really can't tell that there's any modulation 199 00:21:07,600 --> 00:21:16,000 going on. And that's because it is so fine that it actually is hard to tell. But if you count the 200 00:21:16,000 --> 00:21:19,920 loops, you'll actually see that it shifts by half a second. So you can't tell that there's a wave. 201 00:21:19,940 --> 00:21:26,020 And GSM is used by half of a hertz in that picture, between the different sections. And GSM 202 00:21:26,020 --> 00:21:35,040 actually uses MSK. Intermediate frequency, we mix the local oscillator with our radio 203 00:21:35,040 --> 00:21:43,480 transmitter and if we have a for example, okay, example here. Power meter system has a 900 204 00:21:43,480 --> 00:21:49,920 megahertz, sub gigahertz radio, similar to what I have. They're operating in the network of the 205 00:21:49,920 --> 00:21:56,420 900 megahertz range by spec, they operate the radio at 400 megahertz and they've got a 206 00:21:56,420 --> 00:22:02,600 local oscillator they're mixing in at 1.3 gigahertz. Do the math. Plus or minus 400 207 00:22:02,600 --> 00:22:17,060 megahertz from 1.3? Yell it out when you got it. 900 megahertz and 1.7. So they throw a 208 00:22:17,060 --> 00:22:26,020 filter so that 1.7 doesn't actually go anywhere and they've got their 900 megahertz. Now they 209 00:22:26,020 --> 00:22:31,100 said that this was for modularity and the ability to change. I think they were just being a pain. 210 00:22:37,480 --> 00:22:46,520 Who here had a 1200 modem? How about 300? No, no, no, 1200 that drops to 3 doesn't count. 211 00:22:48,440 --> 00:22:57,580 150. Yeah, I see still a few hands. Yes, thank you. I'm glad other old people are here. 450. 212 00:22:58,060 --> 00:23:07,160 Anybody 410? Just for the sake of obscurity? 110. All right, cool. Well, the concepts behind the 213 00:23:07,160 --> 00:23:16,840 modem that provided you that amazing addiction of computers talking to computers remotely. The 214 00:23:16,840 --> 00:23:17,040 addiction of talking to computers remotely. The addiction of talking to computers remotely. The 215 00:23:17,060 --> 00:23:23,280 addiction is continued, I believe. The same concepts are used here in radio. If you think 216 00:23:23,280 --> 00:23:29,920 about it, what are we doing? We are sending analog signal, right? How do we send bits that are 217 00:23:29,920 --> 00:23:39,780 digital over analog signal? We modulate it. How do we get the bits off? You demodulate it. Modem. 218 00:23:41,360 --> 00:23:47,040 In my research, I've seen a lot of 2400, 192, 384. I don't know how many of you have seen a lot of 219 00:23:47,040 --> 00:23:53,040 2400, 284 and 250,000 baud. Among a few others. I ran into a couple that I won't mention. But 220 00:23:53,710 --> 00:24:00,320 there's some really weird ones out there. Make no mistake. I am working hard to make RF cat the 221 00:24:00,320 --> 00:24:07,760 one tool that you need to attack things. But in reality, I use a fun cube dongle for some of the 222 00:24:07,760 --> 00:24:13,900 research that I use and other software to find radios that allow me to look at and measure the 223 00:24:13,900 --> 00:24:23,280 distance between things so that I can tell modulation and baud rate. Channel width. So in 224 00:24:23,280 --> 00:24:33,200 a channel hopping system, let's just take for example a 902 to 928 channel hopping system. We 225 00:24:33,200 --> 00:24:38,980 break up the frequency range into different channels and we give them specific amounts of 226 00:24:38,980 --> 00:24:45,760 space. A, because strong signal is going to actually take up more than just that frequency 227 00:24:45,760 --> 00:24:52,920 that you're on. And B, because we need to know between different radios where the guy is 228 00:24:52,920 --> 00:25:04,760 going to go next. So your Wi-Fi hops over a set number of channels and so does your ZigBee. In 229 00:25:04,760 --> 00:25:08,960 fact, ZigBee and Wi-Fi live in the same frequency range, at least for 10 years. And so 230 00:25:08,960 --> 00:25:16,120 they have different channel sets and the ZigBee spec, was it 15.4? The 15.4 spec that ZigBee is 231 00:25:16,120 --> 00:25:24,820 based on actually chose their hopping pattern or their hopping channel bandwidth so that it would 232 00:25:24,820 --> 00:25:34,440 interfere as little as possible with Wi-Fi. Bandwidth filter. What's a filter do? Keep stuff 233 00:25:34,440 --> 00:25:38,480 we don't want to see from getting in, right? Anybody with young kids, you may have an Internet 234 00:25:38,480 --> 00:25:45,880 filter. They typically don't work very well, but they can. What's the same here? We will always 235 00:25:45,880 --> 00:25:54,060 have noise. There's radio going on all around you, even that we didn't create as people. So we 236 00:25:54,620 --> 00:26:03,000 want to focus our radio receiver into just what we need to see what we want. If we open it up too 237 00:26:03,000 --> 00:26:08,200 far, we have too wide a bandwidth filter, we get too much noise. Or a lot of noise, anyway. And the 238 00:26:08,200 --> 00:26:12,600 higher layers of our programming have to deal with that. If we get too small, then we start 239 00:26:12,600 --> 00:26:18,260 clipping and we don't actually get the data as we want. We start getting bit errors. 240 00:26:24,200 --> 00:26:30,120 Another configurable part of the radio that helps us only get what we want to get is called a 241 00:26:30,120 --> 00:26:37,780 preamble. And I talked about sync words just a few minutes ago. A preamble is defined as a logical bit 242 00:26:37,780 --> 00:26:44,020 1 and a logical bit 0 in succession over and over and over and over and over and over again at a 243 00:26:44,020 --> 00:26:50,900 particular baud rate that your modem will understand. The packet subsystem of the radio will 244 00:26:50,900 --> 00:26:59,740 look for this preamble. And after a particular preamble quality threshold, in other words, a 245 00:26:59,740 --> 00:27:06,340 certain number of 1s and 0s in succession, then it says, okay, I'm going to look for a sync word. 246 00:27:06,340 --> 00:27:11,280 Because if there's just a couple, then that doesn't necessarily mean that we've got radio. We can 247 00:27:11,280 --> 00:27:21,080 tune the preamble quality threshold to 0 if we want. And we can set how the sync word detector 248 00:27:21,080 --> 00:27:26,560 works. There are several different things about the sync word detector that need to be 249 00:27:26,560 --> 00:27:34,780 understood. We can configure that thing to nothing. So it just doesn't look for anything and hands 250 00:27:34,780 --> 00:27:41,680 any bits that the radio wants up the channel. What's this good for? Well, it's good for seeing 251 00:27:41,680 --> 00:27:48,440 if your pipeline of data is working because it just floods into your client. It's also good for 252 00:27:48,440 --> 00:27:57,080 generating fairly random noise, right? And what does fairly random noise help us with? Crypto. 253 00:27:58,980 --> 00:28:05,880 There's also a carrier detect setting. This means I don't care about bits, 0s, 1s, sync words, 254 00:28:06,020 --> 00:28:13,580 whatever. I just want to see power on the radio band. So even before it receives data, you've 255 00:28:13,580 --> 00:28:19,360 got a carrier wave. And as soon as it sees the carrier wave, it then starts sending data into 256 00:28:19,360 --> 00:28:27,060 your client. You can also set, and very commonly, you'll see 15 of 16 bits per second. That's 257 00:28:27,080 --> 00:28:33,500 a lot of what we received in the air match the sync word. So you set the sync word OC4E is a 258 00:28:33,500 --> 00:28:42,960 common sync word for TI. And let's say you get 1C4E. In this mode, that would be enough. You've 259 00:28:42,960 --> 00:28:49,540 also got 16 of 16 bits so that it's got to be perfect. And you've got 30 of 32 bits which 260 00:28:49,540 --> 00:28:54,740 actually says, and this is important, every time I transmit, I'm going to send the sync word 261 00:28:54,740 --> 00:28:57,060 twice. And when I receive, I'm going to send the sync word twice. And when I receive, I'm going 262 00:28:57,060 --> 00:29:08,840 to look for it twice. You'll notice at the bottom of these slides there are registers and these 263 00:29:08,840 --> 00:29:13,460 are the registers that control these things. RF cat tries to shield as much of this as 264 00:29:13,460 --> 00:29:23,620 possible from you, but it's good to know. Every system does its own thing, right? At least in 265 00:29:23,620 --> 00:29:27,040 this space. So some systems, you know, they're not going to send the sync word twice. They're going 266 00:29:29,180 --> 00:29:29,940 to do it every day. So they're not going to send it twice. So that's a reason why this is that 267 00:29:29,940 --> 00:29:33,880 I'm going to introduce the SYNC SYNC by using variable packet length. It indicates according 268 00:29:33,880 --> 00:29:41,500 to the TI radio anyway, the first byte that's received after the sync word is a length byte. And 269 00:29:41,500 --> 00:29:49,620 then from thereafter, that is the length of that packet. It's very good for dynamic data and not 270 00:29:49,620 --> 00:29:55,940 blowing a whole bunch of bits that aren't necessary with padding. It can be kind of arbitrary and 271 00:29:55,940 --> 00:29:57,020 not necessarily 숍Å æšĕىŠ you to think about the standard kind of wiring. You are 272 00:29:57,020 --> 00:30:02,360 supported by every radio. But it's a good option to have. Fixed length packets are far more 273 00:30:02,360 --> 00:30:08,240 common. And when you're doing attacks and finding out what a system is actually doing, you're 274 00:30:08,240 --> 00:30:13,380 probably going to actually just want to use fixed length packets and set it to something low 275 00:30:13,930 --> 00:30:18,280 but large enough that you can identify. That looks kind of consistent with the packet that I 276 00:30:18,280 --> 00:30:25,120 just saw before it. It's about spreading a wide net and then narrowing down as we can 277 00:30:25,120 --> 00:30:35,200 determine different aspects of the radio talking. So yes, CRC whatever. We all know CRC, right? 278 00:30:36,040 --> 00:30:43,280 Well, you see the radio actually implements one type of CRC. One of the systems that I'm 279 00:30:43,280 --> 00:30:49,620 attacking in my spare time is actually using no CRC on the radio, even though the radio 280 00:30:49,620 --> 00:30:54,180 supports this kind of CRC because they've chosen their own method and they do it in 281 00:30:54,180 --> 00:30:55,100 software. They've chosen their own method and they've chosen their own method and they've 282 00:30:55,120 --> 00:30:59,720 chosen their own method. And it doesn't matter. The chip simply makes one particular type of 283 00:30:59,720 --> 00:31:04,500 CRC available to you. Cutaway, how many types of CRC have you been working with lately? 284 00:31:06,100 --> 00:31:13,240 Smart R studio. . No, we had a conversation a couple months ago. 285 00:31:13,480 --> 00:31:18,520 And he was working with a library that had like 16 different types of CRC with different bit 286 00:31:18,520 --> 00:31:25,000 sizes and iterations and starting points. Data whitening, otherwise known as the 9-bit 287 00:31:25,120 --> 00:31:34,060 chip. It's a pain for us attackers. Why? Because you get a pseudo random sequence that gets 288 00:31:35,060 --> 00:31:44,160 XORed with the actual data. Why? Security? No. Truth be told, the ideal bit pattern to go over 289 00:31:44,160 --> 00:31:55,100 radio is random bits. Because a long set of zero bits can introduce timing errors. And that's 290 00:31:55,120 --> 00:32:01,440 guidance. So every radio, every computer that's owned, the clocks are all perfectly synced, right, 291 00:32:01,560 --> 00:32:09,280 and they all keep track of time at the exact same time. Heck no. There's interference. There's batteries 292 00:32:09,280 --> 00:32:16,700 that are dying. There's actually, did you know that on your PC if you run it extra hard at 100% CPU 293 00:32:16,700 --> 00:32:25,100 your clock will slow down? I know that isn't a good way to push the hands of time back. So datarah. factories. 294 00:32:25,100 --> 00:32:33,140 allows us to XOR with a pseudo-random pattern the data which makes it pretty cool over the 295 00:32:33,140 --> 00:32:37,780 air and pretty easy to identify bit errors but it makes it kind of a pain for us because we 296 00:32:37,780 --> 00:32:43,800 were hoping to see that C12 packet going across the air and instead we got some garbage and 297 00:32:43,800 --> 00:32:52,500 have to dig in and do more reverse engineering. There are various encodings that help also 298 00:32:52,500 --> 00:33:00,200 help with bit error rates. The Manchester encoding is actually a very powerful one that says 299 00:33:00,200 --> 00:33:07,660 that between any two bits, be they one or zero, there will be ‑‑ sorry, let me back up. In 300 00:33:07,660 --> 00:33:18,820 the time frame of any bit, there will be a transition. So if you have a zero, the 301 00:33:18,820 --> 00:33:22,480 transition will, well, follow each spec in a Z. So if you have a zero, the transition will 302 00:33:22,500 --> 00:33:26,220 follow. As you can tell, there are a couple of different specs listed up there. In the top one, 303 00:33:26,960 --> 00:33:34,720 there's Manchester encoding according to ‑‑ I should look at my own instead of yours. According 304 00:33:34,720 --> 00:33:41,720 to GE. And then there on the bottom, in the opposite fashion, who knows why, patents 305 00:33:41,720 --> 00:33:52,480 probably, the exact opposite, which is put out by some hack known as IEEE 802.1, which is 306 00:33:52,500 --> 00:34:02,640 not three. The idea being, though, you've got a consistent transition that provides its own 307 00:34:02,640 --> 00:34:08,780 clock and synchronization problems go away a lot easier with Manchester than any other. Forward 308 00:34:08,780 --> 00:34:13,020 error correction. There are a couple of different types of this, but the idea is you take the raw 309 00:34:13,020 --> 00:34:21,240 data, you take parts of the data and you do manipulation calculation on them and add bytes that 310 00:34:22,500 --> 00:34:30,100 at the other end, bits can be verified and some bits, a certain number of bits can actually be 311 00:34:30,100 --> 00:34:35,320 recovered from. Very similar to what goes on in ECC for your memory and other things like that. 312 00:34:37,380 --> 00:34:45,600 The convolutional form of this is supported by the chip for RF cat. I've seen some read Solomon, 313 00:34:46,140 --> 00:34:49,940 forward error correction, but I've done that ‑‑ I've seen that in firmware because it's not 314 00:34:49,940 --> 00:34:52,480 supported by a lot of chips. So there's a lot of different ways to do this. So you can see how I'm 315 00:34:52,480 --> 00:35:02,400 doing. The chip 1111 also provides you a built‑in AES encryption, AES 128. It's good enough for a 316 00:35:02,400 --> 00:35:10,700 low‑power device. And I just kind of like looking at the AES crib sheet there. It makes so much 317 00:35:10,700 --> 00:35:16,840 sense. Wouldn't want that one during a test. All right. Thank you. I wanted to give you an example 318 00:35:16,840 --> 00:35:21,980 of what it looks like to look at TI documentation for a register. You'll notice this one is for 319 00:35:21,980 --> 00:35:30,080 modem configuration 2. And they've got several bits set off for each field. So the top one is the 320 00:35:30,080 --> 00:35:38,200 DC filter and it turns off or on. Modulation is set in bits 4 through 6. And you simply or the 321 00:35:38,200 --> 00:35:45,360 register with the bits you want in there, and it with ‑‑ okay. And it with the ones that you 322 00:35:45,360 --> 00:35:51,960 didn't want. And you get a number that matches what you actually are after. So you can see how this 323 00:35:51,980 --> 00:35:59,900 works. And I'll leave this to your enjoyment later. So how do we figure this out? Well, open 324 00:35:59,900 --> 00:36:06,860 public documentation is a great form to start your research. Reconnaissance of, for example, 325 00:36:06,980 --> 00:36:14,160 documentation of the device you're hacking. One of my very best friends is a diabetic. And it 326 00:36:14,160 --> 00:36:19,980 turns out his insulin device was the one that was hacked last year at Black Hat. Yay. And I 327 00:36:19,980 --> 00:36:21,960 picked up the document and put it on my computer. And I'm like, okay, I'm going to do this. And I 328 00:36:21,980 --> 00:36:24,720 was like, okay, I'm going to do this. And they include the frequency that the communication goes 329 00:36:24,720 --> 00:36:29,120 on at in the user documentation. Because all diabetics need to know that they're operating at 330 00:36:29,120 --> 00:36:38,180 frequency. If you can find an open‑source implementation, this is another great way to go 331 00:36:38,180 --> 00:36:45,120 after, like, public specs. Maybe it's an IEEE spec, but you can just take the Linux source code 332 00:36:45,120 --> 00:36:49,520 and read through and then figure out how it works and implement it yourself. That's excellent stuff. 333 00:36:51,040 --> 00:36:51,960 Public but harder to do. So I'm going to show you how to do that. I'm going to show you how to do 334 00:36:51,980 --> 00:36:57,940 it. There are links on here. They're on your CD. Bookmark them. Because they were a bitch to 335 00:36:57,940 --> 00:37:07,100 find. FCC is not discoverable through Google. Let me say that again. You can't find FCC filings of 336 00:37:07,100 --> 00:37:13,300 any real interest going through Google. You need to go to that website. Transition.FCC.gov. 337 00:37:13,440 --> 00:37:20,260 In fact, I think it might have changed, but this points to it. So check it out tomorrow. It's no 338 00:37:20,260 --> 00:37:20,860 longer transition. 339 00:37:22,480 --> 00:37:27,720 Patents. Some of the most amazing frequency hopping systems that I have been reading about have 340 00:37:27,720 --> 00:37:33,580 been read about through patents because everyone thinks that theirs is the best way. And even if 341 00:37:33,580 --> 00:37:40,840 they don't, who knows? Sucky stuff has happened and gone public. Ethernet, for example. Token 342 00:37:40,840 --> 00:37:50,580 ring was way better. Theoretically. Ethernet was cheap. And easy. Well, we know who won. 343 00:37:52,520 --> 00:38:01,860 I read a French patent on how to talk to one meter. It was in English. And I've found several other 344 00:38:01,860 --> 00:38:11,700 meter type patents there for your enjoyment. Reversing hardware. It gets a little bit more intense. 345 00:38:11,840 --> 00:38:21,440 And it's not as frequent that it's easy. Like finding a patent, it's either there or it's not. Hardware reversing, you stick in a lot of time and hope that it works out. 346 00:38:21,980 --> 00:38:33,740 If the radio is different than the microcontroller driving it, this is a good thing. Tap the lines, figure out what data is going back and forth, configuration or otherwise, and do your own analysis. 347 00:38:34,620 --> 00:38:45,380 Hopping pattern analysis. This is a long topic I won't be going into today. Trial and error? Well, for radio frequency parameters, trial 348 00:38:45,380 --> 00:38:51,640 and error is pretty good, actually. If you've got some insight into the spectrum, if you've got a good spectrum analyzer, for example, 349 00:38:51,640 --> 00:39:00,040 which I wrapped into RF cat as of Saturday last. Mac layer. Understanding the Mac layer and the 350 00:39:00,040 --> 00:39:05,140 network layer of any device, if it's not TCP and Ethernet, you might have to do some digging, 351 00:39:05,340 --> 00:39:11,920 looking for talking to the vendor, see what specs they fulfill. Everybody wants to say how 352 00:39:11,920 --> 00:39:23,140 standard they are. So, hey, they might help. A little intro to FHSS. The FCC said if you want 353 00:39:23,140 --> 00:39:30,320 to transmit over a certain power, then you need to spread out your signal and only spend a 354 00:39:30,320 --> 00:39:41,060 certain fraction of time on any one given channel over a 20 second period. This has helped a lot 355 00:39:41,060 --> 00:39:41,860 of systems. 356 00:39:41,920 --> 00:39:51,660 Be more resilient to noise. And it's been a real fun one for RF cat folks like myself. The 357 00:39:52,280 --> 00:39:59,940 humor behind RF cat is that it all got started while I was at distribute tech a few years back. 358 00:40:00,720 --> 00:40:05,440 And I'm talking to a vendor trying to see how they are feeling about their security stance. 359 00:40:05,600 --> 00:40:10,520 And they're like, our frequency hopping spread spectrum is too fast for hackers to hack. 360 00:40:10,520 --> 00:40:18,860 And he was trying to sell to me. He didn't even know who I was. Whatever. Oh, my word. So, this is 361 00:40:18,860 --> 00:40:29,640 how I got the passion and the fire under my butt to get to where this is. I've only got a couple 362 00:40:29,640 --> 00:40:38,100 more minutes here, so I'm gonna leave on a little Neville Mescaline. Back in 1903. Article hit 363 00:40:38,100 --> 00:40:55,100 slashed out about eight months ago. Back in 1903, Giacomo Marconi, same Marconi that you 364 00:40:55,100 --> 00:41:00,480 buy equipment today, same company. He was about to give a demonstration on how he could 365 00:41:00,480 --> 00:41:06,760 transmit wireless signal from one location to another over a great distance of several 366 00:41:06,760 --> 00:41:15,340 miles using a channelized radio signal that was virtually private. You had to be able to 367 00:41:15,340 --> 00:41:23,380 tune your radio specifically just right to be able to transmit and receive the signal, making 368 00:41:23,380 --> 00:41:31,500 it a virtual private network. About five minutes before the demonstration was about to 369 00:41:31,500 --> 00:41:36,740 begin, I mean, people, peers all over in the industry, they were just in and out of the 370 00:41:36,760 --> 00:41:43,680 audience just like this. And Marconi's assistant was sitting there getting the gear all 371 00:41:43,680 --> 00:41:51,140 ready and suddenly five minutes early they start hearing Morse code tapping. Somebody in the 372 00:41:51,140 --> 00:41:56,380 audience who is very good at Morse code started listening and chuckling because the Morse code 373 00:41:56,380 --> 00:42:05,400 coming across was mocking Marconi. Because Marconi was an idiot. He made tons of money. Let 374 00:42:05,400 --> 00:42:11,280 that be a lesson to you. You don't have to be smart to make money. You just need to, yeah, 375 00:42:11,380 --> 00:42:17,720 something. So Neville Maskelyne a couple days later came forward and said, yeah, I did it. Now, 376 00:42:17,740 --> 00:42:23,440 a little bit about Neville. He was in the circus family. And in the circus, he had learned radio 377 00:42:23,440 --> 00:42:30,120 tricks because of their entertainment value. You get the tricks where you're able to wirelessly 378 00:42:30,120 --> 00:42:35,380 communicate to somebody on stage about who is what or things like that. And he was able to do that. 379 00:42:35,400 --> 00:42:42,120 Things of that nature. So he was one of the original hackers of wireless systems. So he said, 380 00:42:42,200 --> 00:42:48,200 yeah, sure, I did it. You're a fool. You don't have any virtual private network. I just 381 00:42:48,200 --> 00:42:58,680 broadcast a powerful signal and took over your current arrangement. And his response, epic, I 382 00:42:58,680 --> 00:43:05,380 will not demonstrate to any man who throws doubt upon the system. And on the other hand, 383 00:43:05,400 --> 00:43:15,380 on that note, I will leave you with this thought. It is our responsibility to validate the 384 00:43:15,380 --> 00:43:26,880 security of the systems that we rely upon. Your best friend may be the first death by medical 385 00:43:26,880 --> 00:43:31,300 device attack. Thank you. 386 00:43:35,400 --> 00:43:37,420 Thank you.