1 00:00:00,000 --> 00:00:04,760 So this talk is going to be my story about how I started with the Yardstick One. It's 2 00:00:04,760 --> 00:00:08,520 going to be mostly a beginner's guide and I'm hoping it can help you guys a little bit, 3 00:00:08,580 --> 00:00:15,720 although that might be hard without a projector. I'm 18 years old, right out of high school. 4 00:00:18,060 --> 00:00:21,660 I pretty much knew nothing about the Yardstick One when I started. Nothing about cars, nothing 5 00:00:21,660 --> 00:00:28,520 about key fobs, nothing. So my goal was to find a summer job. I ended up working with 6 00:00:28,520 --> 00:00:35,800 CanBusHack. It was founded in 2010. They work with OEMs, suppliers, aftermarket companies 7 00:00:35,800 --> 00:00:41,440 and they reverse engineer and analyze vehicle systems. It was founded by Robert Lialli based 8 00:00:41,440 --> 00:00:48,340 in Detroit. If you're interested, you can go to their website, www.canbushack.com, and 9 00:00:48,340 --> 00:00:51,020 they're basically leading the car hacking village right now. 10 00:00:52,320 --> 00:00:57,920 So to start talking about Yardstick One and RF, you have to know about 11 00:00:57,920 --> 00:00:58,440 remote 12 00:00:58,440 --> 00:01:05,020 keyless entry systems. Basically, your key fob works by transmitting an RF code, normally 13 00:01:05,020 --> 00:01:10,280 encrypted and it normally uses rolling code, to the car. And if the car agrees with what 14 00:01:10,280 --> 00:01:16,700 it receives, then it's going to work. Otherwise, it's not going to work, obviously. And you 15 00:01:16,700 --> 00:01:23,380 have to know a little bit about RF, too. A lot of the time, it's just simple. There are 16 00:01:23,380 --> 00:01:27,380 different types of modulation that you have to know about. The simplest is probably OOKE. 17 00:01:27,460 --> 00:01:28,420 It's just on-off keying. 18 00:01:30,220 --> 00:01:38,380 It's basically binary. A high pulse represents a one, a low represents a zero. And you can 19 00:01:38,380 --> 00:01:42,860 use that to convert it to hex. You can view it with RF cat and the yardstick. 20 00:01:45,960 --> 00:01:49,780 More tools you'll need, you'll need Python and Linux, basically, because RF cat only 21 00:01:49,780 --> 00:01:55,900 supports Python scripting and it only runs in a Linux environment. So they're both pretty 22 00:01:55,900 --> 00:01:58,400 simple to learn, actually. I didn't know anything about them when I started, so I didn't know anything about them when I started. 23 00:01:58,400 --> 00:01:59,540 and now I do. 24 00:02:01,060 --> 00:02:02,720 Hardware, you're obviously going to need a computer, 25 00:02:03,440 --> 00:02:04,620 a car and key fob, 26 00:02:05,080 --> 00:02:06,840 and then it really helps 27 00:02:06,840 --> 00:02:08,960 if you have a software-defined radio or SDR, 28 00:02:09,080 --> 00:02:10,180 but that's not necessary. 29 00:02:10,180 --> 00:02:11,320 You can do it without one. 30 00:02:11,800 --> 00:02:13,220 And then a Yardstick One 31 00:02:13,220 --> 00:02:15,440 or some other RF cat-supported dongle. 32 00:02:20,460 --> 00:02:20,860 Probably. 33 00:02:22,680 --> 00:02:23,380 Yeah, cat. 34 00:02:23,440 --> 00:02:24,240 No, cat, sorry. 35 00:02:24,740 --> 00:02:25,140 Tango. 36 00:02:26,560 --> 00:02:26,960 T. 37 00:02:27,820 --> 00:02:29,180 All right, and then for software, 38 00:02:29,220 --> 00:02:31,160 you're going to need Linux to be running on your computer. 39 00:02:31,960 --> 00:02:35,160 I used GQRX for my software-defined radio, 40 00:02:35,320 --> 00:02:37,300 although you can use whatever you prefer. 41 00:02:38,020 --> 00:02:41,300 I used Audacity for WAV files, viewing them, 42 00:02:41,900 --> 00:02:44,300 and then obviously RF cat for the Yardstick. 43 00:02:44,580 --> 00:02:46,580 And for RF cat, it really helps 44 00:02:46,580 --> 00:02:48,580 if you also have IPython installed on your computer 45 00:02:48,580 --> 00:02:49,800 because it allows for tab completion 46 00:02:50,380 --> 00:02:52,640 and just other useful functions. 47 00:02:55,140 --> 00:02:56,780 So starting off with the hardware, 48 00:02:57,580 --> 00:02:59,660 RTL-SDR, it's cheap. 49 00:02:59,740 --> 00:03:01,920 You can probably get a dongle for, I think, $20 on Amazon. 50 00:03:02,340 --> 00:03:04,720 And all it really does is receive RF signals. 51 00:03:05,260 --> 00:03:06,420 It's that simple. 52 00:03:08,860 --> 00:03:11,220 You want to be using it with GQRX, 53 00:03:11,340 --> 00:03:12,540 which is your software 54 00:03:12,540 --> 00:03:15,900 that converts the RF signals 55 00:03:15,900 --> 00:03:17,980 to something that you can view, basically. 56 00:03:19,060 --> 00:03:20,820 So I have a picture of it here on the slide. 57 00:03:20,900 --> 00:03:22,220 Obviously, there's no projector here, 58 00:03:22,340 --> 00:03:24,500 but you'll be able to see all of this 59 00:03:24,500 --> 00:03:25,960 on the Car Hacking Village website, 60 00:03:25,960 --> 00:03:27,720 including the code I have. 61 00:03:30,520 --> 00:03:33,560 Basically, it's the other half of software-defined radio. 62 00:03:35,460 --> 00:03:37,200 So it allows you to demodulate 63 00:03:37,200 --> 00:03:41,520 with AM, FM frequencies, all that fun stuff. 64 00:03:41,640 --> 00:03:42,360 Modulation, sorry. 65 00:03:43,760 --> 00:03:45,560 And what you really want it for 66 00:03:45,560 --> 00:03:48,880 is it can save whatever you're transmitting 67 00:03:48,880 --> 00:03:49,760 as a WAV file, 68 00:03:50,400 --> 00:03:52,040 which you can then open in Audacity. 69 00:03:52,820 --> 00:03:54,220 And that's why you want Audacity, 70 00:03:54,280 --> 00:03:55,180 for viewing WAV files. 71 00:03:55,960 --> 00:03:57,060 When you look at it, 72 00:03:57,160 --> 00:04:01,640 it'll be just like a basic WAV function type thing. 73 00:04:03,360 --> 00:04:05,220 And what you want to use Audacity for 74 00:04:05,220 --> 00:04:06,620 is finding the baud rate normally. 75 00:04:06,720 --> 00:04:07,380 That's what I do. 76 00:04:07,880 --> 00:04:10,260 And also, it helps when you're looking 77 00:04:10,260 --> 00:04:11,720 at what modulation's being used. 78 00:04:15,720 --> 00:04:17,200 And it's also helpful 79 00:04:17,200 --> 00:04:21,360 once you actually have your Yardstick 1 working. 80 00:04:21,640 --> 00:04:23,800 It's also useful for comparing the signals 81 00:04:23,800 --> 00:04:24,620 that you're transmitting 82 00:04:24,620 --> 00:04:25,860 to the signals that you're receiving. 83 00:04:25,960 --> 00:04:27,420 And making sure that everything's working 84 00:04:27,420 --> 00:04:28,260 the way you want it to. 85 00:04:28,620 --> 00:04:29,440 All that stuff. 86 00:04:31,800 --> 00:04:33,580 Yardstick 1, it can receive signals. 87 00:04:34,220 --> 00:04:36,460 It can act as kind of an SDR in that respect. 88 00:04:37,160 --> 00:04:40,000 But it's really useful for transmitting your signals. 89 00:04:40,360 --> 00:04:41,640 And that's what I used it for. 90 00:04:41,700 --> 00:04:44,900 I've been using it to jam signals from the key fob 91 00:04:44,900 --> 00:04:46,140 and to emulate the signals. 92 00:04:46,420 --> 00:04:47,540 Basically, a roll jam attack, 93 00:04:47,760 --> 00:04:49,340 which is what I'm going to kind of go over here. 94 00:04:51,060 --> 00:04:53,840 So RFCAD is basically, to the Yardstick 1, 95 00:04:53,960 --> 00:04:55,880 what GQRX is to the SD. 96 00:04:55,960 --> 00:04:58,360 It's the software that makes the hardware work. 97 00:05:00,300 --> 00:05:01,340 IPython really helps. 98 00:05:01,520 --> 00:05:03,360 You can't do tab completion without it. 99 00:05:03,520 --> 00:05:05,080 It's a ton of other features. 100 00:05:05,180 --> 00:05:07,880 It just adds, basically, a Python scripting environment. 101 00:05:10,520 --> 00:05:14,560 What I did, my script actually only works on my car. 102 00:05:15,440 --> 00:05:17,940 I probably could have done more if I had more time with it. 103 00:05:18,020 --> 00:05:21,400 But right now, it only works on the O2 Chevy Impala. 104 00:05:23,740 --> 00:05:25,300 Basically, my key fob, 105 00:05:25,320 --> 00:05:25,840 it has pulse. 106 00:05:25,840 --> 00:05:26,320 Pulse with modulation, 107 00:05:26,820 --> 00:05:28,920 which is a special type of on-off keying 108 00:05:28,920 --> 00:05:31,500 where it bases the... 109 00:05:31,960 --> 00:05:34,700 You get a 1 with 110 transmitted 110 00:05:34,700 --> 00:05:37,280 and a 0 with 100 transmitted. 111 00:05:38,320 --> 00:05:39,820 So it's basically the same. 112 00:05:39,880 --> 00:05:40,680 It's just a little different, 113 00:05:40,740 --> 00:05:42,340 and you have to take that into account 114 00:05:42,340 --> 00:05:43,500 when you're writing your Python script. 115 00:05:45,280 --> 00:05:47,820 Half of my signal, it's key-locked encrypted. 116 00:05:48,700 --> 00:05:50,740 And then half of that signal is rolling code. 117 00:05:50,840 --> 00:05:52,080 The other half is just static. 118 00:05:52,120 --> 00:05:53,820 The serial number, what button you pressed, 119 00:05:55,340 --> 00:05:55,740 voltage, 120 00:05:55,840 --> 00:05:56,120 voltage monitor, 121 00:05:56,380 --> 00:05:57,300 all that fun stuff. 122 00:05:59,560 --> 00:06:01,540 And with all that, I guess, 123 00:06:02,780 --> 00:06:06,940 getting started actually hacking the key fob. 124 00:06:07,980 --> 00:06:09,360 So what you first want to do, 125 00:06:09,440 --> 00:06:11,320 you want to find your FCC ID on the key fob. 126 00:06:11,400 --> 00:06:12,320 It should be there somewhere. 127 00:06:12,480 --> 00:06:13,980 If it's not, you can find it online. 128 00:06:15,080 --> 00:06:18,420 But FCC requires all of the key fobs 129 00:06:18,420 --> 00:06:21,660 that can be sold to be registered. 130 00:06:24,100 --> 00:06:24,980 And basically, 131 00:06:24,980 --> 00:06:28,200 you can just type fcc.io forward slash the key fob, 132 00:06:28,320 --> 00:06:29,980 or that, sorry, the FCC ID, 133 00:06:30,960 --> 00:06:33,080 and you can find everything you need there. 134 00:06:33,220 --> 00:06:35,700 Normally, you have the frequency that it transmits at. 135 00:06:36,020 --> 00:06:37,700 Sometimes you can find the type of modulation 136 00:06:37,700 --> 00:06:38,600 that's being used. 137 00:06:40,900 --> 00:06:42,260 Baud rate is occasionally there. 138 00:06:42,360 --> 00:06:44,140 I found the schematic for my key fob, 139 00:06:44,200 --> 00:06:45,260 which was really helpful, actually, 140 00:06:45,720 --> 00:06:51,260 because that allowed me to find the documentation for the chip. 141 00:06:51,980 --> 00:06:53,560 And that was really helpful, actually, 142 00:06:53,580 --> 00:06:54,840 for figuring out what the code was, 143 00:06:54,840 --> 00:06:55,520 what it was supposed to be saying. 144 00:06:57,180 --> 00:06:58,940 So the easy part is using the SDR. 145 00:06:59,420 --> 00:07:01,660 All you have to do, you set that up in GQRX, 146 00:07:03,160 --> 00:07:04,420 find the right frequency, 147 00:07:05,140 --> 00:07:05,940 hit record, 148 00:07:06,500 --> 00:07:07,540 or choose, actually, 149 00:07:07,600 --> 00:07:09,380 choose where you want to record the file to first. 150 00:07:09,580 --> 00:07:12,380 Hit record, and it'll save it for you as a WAV file. 151 00:07:13,920 --> 00:07:16,260 And, sorry, also set it to AMD modulation. 152 00:07:17,000 --> 00:07:18,660 And then record the WAV file. 153 00:07:19,700 --> 00:07:21,360 Then you want to open in that WAV file 154 00:07:21,360 --> 00:07:23,040 that you just recorded up in Audacity. 155 00:07:23,960 --> 00:07:24,640 Mine was, 156 00:07:24,640 --> 00:07:25,600 it was Pulse Width Modulation, 157 00:07:25,700 --> 00:07:27,320 so it would look a little different from on-off keying 158 00:07:27,320 --> 00:07:28,800 or any of the other modulation types. 159 00:07:31,240 --> 00:07:33,740 But basically what you want to do is you find the baud rate, 160 00:07:33,840 --> 00:07:35,960 which is going to be the amount of bits per second. 161 00:07:37,700 --> 00:07:38,840 And you can do that. 162 00:07:38,940 --> 00:07:41,440 It has a little timer thing on, Audacity does. 163 00:07:41,620 --> 00:07:42,540 It has a little timer thing. 164 00:07:42,640 --> 00:07:45,080 And you can measure from where one bit starts to the next. 165 00:07:45,120 --> 00:07:47,980 It's just either the blip, the one or the zero, on or off. 166 00:07:48,680 --> 00:07:50,560 And you can use that to find out your baud rate, 167 00:07:50,640 --> 00:07:53,400 which you'll need for your Yardstick 1 once you start in RFCAT. 168 00:07:55,180 --> 00:07:57,540 So, the Yardstick 1 is where it gets a little bit more difficult. 169 00:07:58,560 --> 00:08:01,800 You have to set everything up, all your settings, your baud rate, 170 00:08:01,860 --> 00:08:05,300 your frequency, type of demodulation you want to be using. 171 00:08:06,860 --> 00:08:08,640 All that fun stuff, you have to be setting, 172 00:08:08,800 --> 00:08:11,240 you have to set that up before you can even receive the signal. 173 00:08:13,760 --> 00:08:16,880 It runs with Python scripts, so you can import your Python scripts, 174 00:08:17,120 --> 00:08:18,900 which is really helpful later on, 175 00:08:18,960 --> 00:08:22,160 once you actually start doing replay attacks and roll jam attacks. 176 00:08:23,740 --> 00:08:24,140 And, 177 00:08:25,220 --> 00:08:28,640 it's just the hardest part, really, is RFCAT. 178 00:08:29,260 --> 00:08:31,080 Because there's no documentation for it, 179 00:08:31,180 --> 00:08:33,000 so you kind of have to work your way through it. 180 00:08:33,080 --> 00:08:35,640 If you're interested in doing something with it, 181 00:08:35,720 --> 00:08:36,960 you have to go through the source code, 182 00:08:37,040 --> 00:08:38,160 figure out what it's trying to say, 183 00:08:38,520 --> 00:08:39,800 and then how you want to do it. 184 00:08:41,440 --> 00:08:44,140 But I guess I should probably start with the first attack that I did. 185 00:08:44,780 --> 00:08:47,260 It was just a really easy signal replication attack. 186 00:08:47,620 --> 00:08:49,940 Basically, you take your keyfob out of range of the car, 187 00:08:50,060 --> 00:08:52,160 so the car won't be able to receive the signal, 188 00:08:52,240 --> 00:08:54,320 and jump a counter on the rolling code. 189 00:08:55,220 --> 00:08:58,820 And you can use the RFCAT to record that signal. 190 00:08:59,040 --> 00:09:01,540 I could show you, but no projector, sorry. 191 00:09:02,420 --> 00:09:04,500 You can come talk to me after, too, if you want. 192 00:09:04,520 --> 00:09:05,920 I can try and show you. 193 00:09:07,240 --> 00:09:10,380 But you can record the signal that's transmitted, 194 00:09:10,520 --> 00:09:13,260 and basically just transmit it right back out. 195 00:09:14,380 --> 00:09:16,780 So that's the easiest way to do it. 196 00:09:18,020 --> 00:09:21,040 A more complicated attack is the roll jam attack. 197 00:09:22,380 --> 00:09:24,180 So the concept here, 198 00:09:25,440 --> 00:09:29,440 is when whoever you're attacking presses the button on their keyfob, 199 00:09:29,580 --> 00:09:32,320 you jam that and steal the code from it. 200 00:09:33,280 --> 00:09:34,960 And then they're confused, 201 00:09:35,080 --> 00:09:36,720 why didn't my car unlock, all that stuff, 202 00:09:36,800 --> 00:09:37,680 so they press the button again. 203 00:09:37,920 --> 00:09:40,240 And this time you transmit the first code you received, 204 00:09:40,420 --> 00:09:42,120 and take the second code. 205 00:09:42,260 --> 00:09:43,560 So now their car is unlocked, 206 00:09:43,720 --> 00:09:47,360 and you have the next code in the rolling code counter. 207 00:09:50,200 --> 00:09:53,620 So then, obviously, you can just unlock their car 208 00:09:53,620 --> 00:09:54,460 with the press of a button. 209 00:09:55,380 --> 00:09:57,560 And the hardest part of this part 210 00:09:57,560 --> 00:09:59,820 is actually the timing. 211 00:10:00,220 --> 00:10:02,060 Because the way RFCAT receives packets, 212 00:10:03,300 --> 00:10:05,100 it receives an entire packet, 213 00:10:06,060 --> 00:10:07,540 and then it can transmit. 214 00:10:07,660 --> 00:10:09,760 It can't be in receive and transmit mode simultaneously. 215 00:10:10,480 --> 00:10:11,620 It can only be in one. 216 00:10:11,840 --> 00:10:13,800 So you either have to receive the entire packet 217 00:10:13,800 --> 00:10:16,340 and then try to transmit out your jamming signal 218 00:10:16,340 --> 00:10:19,780 before it reaches the car, which is just about impossible. 219 00:10:20,700 --> 00:10:24,040 Or you have to modify RFCAT a little bit 220 00:10:24,040 --> 00:10:27,200 to get it to record only part of the code, 221 00:10:27,400 --> 00:10:31,960 or however you find that it works with your key fob. 222 00:10:32,220 --> 00:10:33,740 The way I did it with my key fob, 223 00:10:33,860 --> 00:10:35,900 the first part of the code that's transmitted 224 00:10:36,480 --> 00:10:37,960 is actually the rolling code. 225 00:10:38,600 --> 00:10:40,440 So I was able to cut it off there 226 00:10:40,860 --> 00:10:42,260 and just grab that rolling code 227 00:10:42,260 --> 00:10:44,340 and add the static code on the end. 228 00:10:44,780 --> 00:10:47,260 And there's a CRC obviously checking 229 00:10:47,260 --> 00:10:49,220 just to make sure that all of the code's right. 230 00:10:49,360 --> 00:10:51,480 But what I found with my key fob 231 00:10:51,480 --> 00:10:54,020 is that it only has four possible steps. 232 00:10:54,040 --> 00:10:57,380 So I could just kind of throw them onto the end 233 00:10:57,380 --> 00:10:59,340 and throw the code out there, 234 00:11:00,500 --> 00:11:02,200 and one of those was going to work. 235 00:11:03,920 --> 00:11:06,660 So that was basically my roll jam attack. 236 00:11:07,040 --> 00:11:09,180 It would be better if I could showcase it. 237 00:11:09,320 --> 00:11:09,540 Yes? 238 00:11:09,840 --> 00:11:14,200 So did you have to recompile the RFCAT source code? 239 00:11:14,300 --> 00:11:16,880 No, I was not recompiling the source code. 240 00:11:16,960 --> 00:11:18,960 There's a function, or not a function, 241 00:11:19,020 --> 00:11:21,640 a feature of RFCAT that lets you choose 242 00:11:21,640 --> 00:11:23,120 the length that you want your packet to be. 243 00:11:24,940 --> 00:11:27,300 And that way I was able to just say, 244 00:11:27,380 --> 00:11:28,640 hey, take half of this packet, 245 00:11:28,700 --> 00:11:29,920 because I know how long the packet is. 246 00:11:30,000 --> 00:11:31,080 It's going to be the same length every time. 247 00:11:31,160 --> 00:11:32,660 Take half of it, the first half, 248 00:11:32,860 --> 00:11:34,200 and then ignore the second half. 249 00:11:34,280 --> 00:11:34,960 Just start jamming. 250 00:11:39,320 --> 00:11:43,020 Yeah, there's a very large amount of functions, 251 00:11:43,200 --> 00:11:45,180 so you can do pretty much anything. 252 00:11:47,520 --> 00:11:51,940 Basically, since I can't show you guys anything on the slide, 253 00:11:51,940 --> 00:11:53,840 this is the end of my presentation. 254 00:11:56,520 --> 00:11:58,800 I'm going to give some credit where credit's due. 255 00:11:59,280 --> 00:12:01,780 The Hack5 team on YouTube helped me out a ton 256 00:12:01,780 --> 00:12:04,060 with their introductory videos on the Yardstick One. 257 00:12:04,640 --> 00:12:06,880 Michael Osmond obviously made the Yardstick One. 258 00:12:07,020 --> 00:12:08,500 It wouldn't be possible without him. 259 00:12:09,460 --> 00:12:11,240 Atlas of Doom for RFCAT. 260 00:12:12,800 --> 00:12:15,360 Sandy Kamkar, who actually, I believe he was at DEF CON 261 00:12:15,360 --> 00:12:16,920 a little while, a couple years ago, 262 00:12:17,100 --> 00:12:19,100 who did a talk on this exact same idea. 263 00:12:19,260 --> 00:12:20,740 He didn't do it with the Yardstick One. 264 00:12:20,740 --> 00:12:22,260 He had his own device that he made. 265 00:12:22,940 --> 00:12:25,180 But the Roll Jam Attack was all his idea. 266 00:12:26,300 --> 00:12:28,460 Andrew McPherson, I got some code ideas from him. 267 00:12:28,520 --> 00:12:30,460 I believe he has a blog, Andrew Nohawk. 268 00:12:30,880 --> 00:12:32,600 And then obviously Robert Lialli 269 00:12:32,600 --> 00:12:35,680 for hiring me for the summer and making me work. 270 00:12:36,160 --> 00:12:38,020 So if you guys want to know any more, 271 00:12:38,160 --> 00:12:39,900 I can try and help you out, 272 00:12:40,320 --> 00:12:42,760 take a look at what I have, if you want. 273 00:12:43,540 --> 00:12:43,940 Yeah. 274 00:12:45,860 --> 00:12:46,260 Yeah. 275 00:12:49,320 --> 00:12:50,720 We've got a couple minutes in here. 276 00:12:50,720 --> 00:12:51,840 I can do it, right? 277 00:12:52,020 --> 00:12:53,200 Yeah, it looks fine. 278 00:12:53,880 --> 00:12:56,640 And otherwise we can probably go back to the car hacking village 279 00:12:56,640 --> 00:12:57,780 and set up somewhere. 280 00:12:58,940 --> 00:12:59,560 All right. 281 00:12:59,580 --> 00:13:02,760 But that's it for my presentation.