1 00:00:00,000 --> 00:00:06,220 All right, so those of us in the hardware hacking village are looking at kind of covering more than 2 00:00:06,220 --> 00:00:11,680 just soldering. There's a lot of stuff that's kind of interesting in the hardware realm, and one of 3 00:00:11,680 --> 00:00:17,340 my real interests these days is looking at firmware, tearing it apart, figuring out reasons 4 00:00:17,340 --> 00:00:24,240 why things are insecure. The presentation will be up on my GitHub. I am Matt Duarte, also known 5 00:00:24,240 --> 00:00:30,940 as CryptoMonkey. You can find me around a lot of different places. Neg9, if you're up in Seattle, 6 00:00:31,200 --> 00:00:35,560 we hang around the Black Lodge quite a bit. Obviously, the standard disclaimers always apply to 7 00:00:35,560 --> 00:00:41,420 these things. This talk does not represent my employers, my dog. Pretty much anybody except my 8 00:00:41,420 --> 00:00:46,500 opinions. And what I want to talk about today are really some of the motivations of looking at 9 00:00:46,500 --> 00:00:52,040 firmware without actually running it. And that's kind of my point. If you take a hardware hacking 10 00:00:52,040 --> 00:00:54,220 course, they're going to say, oh, look, there's a series of hardware that's going to be running 11 00:00:54,220 --> 00:00:59,960 . Let's connect to it and do all that. But not all devices have serial ports. If you take, like, an 12 00:00:59,960 --> 00:01:06,200 infusion pump from inside a hospital, you won't find a lot of serial ports on it. So we're going to 13 00:01:06,200 --> 00:01:09,020 talk about that. We're going to look at the attack patterns. We're going to talk about some of the 14 00:01:09,020 --> 00:01:13,840 extraction protocols and technologies and then look at the firmware. So this is meant to be a bit of a 15 00:01:13,840 --> 00:01:18,520 beginner's talk. I'm going to cover everything from getting the stuff off the box to our basic 16 00:01:18,520 --> 00:01:24,140 analysis. Obviously, there's only so much you can talk to in an hour. But we should have a lot of fun 17 00:01:24,140 --> 00:01:29,660 on with this. So the question is, why do this talk now? Well, the thing is, this is really a lot 18 00:01:29,660 --> 00:01:35,140 simpler to do than most people think. You open the box up, you see all these chips, but it's not that 19 00:01:35,140 --> 00:01:41,160 bad. Once you get the little dongle, $40 little dongle, either a Shikra or a Bus Pirate, you can 20 00:01:41,160 --> 00:01:45,440 actually pull the firmware out and start pulling it apart, all using open source tools. 21 00:01:49,640 --> 00:01:55,720 Now, why is this important to us? Well, if one were to look at the NSA catalog, you will see some 22 00:01:55,720 --> 00:02:04,060 very interesting entries, such as persistence on laptops via the firmware. Providing security on by 23 00:02:04,060 --> 00:02:09,500 modifying the firmware. The whole point behind this is there's a lot of stuff going on here where 24 00:02:09,500 --> 00:02:14,280 people look at the firmware or they just run these systems without actually checking what's going on 25 00:02:14,280 --> 00:02:14,480 here. 26 00:02:14,620 --> 00:02:15,420 So even though we have a lot of stuff going on, we're really not really actually by the logic of 27 00:02:15,420 --> 00:02:19,820 even if you're not that concerned about the NSA spying on you, well, there's a lot of other 28 00:02:19,820 --> 00:02:25,460 problems here. Shadow IT and bring your own devices are bringing lots of these little embedded 29 00:02:25,460 --> 00:02:30,260 devices into our workplaces and we don't know what's running on them. We don't even know if 30 00:02:30,260 --> 00:02:34,520 that's the firmware that was shipped with them. We don't know if it's ever been audited. In fact, 31 00:02:34,600 --> 00:02:39,740 it probably hasn't. So maybe we should do some auditing ourselves. There's also some competitive 32 00:02:39,740 --> 00:02:45,360 analysis, too. There's also the problem of who's stealing your code. I have a case here, a pretty 33 00:02:45,360 --> 00:02:49,840 interesting one, American Superconductor versus Sonomial Wind Group. These guys make wind 34 00:02:49,840 --> 00:02:56,300 turbines, right? Well, the source code got stolen and quite bluntly, a city, I think it was in 35 00:02:57,040 --> 00:03:03,380 Michigan or something, bought a wind turbine from China and it had this American company's stolen 36 00:03:03,380 --> 00:03:08,040 firmware on it, they allege. It's still in the courts, but there's some links here when you get 37 00:03:08,040 --> 00:03:09,340 the presentation. You can follow up on it. 38 00:03:09,740 --> 00:03:13,840 So, again, if you pull the firmware, you might be able to compare it to yours and see how similar 39 00:03:13,840 --> 00:03:19,440 they are, if anybody's done it. So, definitely when you do this stuff, try to stay on the right 40 00:03:19,440 --> 00:03:24,200 side of the law. I'm not a lawyer, but I'm telling you, you can get into some real problems 41 00:03:24,200 --> 00:03:30,320 here if you suddenly say, hey, all of this device are vulnerable and you haven't contacted the 42 00:03:30,320 --> 00:03:35,820 people or gone through this stuff. So definitely keep an eye on that. Also, I see a day in which 43 00:03:35,820 --> 00:03:39,440 you got a question whether your cyber insurance policy will cover you. 44 00:03:39,740 --> 00:03:47,060 If you have a claim against you and they say, hey, are all of your devices updated, you may actually 45 00:03:47,060 --> 00:03:54,620 have to prove that you've really updated the firmware on all of your devices. The same thing, if a Tesla 46 00:03:54,620 --> 00:03:59,780 in auto drive mode crashes, they may actually question, are you up to date on the firmware before 47 00:03:59,780 --> 00:04:04,960 they pay the insurance policy? So, again, this is kind of important and we're really just getting 48 00:04:04,960 --> 00:04:09,380 started on it. But it's accessible to you now. I mean, in the past, we all had to have these 49 00:04:09,740 --> 00:04:15,380 $100, $200, $800 sniffers in order to talk to the chips, the memory chips that hold the firmware. 50 00:04:16,120 --> 00:04:21,760 Nowadays, it's a lot simpler. You can do it with these low-cost devices, lots of things you can do. 51 00:04:21,920 --> 00:04:26,540 The first were a little unreliable, but they're getting better. So when you grab a device, first 52 00:04:26,540 --> 00:04:30,400 thing you do, you look at the device. What kind of architecture? Are you doing this for somebody 53 00:04:30,400 --> 00:04:34,800 else? What architectures do they use? What kind of technologies are in there? Your customers should 54 00:04:34,800 --> 00:04:38,720 be able to tell you this. If not, little OS in, you know, Google the device, you can see what 55 00:04:38,720 --> 00:04:39,720 kinds of processors that are in there. If not, Google the device, you can see what kinds of 56 00:04:39,740 --> 00:04:43,760 things that have. But more importantly for us in extracting firmware, what type of chip does it 57 00:04:43,760 --> 00:04:49,940 have in it? Also, you have to also decide how much you want to spend. I'm talking about doing this 58 00:04:49,940 --> 00:04:55,580 on the cheap. Sure, if you have a big company and a lab, you can go buy your Deddy Prog and pull 59 00:04:55,580 --> 00:05:01,340 that stuff out. $1,200 for, you know, a hardware device is great. I'm talking more how to do it 60 00:05:01,340 --> 00:05:07,740 with a $40 device. You can spend lots and lots of money on it. You can have an insane pile of junk 61 00:05:07,740 --> 00:05:09,720 like my lab at home. But you can spend a lot of money on it. You can have an insane pile of junk 62 00:05:09,720 --> 00:05:13,640 but you don't need it. What you really need to get started on ripping open these embedded 63 00:05:13,640 --> 00:05:20,900 devices is a screwdriver, a couple jumper wires, I highly recommend a magnifying glass, and 64 00:05:20,900 --> 00:05:28,920 something like a shikra, this little $45 dongle that will speak I2C, JTAG, and SPI. In fact, the 65 00:05:28,920 --> 00:05:35,120 most valuable upgrade of all the equipment in there is by far the microscope. If you have any 66 00:05:35,120 --> 00:05:39,340 extra money, get a good microscope. If you want, we have one over in the hardware hacking village. 67 00:05:39,720 --> 00:05:44,300 You can take a look at the difference of what you can do with this. Also, if you're in business, 68 00:05:44,700 --> 00:05:50,440 make sure you buy a trinocular one. That's this extra tube right here that has a video camera on 69 00:05:50,440 --> 00:05:54,680 the top of it. It means I can make pictures and put them in the reports. Makes you look much more 70 00:05:54,680 --> 00:06:00,280 professional, less likely to get sued when you actually present this to the people. So you've done 71 00:06:00,280 --> 00:06:04,800 your information gathering. You've looked at the product lines they have out. Again, you'll often 72 00:06:04,800 --> 00:06:09,660 find similar parts in them. And there can be some odd parts that make it a little tougher. But today, I'm 73 00:06:09,720 --> 00:06:15,920 going to look at two devices. These things. Little cheap devices I bought at Fry's. Didn't even 74 00:06:15,920 --> 00:06:22,860 know what they were at first, but I looked them up. The first one, the lovely TP-Link TLPS310U is 75 00:06:23,560 --> 00:06:30,120 nothing but a, wow, that blue doesn't come through very well. It is a little print server. 76 00:06:30,500 --> 00:06:35,640 Okay? Ethernet connected to your printer. It's a print server. What I like about it, well, it 77 00:06:35,640 --> 00:06:39,700 has an Ethernet port. It has a USB port. And according to the documentation, it's got a 78 00:06:39,720 --> 00:06:42,280 TN I can have it on the computer. And again, it has a GUI. This will become important to me later 79 00:06:42,280 --> 00:06:48,960 because I like things with GUIs. The other one we'll look at is of course the lovely TLWR702 80 00:06:48,960 --> 00:06:59,080 which is just an 802.11N router. Again, Ethernet port and a GUI. Terrific. So what are the 81 00:06:59,080 --> 00:07:03,520 threats to these things. Well, you're going to put them in your environment. You're going to do lots 82 00:07:03,520 --> 00:07:06,780 of interesting things with them. They're going to be on your Ethernet inside your protected 83 00:07:06,780 --> 00:07:09,260 environment. So if somebody Trojans it, I'm going to charge them. And I'm going to pull out a 84 00:07:09,260 --> 00:07:09,700 bug from my computer. There's a bug expression. So if somebody Trojans it, I'm going to do lots of 85 00:07:09,700 --> 00:07:14,780 might want to know that. If it has a vulnerability like a built-in password, I might want to know 86 00:07:14,780 --> 00:07:20,100 that. So I want to audit it. Also, you have to consider what you're going to do when you're 87 00:07:20,100 --> 00:07:22,920 done. Are you going to report it to the manufacturer? How do you think they're going to 88 00:07:22,920 --> 00:07:28,020 react to you tearing their stuff open and pulling the firmware out, analyzing it and screaming to 89 00:07:28,020 --> 00:07:33,220 the world, hey, this has a back door. Definitely be prepared for that. What's the public good of 90 00:07:33,220 --> 00:07:37,420 your research, that sort of thing. Also, if you're a company, make sure you have a good lawyer 91 00:07:37,420 --> 00:07:42,360 and you're doing everything right because I guarantee you the DCMA security analysis exemptions 92 00:07:42,360 --> 00:07:49,380 will not protect you from being an ass. So the other question, one of the things I like to do is 93 00:07:49,380 --> 00:07:54,480 how hard is it to open the case? You saw these little plastic cases. Did these guys use security 94 00:07:54,480 --> 00:08:00,000 screws? Did they use tri-lobes like on an Apple device, right? If you had to go and get a special 95 00:08:00,000 --> 00:08:05,220 tool like this set here that's a million different security bits to open the case, they have an 96 00:08:05,220 --> 00:08:07,280 argument that they did something to protect it. 97 00:08:07,420 --> 00:08:11,940 You can't just crack it open. But, of course, in these cases, these are just little plastic 98 00:08:11,940 --> 00:08:16,380 cases with plastic latches. A monkey and a screwdriver could pry these things open in a few 99 00:08:16,380 --> 00:08:20,940 minutes. In fact, that's what I did. I gave a monkey a screwdriver and he propped them open for 100 00:08:20,940 --> 00:08:27,880 me. What I found on the inside? A board. Okay? I found chips. I want the firmware, right? I don't 101 00:08:27,880 --> 00:08:32,160 care about what the chips are. I just, what is the firmware? Where is the operating system of this 102 00:08:32,160 --> 00:08:37,400 device? So I look up the chips. The ones at the top are power. The ones at the bottom are 103 00:08:37,400 --> 00:08:41,940 chips. The little black ones there are not really chips. They're voltage regulators. But I found a 104 00:08:41,940 --> 00:08:47,520 couple of big chips. I've labeled them off. And there's a clock chip over there. So get my 105 00:08:47,520 --> 00:08:52,920 magnifying glass out or my microscope. I look at the numbers. I Google the numbers. Okay. First 106 00:08:52,920 --> 00:09:00,240 one we find. The H1631CG. It is known as a base T surface mount magnetics. Anybody think the 107 00:09:00,240 --> 00:09:05,740 firmware is in there? Show of hands. Magnetics. They're transformers used to convert the 108 00:09:05,740 --> 00:09:07,380 electricity from the Ethernet jack to the power supply. They're transformers used to convert the 109 00:09:07,400 --> 00:09:09,560 electricity from the Ethernet jack to something that will work on the board. They are not 110 00:09:09,560 --> 00:09:17,840 firmware. Okay. Let's try the other one. The E2868M4. The system on a chip with built-in USB 2 and 111 00:09:17,840 --> 00:09:24,180 Ethernet. Anybody think that has the firmware? That's the system on the chip. That's your CPU. 112 00:09:24,940 --> 00:09:34,120 Okay. Third try. The 25L8006E. An 8-bit serial CMOS flash. How many people think that has the 113 00:09:34,120 --> 00:09:37,380 firmware? Yes. Excellent. All right. Let's go to the next one. Let's go to the next one. Let's 114 00:09:37,380 --> 00:09:44,360 go to the next one. Links at the bottom are to the spec sheets that I got my pin outs from. So, in 115 00:09:44,360 --> 00:09:49,140 this diagram where you looked at it, what was missing from this diagram that all the hardware 116 00:09:49,140 --> 00:09:55,420 hacking courses will teach you? Well, if you go look at, say, a TP link of some larger router, 117 00:09:55,660 --> 00:10:02,680 this isn't a, what is it, 841N, 300 megabits router. Much bigger circuit board. But the first 118 00:10:02,680 --> 00:10:07,360 thing they're going to say is, hey, see all these little empty pins here? I want to get rid of all 119 00:10:07,380 --> 00:10:12,440 this. Look at what they do. Those are things like serial ports, JTAG adapters. Unfortunately, our 120 00:10:12,440 --> 00:10:17,720 devices don't have those. And that's the challenge with embedded software. All these guys in the 121 00:10:17,720 --> 00:10:21,240 courses will teach you, hey, find the serial port, connect to it, look, I'm on a Linux prompt. 122 00:10:22,220 --> 00:10:27,120 Unfortunately, a lot of these devices simply don't have that. Your only choice, if you want to see 123 00:10:27,120 --> 00:10:31,400 the software they're running, is to go to the firmware and pull it out. Okay? Because without 124 00:10:31,400 --> 00:10:36,600 the serial port, it's really hard to look at the running software. What's in memory? What's going 125 00:10:37,380 --> 00:10:42,120 on? Now, on an embedded device, what's in memory is actually not as important because you don't 126 00:10:42,120 --> 00:10:47,100 see a lot of persistent malware sitting in a print server, sitting in a printer because they have 127 00:10:47,100 --> 00:10:52,720 more memory, but not in print servers so much. So by doing it the way I'm proposing, pulling it 128 00:10:52,720 --> 00:10:57,400 out of the firmware, you're not getting the live running data. You're just getting the data that 129 00:10:57,400 --> 00:11:03,000 will be loaded every time you boot up. So you lose access to exploits and things like that 130 00:11:03,000 --> 00:11:07,200 that are only in memory. You just get the loaded stuff. But that's not necessarily a 131 00:11:07,200 --> 00:11:12,000 bad thing. For the simple reason that for those of us who have lived with rootkits for years, we 132 00:11:12,000 --> 00:11:17,960 understand that running systems lie. You cannot trust anything a system tells you when you log 133 00:11:17,960 --> 00:11:24,120 into it. Because if it's been Trojan or a rootkit, they hide their activity. On a simple system 134 00:11:24,120 --> 00:11:29,220 like this, it's a little harder, but the storage that's mounted on it is actually a very reliable 135 00:11:29,220 --> 00:11:33,780 place to get what's going to be at least memory when you start. Plus, there's no way for the 136 00:11:33,780 --> 00:11:37,180 running software on the device to modify your view of it. 137 00:11:37,200 --> 00:11:42,080 You're pulling it straight out of memory. We're going to audit the entire system here, not just 138 00:11:42,080 --> 00:11:49,060 what is visible from a running system. The other device is, of course, the TP-Link 702. I looked at 139 00:11:49,060 --> 00:11:55,100 it. I found the chips. I find a big memory chip up at the top there. I find another SOC, an 140 00:11:55,100 --> 00:12:01,460 atheros system on a chip. Has built-in wireless. Great. And I find the magnetics again. Oddly 141 00:12:01,460 --> 00:12:07,180 enough, there's no storage here. Well, simple enough, if you flip the board over, there's my 142 00:12:07,200 --> 00:12:13,140 little 8-pin SPI flash. Exactly what I was looking for. So, in both these cases, I found an SPI 143 00:12:13,140 --> 00:12:19,900 flash that's going to have my operating system on it. So, I've opened it. I've got my chip. Let's 144 00:12:19,900 --> 00:12:26,440 pull the stuff off. All three of the routers I've showed you have an SPI-based flash. Now, that's 145 00:12:26,440 --> 00:12:30,440 going to be where it is, where I want to get my stuff. There's three big protocols that you deal 146 00:12:30,440 --> 00:12:35,200 with here. SPI is the one we're going to do with all of these. But the three protocols you kind of 147 00:12:35,200 --> 00:12:37,180 need to know to do this stuff. I, too, said I'm going to do it. I'm going to do it. I'm going to 148 00:12:37,200 --> 00:12:42,920 see JTAG and SPI. And really, my point is that you don't need to know a lot about these 149 00:12:42,920 --> 00:12:49,160 protocols. A little bit of protocol knowledge is all that's really required here. You need to find 150 00:12:49,160 --> 00:12:55,180 the type of chip. You need to find the pins, wire them up, and that's it. You don't care about 151 00:12:55,180 --> 00:13:00,180 thermal characteristics. You're going to find 20 pages of data sheets, and all you care about is 152 00:13:00,180 --> 00:13:06,300 what signals are on what pin. That's it. You wire them up to your tool, and the tool will tell you, 153 00:13:06,340 --> 00:13:07,180 hey, if you're going to do this, you're going to do this. If you're going to do this, you're going 154 00:13:07,180 --> 00:13:10,960 to do this. If you're using a bus pirate and you want to talk SPI, I need to find these four 155 00:13:10,960 --> 00:13:16,340 signals, connect them to those pins. That's it. Use a shikra, you'll find the same thing. If it's 156 00:13:16,340 --> 00:13:22,380 SPI, it's telling me find four signals, those are four leads coming out of the chip, and attach 157 00:13:22,380 --> 00:13:27,000 them to me, and I'll take care of the rest of it for you. So quick and dirty on these three 158 00:13:27,000 --> 00:13:32,680 protocols. I2C requires two wires. I've got to find two signals in order to talk to something 159 00:13:32,680 --> 00:13:37,160 that talks I2C. There are I2C flashes. They're not as common. They're not as common as the 160 00:13:37,160 --> 00:13:41,020 common. They can run on three volts or five volts. Again, power matters when I feed it into the 161 00:13:41,020 --> 00:13:46,340 chip. And each one will have an address. Sometimes I have to tweak that a little bit. But you'll see 162 00:13:46,340 --> 00:13:52,220 that if I find an I2C chip here, this is non-volatile I2C memory, it looks the same thing. 163 00:13:52,340 --> 00:13:56,460 It's, you know, eight things coming out. I look on the data sheet. Data sheet's available here. 164 00:13:56,680 --> 00:14:03,820 And all I care about is finding power in, power out, and the two wires I'm looking for. SDA, the 165 00:14:03,820 --> 00:14:07,140 clock, or SDA is data, and SCA is data. So I'm going to look at the data sheet, and I'm going to 166 00:14:07,160 --> 00:14:12,980 yell the clock. Those two wires connected to my little bus pirate or Shikra, I now have a 167 00:14:12,980 --> 00:14:19,140 connection. I can talk to this chip. You'll find I2C in things with low-speed applications. You'll 168 00:14:19,140 --> 00:14:24,280 find it where log files sometimes, things like that. It's not the fastest protocol. Also be 169 00:14:24,280 --> 00:14:29,960 aware that while I2C in the spec can get up to about 3.4 megabits a second, things like the bus 170 00:14:29,960 --> 00:14:34,700 pirate only talk at 1 megabit a second. That means you talk to it slowly and it takes longer to 171 00:14:34,700 --> 00:14:35,440 get the data out. 172 00:14:37,160 --> 00:14:42,920 Remember, I'm looking for two wires and some power. Second protocol, this is the big one. We'll 173 00:14:42,920 --> 00:14:48,560 go over this a little bit more later, but the JTAG. JTAG is actually a set of adapters. It's a way 174 00:14:48,560 --> 00:14:53,980 of talking. But the thing you need to know about it is there's up to five wires that can make up 175 00:14:53,980 --> 00:15:01,100 JTAG. Okay? TDI, TDO, the clock, TMS, and the test reset. Something like the bus pirate is able 176 00:15:01,100 --> 00:15:06,320 to talk to three of those wires and gather data off them. That's generally enough. If not, 177 00:15:06,420 --> 00:15:07,140 something like the Shikra. 178 00:15:07,160 --> 00:15:14,020 Shikra can handle the four-wire variation. Also understand that while SPI and I2C are protocols 179 00:15:14,020 --> 00:15:20,180 that chips use to talk to each other, JTAG is actually a separate circuit that's on the die that 180 00:15:20,620 --> 00:15:25,660 can do things like debug the chip, stop it running. There's a lot you can do with it. As well 181 00:15:25,660 --> 00:15:31,180 as reading and writing the firmwares. We see this a lot in FPGAs and CPLDs. That's how they get 182 00:15:31,180 --> 00:15:37,140 the firmware onto those things. Because of the added cost of it, it's really nice to be able to 183 00:15:37,140 --> 00:15:42,420 debug the chip. It's normally only on things that require you to add in debugging capability. 184 00:15:42,960 --> 00:15:46,920 So you'll notice that none of the devices we're looking at have that sort of capability. They 185 00:15:46,920 --> 00:15:51,860 don't need it. The system-on-a-chips are debugged a slightly different way for those. There's 186 00:15:51,860 --> 00:15:57,140 also a real variety of JTAG devices that can appear on a network. You'll find, like, a memory 187 00:15:57,140 --> 00:16:00,880 chip. I'll show you a picture later, but you'll see, like, here's a memory chip, here's a system-on-a-chip. 188 00:16:01,140 --> 00:16:05,200 All of those things can be on there, and you'll step through them deciding which one you actually 189 00:16:05,200 --> 00:16:05,860 want to talk to. 190 00:16:06,140 --> 00:16:07,120 That's different than I2C. 191 00:16:07,140 --> 00:16:13,000 I2C where everything has an address or SPI where everything is going to have either an enable or 192 00:16:13,000 --> 00:16:17,940 disable. But, again, what do I need to know? What do you need to know about JTAG? Find the wires, 193 00:16:18,080 --> 00:16:24,240 connect up to them. Last one you need to know, SPI. This is the one that all of our examples are 194 00:16:24,240 --> 00:16:31,820 going to look at. So four wires I need. A clock again. Master in, slave out. MAZI, master input, 195 00:16:31,940 --> 00:16:37,060 slave out. MISO and the slave select is just the one that says you're the active chip. So 196 00:16:37,140 --> 00:16:42,160 again, I'm going to find the four wires. Both the shicker and the bus pirate will support SPI. It's 197 00:16:42,160 --> 00:16:46,720 faster than I2C. It actually requires less power, which is why you often see it in these embedded 198 00:16:46,720 --> 00:16:51,500 devices, right? They're limited by the amount of power they can do. All the TP-Link devices that 199 00:16:51,500 --> 00:16:56,140 I've looked at here, and I'm not picking on TP-Link, they were just what was cheap at Fry's, use 200 00:16:56,140 --> 00:17:03,420 these SPI chips. So that's really all you need to know about them. I mean, you can go read 201 00:17:03,420 --> 00:17:08,500 Wikipedia. There's pages and pages. There's tons of specs. But from the point of view of pulling 202 00:17:08,500 --> 00:17:13,560 firmware, we don't care. It's already on the board. We're not an electrical engineer. All I need to 203 00:17:13,560 --> 00:17:19,400 do is connect to it and get the data off it. So if I can find those signals, that's all I need. I 204 00:17:19,400 --> 00:17:24,680 don't need anything else off of these things. You can dig into it deeper. But from an auditing point 205 00:17:24,680 --> 00:17:31,320 of view, I just need to know how to connect to it. And for that, I get a hardware adapter. So 206 00:17:31,320 --> 00:17:33,400 we're looking at two hardware adapters. We're looking at two hardware adapters. We're looking at 207 00:17:33,400 --> 00:17:37,620 the bus pirate and the shikra. They're the most common ones that are used at the entry level. 208 00:17:38,060 --> 00:17:43,180 There's the bus pirate. You have a V4 on the left and a V3. They both do basically the same thing. 209 00:17:43,380 --> 00:17:47,340 But what's key about this is there's a USB port on the bottom. You connect that to your 210 00:17:47,340 --> 00:17:52,680 computer. And all the pins at the top are what we're going to wire to the chip. Then I have the 211 00:17:52,680 --> 00:17:58,660 ability of my laptop to talk to these chips. These adapters have made it possible now for me to 212 00:17:58,660 --> 00:18:02,840 talk to any one of those protocols we've talked and even more. There have been multiple 213 00:18:02,840 --> 00:18:03,380 generations of these adapters. They've made it possible now for me to talk to any one of those 214 00:18:03,400 --> 00:18:03,940 protocols. There have been multiple generations of these adapters. They've made it possible now for 215 00:18:03,940 --> 00:18:08,220 The accommodations are designed. They've gotten a lot more stable. But that access via the 216 00:18:08,220 --> 00:18:12,620 serial port is what we really are after. You can use something like a bus pirate to send 217 00:18:12,620 --> 00:18:19,180 individual commands to the actual chip. Things like read this byte, write this byte, play 218 00:18:19,180 --> 00:18:27,820 around with it that way. So again, here's my cheat sheet on the bus pirate. I look for these 219 00:18:28,620 --> 00:18:33,380 pins labeled on the left, mozzy, clock, peso. And then to talk spy I just find the 220 00:18:33,400 --> 00:18:39,300 ones on the chip, I wire the two of them together. Once I've done that, I connect the Bus Pirate to 221 00:18:39,300 --> 00:18:44,280 the laptop. I literally just connect to it as a serial port. I plug the USB in and say, hey, 222 00:18:44,340 --> 00:18:49,440 you have a new serial port. Go with Minicom or Screen or something like that. You connect to it 223 00:18:49,440 --> 00:18:53,600 and it says, hey, what do you want to do? And it has just a little operating system. I say, 224 00:18:53,660 --> 00:18:58,500 tell me what modes you can be in. And it lists all the different languages those pins can speak. 225 00:18:58,500 --> 00:19:04,120 The one we care about is number five, Spy. And with this, you walk through a menu system and you 226 00:19:04,120 --> 00:19:08,000 set the parameters. How fast do you want it to run? Well, we go look on the spec sheet and say 227 00:19:08,000 --> 00:19:16,060 how fast it will talk. Although they auto set pretty well. And you can get Bus Pirates all over 228 00:19:16,060 --> 00:19:20,900 the place. So price point here, at the time, these are about 40 bucks a piece. Definitely 229 00:19:20,900 --> 00:19:26,020 within the hobbyist realm for you to go grab one of these. And I've given a few companies that I 230 00:19:26,020 --> 00:19:27,500 know sell them that are reliable. 231 00:19:29,000 --> 00:19:34,020 The Bus Pirate was a little slow at things. The next gen is this one called the Shikra. 232 00:19:34,600 --> 00:19:41,040 Most of us are using this these days. It doesn't handle quite as many protocols as the Bus Pirate, 233 00:19:41,120 --> 00:19:47,560 but it's a lot faster. It has a newer generation of chips. It's very stable. Documentation and 234 00:19:47,560 --> 00:19:51,980 examples, not quite as many of them out there because it hasn't been out as long. And also, 235 00:19:52,060 --> 00:19:57,240 you'll find that this one, you won't connect to it and interact with it as much. It's a little 236 00:19:57,240 --> 00:19:58,380 bit more of an... 237 00:19:58,500 --> 00:20:04,060 interface that you'll use other programs to connect to it and pull it through. But you'll see 238 00:20:04,060 --> 00:20:08,880 the same sort of thing. It's a USB port you plug in and then you pick what protocol you want and 239 00:20:08,880 --> 00:20:15,400 just match the pins up. So pin one for our spy connected to the clock. Find the SDI, put it on 240 00:20:15,400 --> 00:20:22,040 two, chip select, and the ground. Again, they're available online, about 45 bucks. So again, 241 00:20:22,140 --> 00:20:26,480 something in the hobbyist realm definitely you can get at. So now I've been talking about 242 00:20:26,480 --> 00:20:27,540 connecting to the chip. 243 00:20:28,600 --> 00:20:33,360 We've got our little dongle here. Now we just need to connect the two of them. So once we have that, 244 00:20:33,460 --> 00:20:39,520 this is actually the most painful part of this entire process I will talk about. Everything else is 245 00:20:39,520 --> 00:20:44,680 actually dead simple. You Google it, you open the thing up, really simple. Connecting to the chip, 246 00:20:44,820 --> 00:20:50,160 this is where all your headaches come from. And it's mainly because most people start off with a 247 00:20:50,160 --> 00:20:55,600 test clip lead. It's a little thing that when you push it back, little hooks come out. You can attach 248 00:20:55,600 --> 00:20:56,460 that to the leads. 249 00:20:56,460 --> 00:21:04,240 And oh, that's a pain. So I go back, I look at the chips, here are the two memory chips we've dealt with. I said 250 00:21:04,240 --> 00:21:10,520 they're both spy. They're both eight pins. What do I need to find? Well, there's my chip select, there's my 251 00:21:10,520 --> 00:21:16,720 SI, there's my SO, there's my clock. Those are the ones I need to connect to. The other chip, you'll see 252 00:21:16,720 --> 00:21:23,260 they have has a similar layout. So the two memory chips, both eight-pin spy. I need to get those signals 253 00:21:23,260 --> 00:21:26,440 into my bus pirate of my Shikra. Simple as that. 254 00:21:26,460 --> 00:21:55,300 So I take my little clips out, I begin connecting the clips, and that's what it looks like. Now, these are fairly large clips. You can buy smaller ones. They are more expensive. They still fall off all the time. This is a horrible way to do this, but it'll get you a connection. So at the end of each one of these clips, I then connect that to my adapter, and I've got what I need. So they also can do things like short out pins if you use too large a clip. 255 00:21:56,460 --> 00:22:26,440 These are actually, the chips that we're looking at in that picture, are actually physically have pretty large leads to connect to. When you get into finer chips, you can't really get the clips in there as well. So if you can invest about 30 bucks more, one of these is a godsend. This is just a clip that goes on top of the chip that allows you to get the wires out, and this one has a few leads soldered to it. It saves you an awful lot of time and trouble because you just take the chip, clip it right on there, and it touches all the leads, pulls all the signals out, and you're good to go. 256 00:22:26,460 --> 00:22:37,520 It makes it very easy to connect. It just gets on all the legs at once. But again, for the beginner, that's 30 bucks for a clip like this, and you have to buy a clip for each kind of chip size. 257 00:22:40,120 --> 00:22:51,260 The last thing we need before we actually start downloading the firmware is power. I've talked about wiring up all of these signals, but the other thing that you need is the chip has to have power. 258 00:22:51,560 --> 00:22:56,100 You have two ways of doing this. Either you turn the device on and let it power the device up. 259 00:22:56,460 --> 00:23:02,620 Or you're going to have to connect power from your, say, bus pirate, and what it needs is a power in and a ground. 260 00:23:03,000 --> 00:23:11,780 It's really important that both the device and your adapter share the same ground because what we're doing is we're reading the signals of all these pins. 261 00:23:11,940 --> 00:23:17,000 They need to have a common zero point. So it's very important to get that ground also connected. 262 00:23:19,920 --> 00:23:23,460 Basically, I just power the stuff on most of the time. It's easier. 263 00:23:23,660 --> 00:23:26,440 But if you want to make sure it never boots, then you need to have a power in and a ground. 264 00:23:26,460 --> 00:23:27,460 And then you need to come up with an external power. 265 00:23:29,920 --> 00:23:31,780 When you're all done, that's what it looks like. 266 00:23:32,440 --> 00:23:36,260 You've got a clip on the chip. I take my wires. I wire them in the right spot of the shikra. 267 00:23:36,400 --> 00:23:40,000 I'm all ready to plug the shikra into my laptop. 268 00:23:41,100 --> 00:23:44,820 And I hate to break it to you because it's pretty anticlimactic after this. 269 00:23:46,660 --> 00:23:53,740 Really, once the devices are in there, the two devices we have when used directly are good for doing one read, one write. 270 00:23:54,160 --> 00:23:55,620 Bit banging is what we call it. 271 00:23:55,620 --> 00:23:59,520 You access one byte of data at a time. Sure, you can loop it, but it can be a little messy. 272 00:24:00,220 --> 00:24:09,180 But since both these devices are easily accessible via this serial port, USB serial, but this serial port, other things can talk to it. 273 00:24:09,280 --> 00:24:12,640 So people have written tons of helper programs to help you out here. 274 00:24:12,980 --> 00:24:17,280 So this is where we are. We've got our device. It's powered up. We've got everything wired up. 275 00:24:17,680 --> 00:24:20,620 We're all connected. Let's use a helper program here. 276 00:24:21,360 --> 00:24:24,960 For pulling a spy, there's a really nice program called FlashROM. 277 00:24:24,960 --> 00:24:28,800 It's on most Linux distros, and there's the link to it if you need to install it. 278 00:24:29,560 --> 00:24:32,680 Once it's wired up, you literally just type a very simple command. 279 00:24:33,020 --> 00:24:38,100 FlashROM, you say the type of adapter you're using, and then R is what I want to dump out. 280 00:24:38,260 --> 00:24:43,160 So I've just told this FlashROM program to go use my adapter that's been wired up, 281 00:24:43,180 --> 00:24:45,320 and if it's wired up right, it'll actually go and say, 282 00:24:45,440 --> 00:24:48,720 Hey Chip, I want your config. Read it all out. 283 00:24:48,820 --> 00:24:50,360 What you end up with is an image. 284 00:24:51,320 --> 00:24:53,540 The same thing. If you had wired up JTAG, 285 00:24:53,540 --> 00:24:56,020 you're going to use a system called OpenOCD. 286 00:24:56,260 --> 00:24:59,180 Again, it's free. You can download it. There's the link. 287 00:24:59,340 --> 00:25:01,040 We'll talk about JTAG a little more later. 288 00:25:01,320 --> 00:25:04,240 But really, it takes a little bit more configuration 289 00:25:04,240 --> 00:25:06,000 because it's a slightly more complicated protocol. 290 00:25:06,480 --> 00:25:10,920 But if you want to use the Shikra, you see the blank there when you get the presentation, 291 00:25:11,540 --> 00:25:15,740 you can just Google it. There's a whole config of what you need to do to use OpenOCD here. 292 00:25:15,960 --> 00:25:18,280 You might have to specify a little info about the chip. 293 00:25:18,480 --> 00:25:22,140 What it is, how big it is, that sort of thing. Speeds. 294 00:25:22,140 --> 00:25:28,480 But again, once you have that, you literally just type OpenOCD-F, the config file, 295 00:25:29,560 --> 00:25:34,600 connect now telnet to 4444, and now you're in this little interactive prompt. 296 00:25:34,940 --> 00:25:37,560 And there's a command there literally just called dump image. 297 00:25:38,320 --> 00:25:41,680 Once you do that, you give it a file name, and it takes the whole image off of the chip 298 00:25:41,680 --> 00:25:44,660 and puts it on your laptop. You're done. 299 00:25:45,540 --> 00:25:48,320 You can also read it. You can write this way, too. 300 00:25:48,500 --> 00:25:50,020 You can pull some of the memory and all that. 301 00:25:50,360 --> 00:25:52,120 Really, all I want to do is just pull the whole chip. 302 00:25:52,140 --> 00:25:55,160 I want the full image, everything that's in the flash. 303 00:25:57,500 --> 00:25:59,260 Really, it's that simple. 304 00:26:00,460 --> 00:26:03,320 There are exceptions. There are harder things to get at. 305 00:26:03,500 --> 00:26:06,480 But basically, crack the thing open, find the right chip, 306 00:26:07,160 --> 00:26:09,740 connect your leads up with your $40 adapter, 307 00:26:10,260 --> 00:26:12,000 run some Linux software, and you're done. 308 00:26:12,180 --> 00:26:15,060 You now have this entire flash on your laptop. 309 00:26:16,560 --> 00:26:18,460 That's it. Simple, right? 310 00:26:19,620 --> 00:26:20,100 Yeah. 311 00:26:20,100 --> 00:26:22,300 Well, it's not always that easy. 312 00:26:23,740 --> 00:26:28,120 One, the memory I showed you had some fairly large leads for you to work with. 313 00:26:29,320 --> 00:26:32,160 Go check out some of the devices that are in the IoT village 314 00:26:32,160 --> 00:26:34,540 if you want to see really, really small leads. 315 00:26:35,240 --> 00:26:40,320 So if you have a small form factor chip, that gets a little more challenging. 316 00:26:40,680 --> 00:26:43,900 Those clips don't come in really tiny. 317 00:26:44,980 --> 00:26:47,640 In that case, you take out your microscope, 318 00:26:47,640 --> 00:26:51,160 and you start soldering tiny little wires onto each one of them. 319 00:26:51,640 --> 00:26:53,420 Sometimes you'll pull a connection out, 320 00:26:53,500 --> 00:26:56,300 but make sure all your connections are the same length. 321 00:26:56,720 --> 00:27:00,200 Doesn't matter. As long as they're under about 4 to 6 inches, you're fine. 322 00:27:00,400 --> 00:27:03,140 But no matter what, always, wherever you connect it, 323 00:27:03,160 --> 00:27:05,500 try to make sure the connections are roughly the same length. 324 00:27:07,060 --> 00:27:10,540 This is why I say that Microsoft is the best thing in the world, 325 00:27:10,620 --> 00:27:12,300 because when you're soldering really fine wires, 326 00:27:12,840 --> 00:27:15,000 that's a much easier way to do it. 327 00:27:15,000 --> 00:27:17,640 The other choice is to just desolder the chip. 328 00:27:17,800 --> 00:27:21,000 You go get some ChipQuick, hot air gun, you pull the chip off. 329 00:27:21,300 --> 00:27:23,220 You got to be careful when you heat them. 330 00:27:23,380 --> 00:27:25,940 Sometimes the flash gets messed up. 331 00:27:26,140 --> 00:27:28,060 But once you get the chip off and cleaned up, 332 00:27:29,720 --> 00:27:31,440 then you can buy sockets for it. 333 00:27:32,440 --> 00:27:34,360 This is just a very nice little board, 334 00:27:34,460 --> 00:27:36,240 but all you do is you press down on this. 335 00:27:36,500 --> 00:27:38,020 You can kind of see them there. 336 00:27:38,080 --> 00:27:39,760 The little legs will draw back. 337 00:27:39,920 --> 00:27:40,780 You put the chip in. 338 00:27:40,840 --> 00:27:42,300 When you let go, the legs will come down. 339 00:27:42,640 --> 00:27:44,520 Instant contact down to the connector. 340 00:27:45,620 --> 00:27:48,320 The trick is now you need one of these sockets 341 00:27:48,320 --> 00:27:51,440 for every single form factor of the chip. 342 00:27:51,800 --> 00:27:54,260 Notice here, these are both SCIOC 8s, 343 00:27:54,280 --> 00:27:57,440 but they're two different sizes, 150 mil, 200 mil. 344 00:27:57,620 --> 00:27:59,360 So as you work with more and more of the chips, 345 00:27:59,520 --> 00:28:01,920 you get more and more of these sockets. 346 00:28:02,520 --> 00:28:04,520 Boy, do you end up with a lot of these sockets. 347 00:28:04,660 --> 00:28:06,280 And at 40, 50 bucks a piece, 348 00:28:07,320 --> 00:28:09,500 this takes a little bit to build up time. 349 00:28:09,680 --> 00:28:11,440 But most of the major chips, 350 00:28:11,540 --> 00:28:14,180 these actually are generally for programming the chip 351 00:28:14,180 --> 00:28:14,860 before you put it on. 352 00:28:15,000 --> 00:28:16,860 But there's no reason you can't use them to pull it off. 353 00:28:17,140 --> 00:28:19,620 On the underside of these are pins you can connect to 354 00:28:19,620 --> 00:28:20,600 or put in a breadboard 355 00:28:20,600 --> 00:28:22,980 or attach to a Daddy Prog or something. 356 00:28:23,740 --> 00:28:25,120 This is a little more extreme. 357 00:28:25,280 --> 00:28:26,940 But when you get to those very fine chips, 358 00:28:27,800 --> 00:28:29,880 this is the way you end up having to do it. 359 00:28:31,820 --> 00:28:33,000 So what do we do now? 360 00:28:33,460 --> 00:28:34,540 We've got a firmware. 361 00:28:34,660 --> 00:28:35,300 It's on my laptop. 362 00:28:37,440 --> 00:28:38,360 I pulled it. 363 00:28:38,420 --> 00:28:39,100 I've opened the case. 364 00:28:39,160 --> 00:28:39,640 I've got everything. 365 00:28:39,820 --> 00:28:40,980 I go look on my laptop. 366 00:28:41,140 --> 00:28:42,440 There's my SPI dump bin. 367 00:28:42,840 --> 00:28:44,500 I see that it's four megs. 368 00:28:44,500 --> 00:28:46,440 And it's data. 369 00:28:47,880 --> 00:28:48,320 Data. 370 00:28:48,380 --> 00:28:49,600 Oh, I was hoping for, like, 371 00:28:49,600 --> 00:28:51,160 something I would know what it was. 372 00:28:51,700 --> 00:28:55,080 Remember, this is the equivalent of just imaging your hard drive. 373 00:28:55,900 --> 00:28:57,120 There's an operating system. 374 00:28:57,300 --> 00:28:57,900 There's layouts. 375 00:28:58,060 --> 00:28:59,320 There's all sorts of stuff there. 376 00:29:00,100 --> 00:29:02,020 So now you have to carve this up. 377 00:29:03,200 --> 00:29:05,660 Well, most of the forensics tools you're used to 378 00:29:05,660 --> 00:29:08,160 from the disk drive world kind of can work, 379 00:29:08,220 --> 00:29:09,140 but they're not that great. 380 00:29:09,580 --> 00:29:12,140 Thankfully, somebody already solved this problem too. 381 00:29:13,700 --> 00:29:14,140 Binwalk. 382 00:29:14,500 --> 00:29:15,800 Again, on Linux. 383 00:29:16,200 --> 00:29:16,840 It's free. 384 00:29:17,040 --> 00:29:17,640 It's easy. 385 00:29:18,180 --> 00:29:19,460 It does everything you need. 386 00:29:19,660 --> 00:29:23,720 Binwalk is a firmware analysis tool designed for reverse engineering. 387 00:29:24,180 --> 00:29:27,060 It does all sorts of cool stuff, and you just run it. 388 00:29:27,460 --> 00:29:29,380 So what happens when I take Binwalk 389 00:29:29,380 --> 00:29:31,520 and I run it against this image that I downloaded? 390 00:29:32,540 --> 00:29:35,400 Well, it says, hey, there's my Binwalk. 391 00:29:35,660 --> 00:29:37,020 Extract everything out of that. 392 00:29:37,120 --> 00:29:41,280 And it says, hey, at this offset, I found a U-boot version string. 393 00:29:41,420 --> 00:29:43,180 At this offset, I found an image header. 394 00:29:43,180 --> 00:29:46,300 At this one, I found an LZMA compressed dictionary. 395 00:29:47,140 --> 00:29:48,720 Got some firmware in here. 396 00:29:49,040 --> 00:29:51,220 It tells you all the things that it found in there. 397 00:29:51,280 --> 00:29:53,700 This is the equivalent of finding all the files, right? 398 00:29:54,140 --> 00:29:57,260 Well, since I said minus E, it also was kind enough 399 00:29:57,260 --> 00:29:59,940 to extract every one of those files for me. 400 00:30:00,480 --> 00:30:03,200 By the way, as an aside, if you're a CTF player, 401 00:30:03,380 --> 00:30:05,920 this is a really good way to pull images out of 402 00:30:05,920 --> 00:30:08,260 or anything out of the stuff they give you. 403 00:30:09,260 --> 00:30:11,700 But here I now have a file system 404 00:30:11,700 --> 00:30:14,180 that tells me everything I need to know, 405 00:30:14,260 --> 00:30:15,380 and including right up there. 406 00:30:15,460 --> 00:30:17,300 The Squash FS is the one I'm looking for. 407 00:30:17,380 --> 00:30:19,160 That's most likely my operating system. 408 00:30:19,620 --> 00:30:21,720 Oddly enough, it was very kind to me. 409 00:30:21,780 --> 00:30:23,140 It already unpacked it for me. 410 00:30:24,420 --> 00:30:27,680 So in addition, that one step where I said extract everything, 411 00:30:27,940 --> 00:30:31,320 it found the file system, gave me the image for the file system, 412 00:30:31,460 --> 00:30:33,520 but it also took the time to unpack it for me. 413 00:30:33,660 --> 00:30:35,580 And when I look inside that directory, 414 00:30:36,880 --> 00:30:38,200 does this look familiar to anybody? 415 00:30:39,780 --> 00:30:41,680 Does anybody not know what to do? 416 00:30:41,700 --> 00:30:43,860 What do you do at this point for beginning to audit your firmware? 417 00:30:45,500 --> 00:30:46,160 It's Linux. 418 00:30:47,160 --> 00:30:47,560 Okay. 419 00:30:48,080 --> 00:30:50,980 Remember at the beginning I said I like it when I see a GUI? 420 00:30:51,840 --> 00:30:53,140 Well, if it's got a GUI, 421 00:30:53,180 --> 00:30:55,800 it most likely is some little real-time operating system. 422 00:30:56,100 --> 00:30:57,880 If it's just straight embedded firmware 423 00:30:57,880 --> 00:30:59,520 that you have to go into IDA Pro with, 424 00:30:59,720 --> 00:31:00,760 that's a little bit of pain. 425 00:31:00,940 --> 00:31:02,060 But this I recognize. 426 00:31:02,380 --> 00:31:04,420 From a software world, this is a piece of cake. 427 00:31:04,680 --> 00:31:06,180 And it extracted everything down. 428 00:31:06,320 --> 00:31:09,060 So I want to know if the GUI's been backdoored. 429 00:31:09,100 --> 00:31:09,640 Where do I go? 430 00:31:09,640 --> 00:31:13,480 What directory is the GUI in? 431 00:31:14,700 --> 00:31:15,320 It's a website? 432 00:31:16,740 --> 00:31:17,760 VAR, dub, dub, dub. 433 00:31:17,840 --> 00:31:19,460 Or in this case, just straight dub, dub, dub. 434 00:31:20,200 --> 00:31:22,220 And sure enough, there's the HTML pages. 435 00:31:22,740 --> 00:31:25,380 I now can begin auditing it like I'm a software guy. 436 00:31:27,340 --> 00:31:27,840 That's it. 437 00:31:27,940 --> 00:31:29,820 The whole OS is now available for auditing. 438 00:31:30,300 --> 00:31:32,300 We never powered the box up, right? 439 00:31:32,740 --> 00:31:34,540 We never knew the root password. 440 00:31:36,160 --> 00:31:37,060 Didn't matter to me. 441 00:31:37,120 --> 00:31:38,560 I just pulled the whole firmware off. 442 00:31:38,560 --> 00:31:42,000 And software auditing is, we're root. 443 00:31:42,160 --> 00:31:44,580 We have everything on there to do whatever we want. 444 00:31:45,260 --> 00:31:48,360 All with a $50 adapter and some free software on a Linux laptop. 445 00:31:49,480 --> 00:31:51,520 This is a great time to do this stuff. 446 00:31:51,740 --> 00:31:54,520 I remember, you know, like I said, $800, $1,200 programmers. 447 00:31:55,140 --> 00:31:56,480 Nah, $40 dongle. 448 00:31:56,560 --> 00:31:57,280 You're ready to go. 449 00:31:57,640 --> 00:31:58,920 And anybody can do this. 450 00:31:59,980 --> 00:32:01,660 So getting back to my GUI comment, 451 00:32:01,820 --> 00:32:04,940 I like GUIs because most likely it has an operating system. 452 00:32:05,380 --> 00:32:07,900 If it's not, say you're on an infusion pump 453 00:32:07,900 --> 00:32:11,860 or something like that where it's just straight playing around with it, 454 00:32:11,900 --> 00:32:13,780 you'll get out an image that's executable. 455 00:32:14,300 --> 00:32:15,940 You always have strings, right? 456 00:32:16,640 --> 00:32:20,080 IDA Pro is probably your most useful tool 457 00:32:20,080 --> 00:32:24,380 because it talks a million different chipsets, 458 00:32:24,520 --> 00:32:26,900 all the different CPUs. 459 00:32:27,520 --> 00:32:28,580 It has them all built in. 460 00:32:28,760 --> 00:32:31,720 If not, Binary Ninja will do a lot of them. 461 00:32:31,800 --> 00:32:32,580 That's the new one. 462 00:32:33,420 --> 00:32:37,620 Vivisect, which is an old one from Kinshota guys. 463 00:32:37,620 --> 00:32:39,900 And Visigoth and Kinshota wrote it for CTF stuff. 464 00:32:40,080 --> 00:32:41,640 Radari, which I misspelled. 465 00:32:42,100 --> 00:32:45,320 All of these things, as long as you can match up the CPU architecture, 466 00:32:45,660 --> 00:32:47,500 you can begin pulling a firmware apart. 467 00:32:48,480 --> 00:32:50,220 Sometimes they're not as easy as, 468 00:32:50,240 --> 00:32:53,040 it's a Linux box, but hey, it's something you work with. 469 00:32:55,200 --> 00:32:57,500 So obviously you need to close the stuff up. 470 00:32:58,140 --> 00:33:00,140 Hardware can be a funny thing to report. 471 00:33:00,420 --> 00:33:03,520 Just be very careful talking to the hardware people. 472 00:33:03,700 --> 00:33:06,200 They get really upset when you do this, 473 00:33:06,900 --> 00:33:09,400 especially as it's really simple. 474 00:33:09,560 --> 00:33:12,920 And when you start finding flaws, what are they going to do? 475 00:33:13,000 --> 00:33:16,100 Recall all the little print servers and update them all? 476 00:33:16,440 --> 00:33:19,120 So you report a hole and make it public, 477 00:33:19,280 --> 00:33:21,680 it's going to be out there a really long time. 478 00:33:22,020 --> 00:33:25,360 There's not a lot of software pushes for these little embedded devices. 479 00:33:26,120 --> 00:33:27,580 And they're very dangerous. 480 00:33:27,780 --> 00:33:30,640 And if you go anywhere near an industrial or medical device, 481 00:33:30,940 --> 00:33:32,400 be especially careful. 482 00:33:32,900 --> 00:33:35,980 This is where I get back to that whole thing about taking really good pictures 483 00:33:36,200 --> 00:33:37,900 and writing a nice report when you report it to them. 484 00:33:38,060 --> 00:33:39,700 The more professional you look there, 485 00:33:39,820 --> 00:33:42,440 the less problems you will have with them in my experience. 486 00:33:43,920 --> 00:33:45,860 So this all looked pretty simple, I think. 487 00:33:45,960 --> 00:33:47,820 We bought our device at Fry's. 488 00:33:47,920 --> 00:33:49,940 We pulled it apart. We had a great time. 489 00:33:50,040 --> 00:33:51,080 We didn't electrocute ourselves. 490 00:33:51,860 --> 00:33:52,900 This is a bonus, right? 491 00:33:55,120 --> 00:33:56,340 So we've audited it. 492 00:33:56,500 --> 00:33:58,260 We find holes. We do all this thing. 493 00:33:58,780 --> 00:34:01,440 But at the beginning, I told you I wasn't really all that worried 494 00:34:01,440 --> 00:34:02,780 about that aspect of it. 495 00:34:03,180 --> 00:34:04,760 What else can you do at this point? 496 00:34:04,760 --> 00:34:08,720 Well, Linux has all the Squash FS tools. 497 00:34:09,180 --> 00:34:12,700 There's absolutely no reason I can't just take what I unpacked 498 00:34:12,700 --> 00:34:14,960 and put my own back door in it, 499 00:34:16,080 --> 00:34:17,960 put it back in the device, 500 00:34:18,220 --> 00:34:23,080 because we know that Binwalk gave us the exact layout of the image that we needed. 501 00:34:23,480 --> 00:34:26,360 It's really not that hard to create a new image to put on there. 502 00:34:26,580 --> 00:34:30,320 And, oh, it turns out Flash ROM is just as easy at writing 503 00:34:32,060 --> 00:34:33,040 that it does read. 504 00:34:33,040 --> 00:34:35,340 Now I have a new Flash on it. 505 00:34:35,420 --> 00:34:37,820 I put my clip on. I put the Flash back in. 506 00:34:38,040 --> 00:34:39,460 Now you have a Trojan device. 507 00:34:41,680 --> 00:34:42,760 Connect it to any network. 508 00:34:42,920 --> 00:34:44,740 You control now what it does. 509 00:34:45,400 --> 00:34:47,720 You're a pen tester. You now have a back door in. 510 00:34:48,540 --> 00:34:50,900 Notice I said pen tester, not malicious actor. 511 00:34:52,460 --> 00:34:54,560 But it's not that hard to see how this goes. 512 00:34:55,060 --> 00:34:57,080 And we're really right back to the whole auditing question 513 00:34:57,080 --> 00:34:59,580 because you modify it. 514 00:34:59,620 --> 00:35:00,920 You put the firmware back on it. 515 00:35:01,540 --> 00:35:02,500 Who's going to audit it? 516 00:35:02,500 --> 00:35:04,360 And you get back to the question of, 517 00:35:04,460 --> 00:35:06,460 I can see this coming in the near future 518 00:35:06,460 --> 00:35:08,720 where it's going to start showing up in courts 519 00:35:08,720 --> 00:35:09,340 and they're going to say, 520 00:35:09,440 --> 00:35:12,600 can you prove that the firmware has not been modified? 521 00:35:12,720 --> 00:35:14,680 That this is the firmware that was shipped 522 00:35:14,680 --> 00:35:15,980 and that it's the latest firmware. 523 00:35:16,780 --> 00:35:19,040 More of these IoT devices get out there. 524 00:35:19,100 --> 00:35:20,260 More of these embedded systems. 525 00:35:20,680 --> 00:35:22,320 More of these self-driving cars. 526 00:35:23,280 --> 00:35:26,680 All this stuff's going to end up with the insurance industry and legal stuff. 527 00:35:28,480 --> 00:35:30,920 So, hope that was interesting. 528 00:35:30,920 --> 00:35:31,120 Anything? 529 00:35:32,920 --> 00:35:33,640 Any questions? 530 00:35:33,960 --> 00:35:35,340 I got about 15 minutes. 531 00:35:35,620 --> 00:35:39,440 I do have all the devices that if you just kind of want to meet me off to the side, 532 00:35:39,560 --> 00:35:41,800 you can take a look at them, get a close look. 533 00:35:41,880 --> 00:35:43,760 You can see how big things really are. 534 00:35:44,380 --> 00:35:46,420 But if you want to hang on for a second, 535 00:35:46,520 --> 00:35:48,280 I'll take questions when we're done 536 00:35:48,800 --> 00:35:51,780 because there's a little bit more to talk about, right? 537 00:35:53,300 --> 00:35:55,200 I've made this sound very simple. 538 00:35:55,340 --> 00:35:57,000 And to a large extent, it is. 539 00:35:57,120 --> 00:35:58,860 If you find the right devices 540 00:35:58,860 --> 00:36:00,780 with the right chips, 541 00:36:02,620 --> 00:36:04,140 but what do you do next? 542 00:36:04,840 --> 00:36:07,280 You've got your, you know, your first shikra. 543 00:36:07,500 --> 00:36:09,080 You're pulling your first images off. 544 00:36:09,220 --> 00:36:11,720 You're trojan-ing your first, you know, print server 545 00:36:11,720 --> 00:36:13,360 to drive your friends up the wall 546 00:36:13,360 --> 00:36:15,460 by having it print out chicken, chicken, chicken 547 00:36:15,460 --> 00:36:16,660 instead of what they sent. 548 00:36:17,000 --> 00:36:18,120 Fun stuff like that. 549 00:36:18,540 --> 00:36:20,800 But there are other problems that pop up 550 00:36:20,800 --> 00:36:23,180 when you start opening your firmware or your hardware up. 551 00:36:23,400 --> 00:36:26,420 If we go back to that TP-Link WR-814 552 00:36:26,420 --> 00:36:27,620 where I was dissing everybody 553 00:36:27,620 --> 00:36:28,840 who needs a serial port, 554 00:36:29,300 --> 00:36:32,300 well, what happens when you find these little connectors on here? 555 00:36:32,400 --> 00:36:33,720 How do you know what those connectors are? 556 00:36:34,020 --> 00:36:35,880 Can anybody tell me what this connector is? 557 00:36:37,060 --> 00:36:38,320 Four pins in a row. 558 00:36:38,820 --> 00:36:40,120 Eh, probably a UART. 559 00:36:40,140 --> 00:36:40,720 How about that one? 560 00:36:42,100 --> 00:36:43,060 Probably a JTAG. 561 00:36:43,500 --> 00:36:44,620 What's the pin out of it? 562 00:36:44,880 --> 00:36:45,680 How do you know? 563 00:36:47,660 --> 00:36:49,300 Again, how do you know it's a serial port? 564 00:36:49,500 --> 00:36:50,360 Or a UART? 565 00:36:50,620 --> 00:36:51,680 Which are the same thing. 566 00:36:51,880 --> 00:36:52,980 Or a JTAG connector? 567 00:36:53,920 --> 00:36:56,420 A lot of times, you'll find these all over 568 00:36:56,420 --> 00:36:57,440 and you want to know what they are. 569 00:36:58,440 --> 00:37:01,280 If your problem is an unlabeled connector on the board, 570 00:37:01,480 --> 00:37:02,800 one of your first investments, 571 00:37:02,860 --> 00:37:04,020 if you have a little bit more money, 572 00:37:04,140 --> 00:37:05,180 about $175, 573 00:37:05,940 --> 00:37:07,640 this device is very handy. 574 00:37:07,760 --> 00:37:09,280 It's Joe Grant's JTAGulator. 575 00:37:10,060 --> 00:37:10,680 What's it do? 576 00:37:10,980 --> 00:37:12,660 You wire it up to those things 577 00:37:12,660 --> 00:37:14,260 and you run a little program on it 578 00:37:14,260 --> 00:37:14,840 and it tells you, 579 00:37:14,960 --> 00:37:17,140 hey, I think that's a serial port 580 00:37:17,140 --> 00:37:18,760 and I think this is the parameters. 581 00:37:19,020 --> 00:37:20,840 And what you connected to my pin one, 582 00:37:20,960 --> 00:37:21,900 I think is this pin. 583 00:37:22,300 --> 00:37:23,340 Same with the JTAG. 584 00:37:23,420 --> 00:37:26,140 It's a really handy way to identify those little headers. 585 00:37:26,420 --> 00:37:27,140 If you can find them. 586 00:37:27,480 --> 00:37:29,700 So if they are kind enough to give you a header, 587 00:37:29,840 --> 00:37:32,680 something like this makes it a lot easier to walk through 588 00:37:32,680 --> 00:37:34,320 and it's actually pretty reliable 589 00:37:34,320 --> 00:37:36,060 for just a little board. 590 00:37:39,140 --> 00:37:41,960 If your problem is reading and writing to the chips, 591 00:37:42,160 --> 00:37:44,660 like your Shikra is just not cutting it, 592 00:37:44,800 --> 00:37:47,640 you may need to step up to something a little heavier 593 00:37:47,640 --> 00:37:49,160 like an actual programmer. 594 00:37:49,920 --> 00:37:52,400 They are also generally much, much faster. 595 00:37:52,680 --> 00:37:55,220 But where they really come in handy for me 596 00:37:55,220 --> 00:37:58,480 is simply most of them have a pull down 597 00:37:58,480 --> 00:37:59,300 where you just say, 598 00:37:59,800 --> 00:38:02,360 I have an I2C EEPROM or a SPI EEPROM. 599 00:38:02,560 --> 00:38:03,580 Here's the manufacturer. 600 00:38:03,720 --> 00:38:04,360 Here's the chip. 601 00:38:04,540 --> 00:38:06,180 It knows how to talk to it. 602 00:38:06,480 --> 00:38:07,780 It handles all that. 603 00:38:08,860 --> 00:38:10,580 This is, you know, about a, 604 00:38:10,580 --> 00:38:12,380 I think this is a total phase. 605 00:38:12,620 --> 00:38:16,480 So this is about a $250 programmer 606 00:38:16,480 --> 00:38:17,800 that does SPI and I2C. 607 00:38:18,260 --> 00:38:19,860 You can step up to a Dataprog, 608 00:38:19,960 --> 00:38:22,940 which will do pretty much any chip you can think of. 609 00:38:23,520 --> 00:38:24,860 If you see the guys who are doing 610 00:38:24,860 --> 00:38:26,720 like laptop BIOSes and all that, 611 00:38:26,820 --> 00:38:27,540 that's what they're doing. 612 00:38:27,620 --> 00:38:29,180 They're attaching the clips to it 613 00:38:29,180 --> 00:38:30,540 and using something like a Dataprog. 614 00:38:31,180 --> 00:38:32,640 They're able to pull out a lot more. 615 00:38:32,860 --> 00:38:35,580 The real plus of these is 616 00:38:36,780 --> 00:38:38,560 you don't have to do a lot of configuration 617 00:38:38,560 --> 00:38:39,880 and they're lightning fast. 618 00:38:40,100 --> 00:38:41,220 So if you're auditing a lot of things, 619 00:38:41,360 --> 00:38:43,240 they do save you a lot of time. 620 00:38:45,720 --> 00:38:47,620 But like I said, for the hobbyists, 621 00:38:47,660 --> 00:38:48,580 they can be a little expensive 622 00:38:48,580 --> 00:38:49,840 unless you're really into it. 623 00:38:50,660 --> 00:38:52,220 If you want to know more about the protocols, 624 00:38:52,440 --> 00:38:54,300 I glossed over the protocols and just said, 625 00:38:54,860 --> 00:38:55,780 hey, connect to these things. 626 00:38:56,360 --> 00:38:58,380 I absolutely recommend getting yourself 627 00:38:58,380 --> 00:39:00,960 a little USB logic analyzer. 628 00:39:01,520 --> 00:39:03,860 Most people recommend the Saly logics. 629 00:39:04,600 --> 00:39:06,940 I actually kind of like this cheap one 630 00:39:06,940 --> 00:39:08,520 called a Zero Plus Lap C. 631 00:39:08,760 --> 00:39:10,340 It's about half the price of a Saly. 632 00:39:10,560 --> 00:39:11,820 It only is USB 2. 633 00:39:12,080 --> 00:39:15,080 But it comes with like 110 different protocol 634 00:39:15,900 --> 00:39:16,660 decryptors in it. 635 00:39:16,800 --> 00:39:18,580 So you can say, in this case, 636 00:39:18,700 --> 00:39:21,460 I've said I'll wire up each of the pins. 637 00:39:21,740 --> 00:39:23,100 I've pulled the signal out. 638 00:39:23,140 --> 00:39:23,980 Then I say, hey, 639 00:39:25,020 --> 00:39:25,940 decode that as spy. 640 00:39:26,260 --> 00:39:28,220 And you'll actually see the messages 641 00:39:28,220 --> 00:39:29,140 as they go past. 642 00:39:29,940 --> 00:39:31,160 Again, fairly useful. 643 00:39:31,380 --> 00:39:32,380 Not too expensive. 644 00:39:32,820 --> 00:39:34,480 All in all, you're talking, you know, 645 00:39:34,480 --> 00:39:36,700 300 or 400 for a little device like this 646 00:39:36,700 --> 00:39:37,840 that you can just carry with you. 647 00:39:38,080 --> 00:39:39,160 It's a little box that big, 648 00:39:39,220 --> 00:39:40,000 powered by USB. 649 00:39:40,280 --> 00:39:41,020 There's one in my back, 650 00:39:41,120 --> 00:39:42,000 so if you want to come look at it. 651 00:39:42,380 --> 00:39:43,940 But again, if you want to learn more 652 00:39:43,940 --> 00:39:45,340 about the protocols, it's a great way. 653 00:39:45,580 --> 00:39:47,180 Now, learning about the protocols, though, 654 00:39:47,220 --> 00:39:48,340 doesn't help you because, again, 655 00:39:48,360 --> 00:39:49,460 you're back to that bit banging 656 00:39:49,460 --> 00:39:51,060 and watching one byte go by at a time. 657 00:39:51,520 --> 00:39:52,900 The adapters and the downloaders, 658 00:39:53,380 --> 00:39:54,840 if you're really into firmware analysis, 659 00:39:54,840 --> 00:39:55,960 you just need to speed. 660 00:39:56,100 --> 00:39:58,200 You don't care about what bits went where. 661 00:39:58,300 --> 00:39:59,680 But this is handy for telling you 662 00:39:59,680 --> 00:40:00,480 when things go wrong. 663 00:40:02,560 --> 00:40:06,640 So there are a great many of these USB ones out there. 664 00:40:06,880 --> 00:40:08,800 They're not that useful for the download, 665 00:40:09,000 --> 00:40:10,320 but they're terrific for understanding 666 00:40:10,320 --> 00:40:11,600 how the protocols work. 667 00:40:11,920 --> 00:40:13,580 Make sure you get one that has 668 00:40:13,580 --> 00:40:15,280 the protocol dissectors in it. 669 00:40:15,800 --> 00:40:18,260 A lot of times, they'll just give you the signal. 670 00:40:18,360 --> 00:40:19,500 You want the one that will interpret 671 00:40:19,500 --> 00:40:20,380 those signals and say, 672 00:40:20,500 --> 00:40:22,220 if this is a serial port, 673 00:40:23,320 --> 00:40:24,480 then read it this way. 674 00:40:24,520 --> 00:40:24,820 If this is a serial port, 675 00:40:24,840 --> 00:40:26,580 if this is a spy, read it that way. 676 00:40:28,080 --> 00:40:30,360 And getting back to everybody's favorite, 677 00:40:30,920 --> 00:40:33,540 if you need both debug access, 678 00:40:33,760 --> 00:40:35,700 the ability to stop and start things, 679 00:40:36,400 --> 00:40:38,620 things like let the kernel load 680 00:40:38,620 --> 00:40:40,940 and then go in and edit kernel parameters 681 00:40:40,940 --> 00:40:45,020 or bypass the login screen or something, 682 00:40:45,700 --> 00:40:46,720 these are very handy. 683 00:40:46,840 --> 00:40:49,900 The JTAG adapter kind of serves two purposes. 684 00:40:50,140 --> 00:40:51,840 Because it can talk to each of the chips, 685 00:40:51,980 --> 00:40:54,600 it not only is useful for putting the firmware on 686 00:40:54,600 --> 00:40:55,560 and off the box, 687 00:40:55,660 --> 00:40:58,980 it also can be used for things like stopping the CPU, 688 00:40:59,620 --> 00:41:02,220 modifying values in memory, things like that. 689 00:41:02,420 --> 00:41:04,580 It is really the tool of choice 690 00:41:04,580 --> 00:41:06,860 for pulling basically anything 691 00:41:06,860 --> 00:41:08,580 where you want to go too deep on it. 692 00:41:08,840 --> 00:41:10,620 But I wanted to talk a little bit about JTAG 693 00:41:11,200 --> 00:41:13,700 because JTAG is really persnickety. 694 00:41:13,840 --> 00:41:15,200 It seems like every company, 695 00:41:15,340 --> 00:41:17,160 even though it's kind of a standard 696 00:41:17,160 --> 00:41:18,380 around what the wires are, 697 00:41:18,520 --> 00:41:20,620 everybody does it a little differently. 698 00:41:21,020 --> 00:41:22,600 So every time you have a chip, 699 00:41:22,720 --> 00:41:23,900 there's a JTAG adapter 700 00:41:23,900 --> 00:41:25,120 that goes with it. 701 00:41:25,800 --> 00:41:27,400 I'm a heavy FPGA guy, 702 00:41:27,620 --> 00:41:31,040 so the top one is my official Xilinx adapter 703 00:41:31,040 --> 00:41:33,560 for talking to Xilinx FPGA chips. 704 00:41:34,740 --> 00:41:35,800 One thing, you know, 705 00:41:35,820 --> 00:41:37,440 that's all it does is talk to them. 706 00:41:37,620 --> 00:41:40,560 It costs a lot of money for a genuine Xilinx. 707 00:41:40,840 --> 00:41:43,140 The bottom one is my Chinese knockoff 708 00:41:43,140 --> 00:41:44,140 that I bought on eBay 709 00:41:45,000 --> 00:41:46,960 that has a little switch right here 710 00:41:46,960 --> 00:41:48,080 that if you click it one way, 711 00:41:48,160 --> 00:41:50,020 it'll talk the Xilinx protocol. 712 00:41:50,300 --> 00:41:51,380 If you click it the other way, 713 00:41:51,540 --> 00:41:52,780 it'll talk the Altera, 714 00:41:52,960 --> 00:41:53,880 which is another FPGA 715 00:41:53,900 --> 00:41:54,820 manufacturer protocol. 716 00:41:55,040 --> 00:41:56,560 I've even seen ones that have three. 717 00:41:57,120 --> 00:41:59,220 This actually has two different sets of circuits 718 00:41:59,220 --> 00:42:00,960 to talk to them in one, 719 00:42:01,060 --> 00:42:03,100 and it's, what, 50 bucks 720 00:42:03,100 --> 00:42:05,080 compared to hundreds of dollars 721 00:42:05,080 --> 00:42:06,360 for the official Xilinx one. 722 00:42:07,520 --> 00:42:09,560 So getting back to whether your firmware 723 00:42:09,560 --> 00:42:10,500 has been pirated, 724 00:42:10,680 --> 00:42:12,760 I wonder how they managed to make it work. 725 00:42:14,840 --> 00:42:16,720 So if you're not into FPGAs, 726 00:42:16,860 --> 00:42:18,120 how many people know what ARM is? 727 00:42:18,200 --> 00:42:18,860 Everybody like ARM? 728 00:42:19,580 --> 00:42:20,780 Yeah, ARM is great. 729 00:42:20,980 --> 00:42:23,300 How do you talk to ARM for JTAG? 730 00:42:23,300 --> 00:42:25,720 Well, most of us use a SEGGER. 731 00:42:26,640 --> 00:42:28,200 SEGGERS are wonderful little devices. 732 00:42:28,460 --> 00:42:29,820 They talk to lots of the ARM chips. 733 00:42:29,980 --> 00:42:30,580 It's what we use. 734 00:42:30,740 --> 00:42:33,500 Here you see the $69 student version 735 00:42:33,500 --> 00:42:36,300 of the $400 SEGGER JLINK. 736 00:42:36,380 --> 00:42:37,580 It's what we all use. 737 00:42:38,220 --> 00:42:39,200 Terrific little thing. 738 00:42:39,860 --> 00:42:43,400 Next to it, you see the $25 knockoff from China. 739 00:42:44,640 --> 00:42:45,740 Funny, it looks... 740 00:42:45,740 --> 00:42:48,360 By the way, the official SEGGER is brown. 741 00:42:48,540 --> 00:42:49,800 The student version is white. 742 00:42:50,220 --> 00:42:52,420 That looks amazingly like the real one. 743 00:42:52,420 --> 00:42:53,960 It even says SEGGER right on it. 744 00:42:54,120 --> 00:42:55,040 But it's $25. 745 00:42:57,240 --> 00:42:59,300 And yet it works exactly the same way. 746 00:42:59,400 --> 00:43:00,620 Again, you got to kind of wonder 747 00:43:00,620 --> 00:43:03,320 how they made it work exactly the same way. 748 00:43:04,960 --> 00:43:07,240 I personally love playing with these things. 749 00:43:07,400 --> 00:43:09,100 When I put this up in Kyle Tools 750 00:43:09,100 --> 00:43:10,440 or any of my ARM development environments, 751 00:43:10,620 --> 00:43:11,900 it pops up fine. 752 00:43:12,020 --> 00:43:13,160 It seems to work just great. 753 00:43:13,840 --> 00:43:15,220 It's actually pretty interesting 754 00:43:15,220 --> 00:43:17,320 to pull some of these low-cost ones apart, 755 00:43:17,540 --> 00:43:20,000 take a look at them, and see how they compare. 756 00:43:20,480 --> 00:43:22,220 The biggest difference I've noted 757 00:43:22,420 --> 00:43:24,560 with the SEGGER is the lines, 758 00:43:24,660 --> 00:43:26,740 the wires tend to be a little noisier. 759 00:43:26,980 --> 00:43:28,280 The signals aren't as clean. 760 00:43:28,380 --> 00:43:30,500 I don't think they put as many decoupling caps in. 761 00:43:30,880 --> 00:43:31,820 But they work. 762 00:43:32,260 --> 00:43:34,480 As long as you have a good, clean physical connection, 763 00:43:35,020 --> 00:43:36,420 they work pretty well. 764 00:43:37,520 --> 00:43:39,380 But anytime you see something like this, 765 00:43:39,400 --> 00:43:40,200 you got to remember the protocols 766 00:43:40,200 --> 00:43:41,400 are often so specific, 767 00:43:41,580 --> 00:43:43,780 you got to wonder if they're sharing firmware. 768 00:43:44,620 --> 00:43:46,300 So if you open it up and pull the firmware, 769 00:43:46,480 --> 00:43:48,860 you can begin to look for pirated firmware, 770 00:43:49,320 --> 00:43:50,240 which I think, again, 771 00:43:50,340 --> 00:43:51,900 is going to be something that's coming up. 772 00:43:52,420 --> 00:43:53,220 People are starting to write books 773 00:43:53,220 --> 00:43:56,280 on how to do intellectual property in firmware 774 00:43:56,280 --> 00:43:58,400 and become an expert witness at it. 775 00:43:58,660 --> 00:44:00,400 I'm thinking this is the future 776 00:44:00,940 --> 00:44:02,140 for a lot of this stuff. 777 00:44:02,560 --> 00:44:04,220 In the case of these two J-Links, 778 00:44:04,360 --> 00:44:06,220 they run different versions of software. 779 00:44:06,380 --> 00:44:08,060 My official one is running 9.3. 780 00:44:08,120 --> 00:44:09,980 The bottom one is version 8. 781 00:44:10,160 --> 00:44:12,380 The back side at least looks a little different. 782 00:44:12,500 --> 00:44:14,780 The front, it looks really like a SEGGER, 783 00:44:14,840 --> 00:44:18,280 but the back side does definitely make it clear 784 00:44:18,280 --> 00:44:21,020 that it's not an official SEGGER made in Germany. 785 00:44:23,160 --> 00:44:26,680 And as any good forensics examiner will tell you, 786 00:44:26,780 --> 00:44:28,760 you cannot stand up in court 787 00:44:28,760 --> 00:44:30,480 with anything that is pirated 788 00:44:30,480 --> 00:44:32,020 or not the official version. 789 00:44:33,420 --> 00:44:35,160 Using any one of those SEGGERS 790 00:44:35,160 --> 00:44:36,400 in a court case 791 00:44:36,800 --> 00:44:39,240 would get you thrown out as an expert witness. 792 00:44:39,460 --> 00:44:39,700 Why? 793 00:44:40,120 --> 00:44:42,220 Because the one is the student version, 794 00:44:42,920 --> 00:44:44,280 which means that I can't use it 795 00:44:44,280 --> 00:44:46,440 for anything official. 796 00:44:47,000 --> 00:44:49,300 So that would be a violation of my terms of use. 797 00:44:49,360 --> 00:44:50,700 That would get me kicked out of court. 798 00:44:51,020 --> 00:44:52,460 The other one is counterfeit, 799 00:44:52,900 --> 00:44:54,840 which again would get you thrown out of court. 800 00:44:55,000 --> 00:44:58,520 So when you are actually going to do this for a business 801 00:44:58,520 --> 00:45:01,360 or anything official, 802 00:45:01,900 --> 00:45:03,240 you kind of have to go back 803 00:45:03,240 --> 00:45:05,420 and buy the official versions of things. 804 00:45:05,740 --> 00:45:07,220 Just be careful about that. 805 00:45:07,440 --> 00:45:09,660 You can get away with a Shikra that you own, 806 00:45:09,800 --> 00:45:11,840 but you can't get away with a counterfeit SEGGER. 807 00:45:13,100 --> 00:45:14,880 So that's the end of my time. 808 00:45:15,320 --> 00:45:18,160 Like I said, I have all of the stuff out there. 809 00:45:18,280 --> 00:45:19,560 I can take any questions. 810 00:45:19,560 --> 00:45:21,700 Remember, I just wanted to give you a basic intro. 811 00:45:21,840 --> 00:45:23,020 There's lots of caveats everywhere. 812 00:45:23,200 --> 00:45:23,400 Yes? 813 00:45:26,560 --> 00:45:28,380 I tend to buy the Pomonas, 814 00:45:28,400 --> 00:45:29,240 which are the cheapest, 815 00:45:29,260 --> 00:45:31,020 for the simple reason that I go through them 816 00:45:31,020 --> 00:45:32,280 and I need so many different ones. 817 00:45:35,040 --> 00:45:35,440 Yeah. 818 00:45:36,200 --> 00:45:37,400 PSYOC 150s are fine. 819 00:45:38,660 --> 00:45:39,060 Yeah. 820 00:45:39,320 --> 00:45:41,000 I've been perfectly happy with those. 821 00:45:41,100 --> 00:45:43,240 Although I also, as you see, prefer to solder on 822 00:45:43,700 --> 00:45:45,140 just a clip on the top 823 00:45:45,140 --> 00:45:47,600 that matches up with my analysis unit. 824 00:45:48,060 --> 00:45:49,000 To me, that's easier.