1 00:00:00,000 --> 00:00:03,980 Welcome to Nation... oh, I do have to stay real close to this thing. 2 00:00:04,320 --> 00:00:07,360 Nation State Supply Chain Attacks for Dummies. 3 00:00:07,360 --> 00:00:08,260 And you. 4 00:00:08,700 --> 00:00:10,320 Or Chipping Cisco Firewall. 5 00:00:10,320 --> 00:00:11,340 So, let's go. 6 00:00:11,340 --> 00:00:14,520 We got a lot of stuff to cover and not very long to do it in. 7 00:00:15,000 --> 00:00:16,180 Hi, I'm Monte. 8 00:00:16,520 --> 00:00:18,360 And I do Coke and Strippers. 9 00:00:18,500 --> 00:00:21,860 I mean, for educational purposes only. 10 00:00:21,980 --> 00:00:25,280 I mean, I do the YouTube channel, Coke and Strippers. 11 00:00:25,280 --> 00:00:26,720 That's an educational channel. 12 00:00:26,720 --> 00:00:27,560 It's electronics. 13 00:00:27,560 --> 00:00:29,760 Anyway, you should go watch it. 14 00:00:30,420 --> 00:00:31,220 Okay. 15 00:00:32,000 --> 00:00:34,440 Oh, and you should note this. 16 00:00:34,440 --> 00:00:35,060 How many people... 17 00:00:35,060 --> 00:00:35,860 Yeah, we got people here. 18 00:00:35,860 --> 00:00:37,200 Take a good picture. 19 00:00:37,360 --> 00:00:39,780 Post something about this talk on Twitter and show it to me afterwards. 20 00:00:39,780 --> 00:00:41,320 And I'll give you something until they run out. 21 00:00:41,320 --> 00:00:42,360 I've got a little prize. 22 00:00:42,640 --> 00:00:43,440 A few of them. 23 00:00:43,440 --> 00:00:44,100 Alright. 24 00:00:45,380 --> 00:00:48,540 So, Supermicrochipping news. 25 00:00:48,540 --> 00:00:51,840 Anybody remember this story from Bloomberg last year? 26 00:00:51,840 --> 00:00:53,260 We got a few, right? 27 00:00:53,480 --> 00:01:03,460 Big article that maybe motherboards from Supermicro had small implants on the motherboard that would allow remote ownership. 28 00:01:03,700 --> 00:01:08,720 And that's kind of scary because that kind of stuff is pretty much impossible to detect. 29 00:01:08,800 --> 00:01:11,820 It could be in your equipment. 30 00:01:11,820 --> 00:01:15,840 It may survive a reboot or re-imaging. 31 00:01:16,200 --> 00:01:18,680 And it was introduced somewhere in the supply chain. 32 00:01:18,680 --> 00:01:21,660 You don't necessarily get a chance to see it and look at it. 33 00:01:22,420 --> 00:01:26,440 There was a lot of concern about it. 34 00:01:26,440 --> 00:01:28,620 They said it might be in some of the big data centers. 35 00:01:28,620 --> 00:01:31,360 Maybe Apple or Google or whatever. 36 00:01:31,360 --> 00:01:32,780 There were a few mentioned. 37 00:01:33,040 --> 00:01:35,680 But nobody ever found any real evidence. 38 00:01:35,940 --> 00:01:38,300 So, as far as I know, it was not real. 39 00:01:38,300 --> 00:01:39,680 Still a little down. 40 00:01:39,680 --> 00:01:40,520 Can you all hear me? 41 00:01:40,520 --> 00:01:41,920 Art, can you hear me? 42 00:01:41,940 --> 00:01:42,980 Sort of? 43 00:01:42,980 --> 00:01:43,400 Yes. 44 00:01:43,400 --> 00:01:43,740 Okay. 45 00:01:43,860 --> 00:01:45,700 If you ever can't, do this. 46 00:01:45,860 --> 00:01:46,660 You're going. 47 00:01:47,680 --> 00:01:50,620 Oh, you're listening to the thumb music in the back. 48 00:01:50,620 --> 00:01:51,160 Okay. 49 00:01:51,880 --> 00:01:54,740 But we never found any real evidence of it. 50 00:01:54,740 --> 00:01:59,560 So, still looking for proof. 51 00:01:59,900 --> 00:02:02,900 Instead of which, I decided that doesn't matter. 52 00:02:02,900 --> 00:02:04,420 Let's make it real. 53 00:02:04,540 --> 00:02:06,300 So, why not? 54 00:02:06,300 --> 00:02:08,720 And hopefully better than this. 55 00:02:09,480 --> 00:02:11,600 We started that. 56 00:02:11,640 --> 00:02:12,780 Could be better. 57 00:02:13,100 --> 00:02:14,700 So, time to pick a device. 58 00:02:14,700 --> 00:02:16,520 I'm from the ICS space. 59 00:02:16,520 --> 00:02:19,780 And my original thought was to pick maybe some of these. 60 00:02:20,320 --> 00:02:24,560 But I eventually decided on the Cisco firewall, which is also used there. 61 00:02:24,560 --> 00:02:27,560 The same attack basically will apply to all of those. 62 00:02:27,560 --> 00:02:30,240 But the firewall has a little broader appeal. 63 00:02:30,240 --> 00:02:32,600 So , we'll do it there. 64 00:02:33,820 --> 00:02:37,620 Try to consider what ways to do this. 65 00:02:37,620 --> 00:02:44,240 After a little thought, I decided probably the serial port was the cheapest and the easiest and the fastest to try to attack. 66 00:02:44,240 --> 00:02:48,080 Most of these devices are configured by serial port one way or the other. 67 00:02:49,300 --> 00:02:56,220 So, quick look at serial ports to refresh your memory if you haven't played with one in a few days. 68 00:02:56,940 --> 00:02:59,160 Simplest form, you need only three wires. 69 00:02:59,160 --> 00:03:01,260 You need a TX wire to talk to the device. 70 00:03:01,260 --> 00:03:04,300 You need an RX wire to receive information from the device. 71 00:03:04,300 --> 00:03:05,340 And you need a ground. 72 00:03:06,120 --> 00:03:10,920 They look like those connectors. 73 00:03:10,920 --> 00:03:14,100 Or, on the Cisco device, they're RJ45s. 74 00:03:20,900 --> 00:03:22,200 There we go. 75 00:03:22,200 --> 00:03:23,980 Now I can make little circles. 76 00:03:25,240 --> 00:03:27,700 So, here's a USB serial. 77 00:03:27,700 --> 00:03:28,800 They connect in those. 78 00:03:28,800 --> 00:03:31,160 In that port, that's the RJ45 serial connection. 79 00:03:31,160 --> 00:03:35,980 And the way you would originally configure a Cisco firewall when you first get in here... 80 00:03:35,980 --> 00:03:38,340 Who here has configured a Cisco firewall before? 81 00:03:38,340 --> 00:03:40,640 Oh, we got like half the audience at least. 82 00:03:40,640 --> 00:03:41,360 Maybe more. 83 00:03:41,360 --> 00:03:42,260 Excellent. 84 00:03:44,620 --> 00:03:47,620 Serial signaling goes something like this. 85 00:03:48,020 --> 00:03:49,400 You're going to pick a baud rate. 86 00:03:49,400 --> 00:03:51,100 There are various ones. 87 00:03:51,540 --> 00:03:53,340 9600 may be the most common. 88 00:03:53,340 --> 00:03:55,000 You're going to pick a number of data bits. 89 00:03:55,000 --> 00:03:58,320 Typically 7 or 8, but like 5 is legal. 90 00:03:59,180 --> 00:04:01,200 You're going to have a parity. 91 00:04:01,200 --> 00:04:07,700 It can be none, odd, even, mark, space, and a number of stop bits. 92 00:04:07,700 --> 00:04:10,500 And that defines your serial packet. 93 00:04:10,560 --> 00:04:14,140 How it's actually going to be transmitted on the physical wire. 94 00:04:14,140 --> 00:04:17,800 Very common is this 9600 8N1. 95 00:04:17,800 --> 00:04:23,120 That's our baud rate, number of data bits, parity, none, and one stop bit. 96 00:04:25,500 --> 00:04:36,440 To start dealing with the serial protocols, one of the things that I found very useful was this 8-channel analyzer that you can get from all the usual places in China. 97 00:04:38,000 --> 00:04:39,460 They're kind of ironic. 98 00:04:39,460 --> 00:04:42,260 You use cheap Chinese stuff to try to hack cheap China. 99 00:04:42,260 --> 00:04:43,280 Never mind. 100 00:04:45,060 --> 00:04:49,580 Anyway, that and free software. 101 00:04:50,200 --> 00:04:52,500 PulseView, freely available on the net. 102 00:04:53,500 --> 00:04:57,200 Its companion is Sigrock as well. 103 00:04:57,200 --> 00:04:59,760 So I can see signals going in both directions. 104 00:04:59,860 --> 00:05:04,220 Normally, if you connect up to a serial port, you're just getting the receive channel. 105 00:05:04,220 --> 00:05:09,420 You won't necessarily see what's on the send channel unless the device on the other end reflects it to you. 106 00:05:09,420 --> 00:05:13,200 So I want to connect to both the send and receive, receive both channels simultaneously. 107 00:05:13,440 --> 00:05:15,800 I can set up PulseView to do that. 108 00:05:15,800 --> 00:05:18,340 I'm setting up 8-in-1. 109 00:05:19,480 --> 00:05:21,360 Least significant bit first. 110 00:05:21,360 --> 00:05:23,120 That's what little Indian... 111 00:05:23,120 --> 00:05:25,320 I want to see it as ASCII. 112 00:05:25,320 --> 00:05:27,340 I need to invert the signal. 113 00:05:28,360 --> 00:05:30,420 So PulseView, there's the link if you need it. 114 00:05:30,420 --> 00:05:31,300 It's great software. 115 00:05:31,300 --> 00:05:33,980 I don't have anything to do with the project other than I like it. 116 00:05:34,360 --> 00:05:40,220 In this case, what we see is these are the literal bits I am pulling off the wire. 117 00:05:41,760 --> 00:05:47,060 This is... I use this UART decoder for them. 118 00:05:47,100 --> 00:05:48,740 I see a start bit. 119 00:05:48,740 --> 00:05:51,840 I see a bunch of data bits and a stop bit. 120 00:05:51,880 --> 00:05:57,220 If I interpret this as ASCII, which is what I've asked it to do, I end up here with the letter C. 121 00:05:57,220 --> 00:05:59,580 C-O-N-F-I-G and so forth. 122 00:05:59,700 --> 00:06:03,540 So that's a sample of this run. 123 00:06:04,280 --> 00:06:06,080 Typically, you'll run this... 124 00:06:06,080 --> 00:06:17,120 When you're doing serial, you'll use a UART and a driver to help you communicate with the hardware and keep all of your voltages at the right level. 125 00:06:18,560 --> 00:06:21,280 These are the commonly seen voltage levels. 126 00:06:21,280 --> 00:06:24,380 We've got 5 and 10 and 12 and 15. 127 00:06:24,600 --> 00:06:25,820 And that's a problem. 128 00:06:25,820 --> 00:06:35,980 On this device, it's swinging plus and minus 15, which will totally destroy any type of microcontroller I want to try to connect to it. 129 00:06:36,100 --> 00:06:40,820 So, we've got a little bit of a problem, but there's a trick. 130 00:06:40,820 --> 00:06:47,360 So, in doing some other work with attacking power supplies, I found this application note. 131 00:06:47,620 --> 00:07:00,260 And basically what it says is that these microcontrollers, at least the family I'm used to working with, the Atmel and various other ones, have protection diodes built in on every input. 132 00:07:00,260 --> 00:07:06,900 So that if the voltage swings above your positive voltage, above VCC, it gets tied there. 133 00:07:06,900 --> 00:07:13,400 And if the amount of current is low enough, that keeps that pin from going above your VCC voltage. 134 00:07:13,400 --> 00:07:16,420 Or, it also keeps it from going below ground. 135 00:07:16,780 --> 00:07:22,300 But the key point to this is that you have to limit the current, right? 136 00:07:22,300 --> 00:07:25,680 Otherwise, you will just smoke those diodes and still blow the chip up. 137 00:07:25,680 --> 00:07:29,480 So, what you need is just an appropriate sized resistor coming in. 138 00:07:29,480 --> 00:07:34,080 In this case, they're using one mega-ohm and they can connect it to the AC outlet. 139 00:07:34,100 --> 00:07:40,600 Well, I only need to work for 15 volts, so that should be something like a 15 kilo-ohm resistor. 140 00:07:41,040 --> 00:07:45,360 It turns out maybe 5.1k is close enough. 141 00:07:46,340 --> 00:07:51,080 That's when I started using the testing and it was working and I just never changed back, right? 142 00:07:51,080 --> 00:07:55,140 What's the number one rule in ICS, you know, reliability? 143 00:07:55,140 --> 00:07:56,460 If it ain't broke, don't touch it! 144 00:07:56,460 --> 00:07:57,200 Yes! 145 00:07:57,200 --> 00:07:59,440 It's working, don't touch it! 146 00:07:59,620 --> 00:08:02,240 You should get a reward for that. 147 00:08:02,240 --> 00:08:04,520 We'll see you afterwards. 148 00:08:04,660 --> 00:08:06,100 Oh no, hang on. 149 00:08:06,100 --> 00:08:07,720 Yeah, I don't have them. 150 00:08:07,720 --> 00:08:08,880 They're in my back. 151 00:08:11,160 --> 00:08:13,200 So, I want to be able to test this. 152 00:08:13,200 --> 00:08:19,600 Can I actually use this configuration to talk to this Cisco device? 153 00:08:19,600 --> 00:08:20,920 You know, this is a little big. 154 00:08:20,920 --> 00:08:22,920 I'm using this Arduino Mega. 155 00:08:22,920 --> 00:08:23,620 You know, what are they? 156 00:08:23,620 --> 00:08:27,980 10, 15 bucks, maybe less if you get them from the Chinas. 157 00:08:30,020 --> 00:08:35,480 And setting up a couple of resistors and this serial cable in. 158 00:08:35,500 --> 00:08:39,440 And sure enough, I found out, yes, I can talk to this device. 159 00:08:39,440 --> 00:08:42,800 I can receive these 15 volt signals without blowing it up. 160 00:08:42,800 --> 00:08:49,280 And also, surprisingly, just by sending it 5 volts and ground, I can transmit to it. 161 00:08:49,280 --> 00:08:51,060 Which is out of spec, right? 162 00:08:51,160 --> 00:08:56,800 The minimal spec is like negative 3 volts for RS-232. 163 00:08:56,800 --> 00:08:58,880 Well, now TIA, but you know. 164 00:09:00,160 --> 00:09:01,880 But, it works. 165 00:09:02,040 --> 00:09:03,340 So far, I'm in. 166 00:09:03,340 --> 00:09:04,960 I'm going down this path. 167 00:09:04,960 --> 00:09:06,300 How am I going to attack it? 168 00:09:06,300 --> 00:09:08,020 What hardware and software to use? 169 00:09:08,020 --> 00:09:08,960 Is this possible? 170 00:09:08,960 --> 00:09:10,500 It looks like I'm good. 171 00:09:10,500 --> 00:09:13,880 It looks like I'm prepared to do this. 172 00:09:13,880 --> 00:09:15,980 It was a fairly quick and easy test, right? 173 00:09:15,980 --> 00:09:17,180 Get a piece of hardware. 174 00:09:17,180 --> 00:09:18,160 You plug it up. 175 00:09:18,280 --> 00:09:19,200 Not too hard. 176 00:09:19,200 --> 00:09:20,040 It works. 177 00:09:20,880 --> 00:09:26,400 The next thing is to decide what actual kind of chip that I want to use in this. 178 00:09:26,760 --> 00:09:32,260 Part of the fun of the attack, I think, is using very small devices, right? 179 00:09:32,260 --> 00:09:35,300 If you remember the picture from the Bloomberg, it was a pretty small device. 180 00:09:35,820 --> 00:09:40,540 I started out with this ATtiny10, which, as I say here, is not just tiny. 181 00:09:40,540 --> 00:09:41,480 It's minuscule. 182 00:09:41,480 --> 00:09:44,220 That's the one here in the tweezers. 183 00:09:44,220 --> 00:09:54,450 And technically, the attack that we'll see here in a little while, you could technically run it with that microcontroller. 184 00:09:55,320 --> 00:09:58,100 There's also the ATtiny85. 185 00:09:58,100 --> 00:10:03,560 I chose that one because of some additional capabilities, in particular EEPROM. 186 00:10:03,560 --> 00:10:07,520 So that allows me to store information in the chip. 187 00:10:07,520 --> 00:10:13,160 So, like, I could count number of reboots or maybe store some data if I could collect it. 188 00:10:13,160 --> 00:10:22,040 So, I chose the ATtiny85 for maybe some advanced features that, actually, at this point, I haven't implemented. 189 00:10:22,180 --> 00:10:24,080 But, it doesn't matter. 190 00:10:24,080 --> 00:10:28,900 There was also another advantage, and we'll see, of choosing this ATtiny85. 191 00:10:28,900 --> 00:10:31,760 But, technically, you could use the ATtiny10. 192 00:10:31,920 --> 00:10:33,720 Ah, there are a couple more advantages. 193 00:10:35,080 --> 00:10:41,560 One of them being this carrier board, this DigiSpark. 194 00:10:41,560 --> 00:10:44,800 You can pick these up, again, from where? 195 00:10:45,260 --> 00:10:45,960 China! 196 00:10:45,960 --> 00:10:47,400 Yeah, China! 197 00:10:47,620 --> 00:10:51,360 Taobao, Alibaba, Amazon, even. 198 00:10:51,360 --> 00:10:53,180 Five of them for $10. 199 00:10:54,140 --> 00:10:56,180 The actual microcontroller is over here. 200 00:10:56,180 --> 00:10:58,640 This is a power supply chip. 201 00:10:59,060 --> 00:11:01,820 Buying it in this format just makes it quicker and easier. 202 00:11:01,820 --> 00:11:04,840 I can program it by shoving this straight in a USB port. 203 00:11:04,840 --> 00:11:10,740 So, I got them cheap, and I've got a few of these. 204 00:11:10,740 --> 00:11:16,200 So , take a picture, tweet me, and catch me afterwards, and show it to me, and I'll give a few of them away. 205 00:11:17,360 --> 00:11:19,180 That's your DigiSpark board. 206 00:11:19,180 --> 00:11:22,640 So, I don't have to worry too much about programming it. 207 00:11:22,640 --> 00:11:25,200 And, also, I can use existing tools. 208 00:11:25,200 --> 00:11:26,540 That saves me a little bit of time. 209 00:11:26,540 --> 00:11:30,040 I can use the Arduino IDE interface. 210 00:11:31,000 --> 00:11:34,100 So, now, this is my second round of test hardware. 211 00:11:35,600 --> 00:11:41,500 I'm not using the Mega anymore. 212 00:11:41,500 --> 00:11:43,360 I'm actually using this DigiSpark. 213 00:11:43,360 --> 00:11:46,300 Can I do this same thing with this other piece of hardware? 214 00:11:46,300 --> 00:11:48,460 There shouldn't be any reason why I couldn't. 215 00:11:50,060 --> 00:11:52,320 But, you know, you want to test it. 216 00:11:52,320 --> 00:11:54,280 It is a little more complicated to program. 217 00:11:54,280 --> 00:11:59,740 There's some limited amount of space, and some kind of libraries to play with. 218 00:11:59,740 --> 00:12:02,200 But, connect it up. 219 00:12:02,200 --> 00:12:03,920 Start running the tests. 220 00:12:04,180 --> 00:12:08,400 And, at that point, find out that we are all good. 221 00:12:08,400 --> 00:12:14,620 I can use this little device to communicate across the serial port. 222 00:12:14,620 --> 00:12:16,020 So, now, I'm getting closer, right? 223 00:12:16,020 --> 00:12:17,020 I've got a device. 224 00:12:17,020 --> 00:12:18,300 I've run the tests. 225 00:12:18,300 --> 00:12:23,100 I just need to be able to hide this on the motherboard somewhere. 226 00:12:23,360 --> 00:12:27,880 Oh, and I also mentioned that you can use the Arduino IDE to control this. 227 00:12:28,340 --> 00:12:29,680 You really can't see it here. 228 00:12:29,680 --> 00:12:32,240 I assume this will be available somewhere online. 229 00:12:32,640 --> 00:12:36,460 Links to all these parts and pieces are there. 230 00:12:36,460 --> 00:12:37,300 You're shaking your head. 231 00:12:37,300 --> 00:12:38,620 So, it's going to be online. 232 00:12:39,580 --> 00:12:43,160 And, if you want to follow along... 233 00:12:43,160 --> 00:12:49,960 By the way, though, for programming this board, usually in the Arduino world, you just hit Program, and it programs. 234 00:12:49,960 --> 00:12:53,260 For this board, you have to disconnect it and reconnect it. 235 00:12:53,260 --> 00:12:57,660 The bootloader will only allow it to program the first few seconds during powerup. 236 00:12:57,780 --> 00:13:00,920 So, I struggled with that for a few minutes the first time. 237 00:13:00,920 --> 00:13:02,820 Well, maybe more than a few minutes. 238 00:13:02,940 --> 00:13:05,740 The first time that I started fiddling with these. 239 00:13:05,740 --> 00:13:09,720 So , hit the Program, unplug them, plug them back up. 240 00:13:09,720 --> 00:13:10,840 They program great. 241 00:13:12,580 --> 00:13:14,200 So, now, what do I do? 242 00:13:14,200 --> 00:13:15,840 So, I've picked the chip. 243 00:13:15,840 --> 00:13:16,720 It looks like it works. 244 00:13:16,720 --> 00:13:17,440 I've tested it. 245 00:13:17,440 --> 00:13:19,480 I can program it on this board. 246 00:13:19,720 --> 00:13:21,080 I don't want to install that whole board. 247 00:13:21,080 --> 00:13:21,680 That's ugly. 248 00:13:21,680 --> 00:13:22,240 That's big. 249 00:13:22,240 --> 00:13:23,460 It's obnoxious. 250 00:13:23,760 --> 00:13:28,580 So, after I program it, I pull that chip off this board. 251 00:13:28,720 --> 00:13:32,160 I use a little hot air rework. 252 00:13:32,160 --> 00:13:36,420 Now, that's just because I have it in my basement. 253 00:13:36,420 --> 00:13:43,540 That's my below-ground lair in the basement. 254 00:13:44,200 --> 00:13:47,240 But you can use a soldering iron or whatever. 255 00:13:47,240 --> 00:13:55,520 But, again, for all these things, I don't get any money from Banggood, which is actually a cool place to buy electronics online. 256 00:13:55,520 --> 00:13:56,460 Don't ask. 257 00:13:57,900 --> 00:13:59,300 There's the links if you want them. 258 00:13:59,300 --> 00:14:01,120 But I pull the chip off of that board. 259 00:14:01,120 --> 00:14:02,260 Now I have my chip. 260 00:14:02,260 --> 00:14:03,060 It's all programmed. 261 00:14:03,060 --> 00:14:04,440 It's all ready to go. 262 00:14:04,440 --> 00:14:07,060 And so far, it's been relatively easy. 263 00:14:07,060 --> 00:14:12,820 I didn't have to get any kind of special programmers or anything else. 264 00:14:12,820 --> 00:14:17,640 Any small PC boards because it came already connected for me. 265 00:14:17,640 --> 00:14:22,780 So, one of the advantages of starting with these DigiSparks, and it's cheap. 266 00:14:24,560 --> 00:14:28,200 So, we talked about, well, what ended up being four wires. 267 00:14:28,200 --> 00:14:31,160 That's RX and TX, transmit and receive. 268 00:14:31,160 --> 00:14:33,520 You also need power and ground. 269 00:14:34,700 --> 00:14:39,240 But for this attack right now is I'm just running it blind. 270 00:14:39,240 --> 00:14:41,800 I'm just pushing commands out. 271 00:14:41,800 --> 00:14:44,100 I'm not listening to anything coming back. 272 00:14:44,100 --> 00:14:46,080 So, I can cut off one of those wires. 273 00:14:46,080 --> 00:14:48,500 I only need transmit and power and ground. 274 00:14:48,580 --> 00:14:52,520 So, I end up with this little chip with three wires coming off of it. 275 00:14:52,520 --> 00:15:02,500 And at this point, I should be able to take that chip and solder it anywhere on this motherboard and send the commands that we'll run through here briefly. 276 00:15:05,440 --> 00:15:11,300 But these wires on a motherboard, sometimes called bodge wires, they look ugly, right? 277 00:15:11,300 --> 00:15:13,300 And they sort of indicate something weird is going on. 278 00:15:13,300 --> 00:15:16,740 I mean, occasionally you will see them for real, like the picture there on the left. 279 00:15:17,080 --> 00:15:19,280 But they're fairly rare. 280 00:15:19,500 --> 00:15:24,260 And what I really don't want is it to look like this picture on the right where somebody's just soldering all kinds of stuff. 281 00:15:24,320 --> 00:15:30,820 That's going to look really suspicious on your new equipment if it has all kinds of warts and stuff growing off of it. 282 00:15:30,820 --> 00:15:34,520 So, I want it to look better than that if possible. 283 00:15:34,520 --> 00:15:38,200 So, what can I do about this three-wire installation? 284 00:15:39,640 --> 00:15:43,180 Well, I came up with a three-wire solution. 285 00:15:43,180 --> 00:15:53,480 It turns out that next to the port on this device that is the RJ45 serial connection, there are also two USB ports. 286 00:15:53,580 --> 00:16:00,980 And this is the bottom of the motherboard already, the way it's already set up. 287 00:16:00,980 --> 00:16:04,080 This is factory original shmoo here. 288 00:16:05,000 --> 00:16:07,880 We'll talk about later looking for this thing. 289 00:16:07,900 --> 00:16:11,000 You might look for sort of strangeness on the motherboard. 290 00:16:11,000 --> 00:16:12,460 And this was already here from the factory. 291 00:16:12,460 --> 00:16:14,120 That wasn't even my doing. 292 00:16:14,200 --> 00:16:23,980 But what I found was at this location, here are the pins for the RJ45 serial connection and my TX line. 293 00:16:23,980 --> 00:16:25,380 And there's a ground. 294 00:16:25,640 --> 00:16:28,140 And then I pull power off of this. 295 00:16:28,140 --> 00:16:29,260 These are the USB ports. 296 00:16:29,260 --> 00:16:33,460 There are two USB ports, power, ground, and I don't need the data connections. 297 00:16:33,460 --> 00:16:39,640 So, I solder this small chip directly to the motherboard like this. 298 00:16:39,640 --> 00:16:43,020 Now, I've got power and transmit, and it's awesome, right? 299 00:16:43,020 --> 00:16:44,640 I am in. 300 00:16:47,460 --> 00:16:50,500 Probably way too far late in this process. 301 00:16:50,500 --> 00:16:51,000 Wait a minute. 302 00:16:51,000 --> 00:16:51,740 Yep. 303 00:16:52,420 --> 00:16:53,460 All right. 304 00:16:53,460 --> 00:16:59,660 So, by the way, who here are like electrical engineers or electrical hobbyists? 305 00:16:59,660 --> 00:17:05,620 We need more electrical minded folks in this... in any case. 306 00:17:05,620 --> 00:17:09,540 So, what is its value? 307 00:17:09,540 --> 00:17:11,560 What is the value of this thing? 308 00:17:11,720 --> 00:17:14,640 You don't have to be an electrical engineer to figure it out. 309 00:17:14,640 --> 00:17:15,400 Anybody? 310 00:17:15,520 --> 00:17:16,800 Five dollars. 311 00:17:17,800 --> 00:17:19,320 Five RMP. 312 00:17:20,400 --> 00:17:21,720 Half a penny. 313 00:17:21,720 --> 00:17:22,600 Half a cent. 314 00:17:23,060 --> 00:17:24,100 No! 315 00:17:24,160 --> 00:17:25,140 Yes. 316 00:17:25,660 --> 00:17:28,620 No, I'm playing a little bit of a word game here. 317 00:17:28,620 --> 00:17:33,680 The value of it as a resistor is its resistance in ohms is? 318 00:17:34,160 --> 00:17:34,800 Zero. 319 00:17:34,800 --> 00:17:35,360 Zero ! 320 00:17:35,620 --> 00:17:38,060 And it only costs like half a cent. 321 00:17:38,060 --> 00:17:39,300 But, word games. 322 00:17:39,300 --> 00:17:40,500 Thank you for playing. 323 00:17:41,500 --> 00:17:45,420 Its value as a resistor value is zero. 324 00:17:45,420 --> 00:17:47,820 Why do we use a zero value resistor? 325 00:17:48,440 --> 00:17:50,300 What do we use that for? 326 00:17:50,440 --> 00:17:51,940 Protect the circuit. 327 00:17:52,180 --> 00:17:55,440 No, it's got zero protection value. 328 00:17:55,440 --> 00:17:58,140 Yeah, but it's like you've got some kind of voltage that looks low. 329 00:17:58,140 --> 00:17:59,160 Yeah, maybe. 330 00:17:59,180 --> 00:18:00,000 Maybe, because it's small. 331 00:18:00,000 --> 00:18:01,280 Yeah, you might use it like a fuse. 332 00:18:01,280 --> 00:18:03,960 In this case, I'm just using it so I don't have to use a wire. 333 00:18:05,020 --> 00:18:08,680 Because I needed this one resistor, right? 334 00:18:08,680 --> 00:18:10,840 That's the one protecting me from the 15 volts. 335 00:18:11,120 --> 00:18:14,200 I used this one to ground just so I don't have to put a wire in there. 336 00:18:14,200 --> 00:18:16,700 So, it turns out to be valuable. 337 00:18:16,700 --> 00:18:20,480 It makes this a lot more invisible on this motherboard. 338 00:18:20,840 --> 00:18:23,600 And at this point, success, right? 339 00:18:23,600 --> 00:18:25,260 I've got this thing on the motherboard. 340 00:18:25,340 --> 00:18:26,300 I've got it programmed. 341 00:18:26,300 --> 00:18:27,380 I've got it hidden. 342 00:18:27,960 --> 00:18:28,720 Golden. 343 00:18:29,100 --> 00:18:34,440 Except, when I got to this point, which was really not too long ago. 344 00:18:34,440 --> 00:18:35,560 Because I've done all the tests. 345 00:18:35,560 --> 00:18:36,340 I knew it was fine. 346 00:18:36,340 --> 00:18:37,700 All I had to do was do this. 347 00:18:37,700 --> 00:18:39,780 And I'm ready for this presentation. 348 00:18:40,960 --> 00:18:43,980 When I booted it up, it didn't work. 349 00:18:44,660 --> 00:18:47,060 My attack came too late in the boot process. 350 00:18:47,060 --> 00:18:49,080 And we'll see why that is in a minute. 351 00:18:49,460 --> 00:18:59,780 It turns out that this motherboard does not turn the power on to the USB port until after the thing is booted. 352 00:18:59,960 --> 00:19:01,540 Who knew, right? 353 00:19:02,020 --> 00:19:05,420 Well, when I'm poking around on the board, I'm looking for 5 volts and I plug it up. 354 00:19:05,420 --> 00:19:07,400 You know, 5 minutes later, I find it. 355 00:19:07,440 --> 00:19:09,440 Who knew I had to wait for the boot cycle? 356 00:19:09,440 --> 00:19:10,920 So, now it's like it's the middle of the night. 357 00:19:10,920 --> 00:19:11,780 What am I going to do? 358 00:19:11,780 --> 00:19:14,980 I've got, you know, I've got the perfect place for it. 359 00:19:15,920 --> 00:19:23,000 I guess the worst case is I can pick another bodge wire and, you know, run it halfway across the motherboard and find 5 volts somewhere. 360 00:19:23,220 --> 00:19:25,920 But I found something else instead. 361 00:19:26,420 --> 00:19:28,140 I found this chip. 362 00:19:28,960 --> 00:19:33,720 This is the chip that controls the power to those USB ports. 363 00:19:33,720 --> 00:19:41,160 The computer sends it a signal and it takes 5 volts from this end line and it sends it out to the two ports. 364 00:19:41,460 --> 00:19:44,720 Out A and out B, those are those two USB ports. 365 00:19:44,720 --> 00:19:51,040 So, if I can manipulate this device, then I can have power there all the time. 366 00:19:51,600 --> 00:19:58,800 And, actually, the easiest way to manipulate this device was actually this. 367 00:19:59,340 --> 00:20:02,140 Anybody know what a solder bridge is? 368 00:20:03,260 --> 00:20:05,380 Generally, are they a good thing? 369 00:20:05,740 --> 00:20:06,700 No, right? 370 00:20:06,700 --> 00:20:07,640 Generally, they're a mistake. 371 00:20:07,640 --> 00:20:11,140 You accidentally connected two pins together with a big glob of solder. 372 00:20:11,260 --> 00:20:13,280 It might be overlooked, maybe. 373 00:20:13,280 --> 00:20:21,780 But, in this case, what it did was that it took the end 5 volts and directly connected it to that serial port all the time. 374 00:20:23,080 --> 00:20:27,100 This chip also will do overcurrent protection, so you lose that. 375 00:20:27,100 --> 00:20:31,600 But, you know, who really cares? 376 00:20:31,600 --> 00:20:32,800 Not me. 377 00:20:33,040 --> 00:20:35,860 So, I get to use a solder bridge as part of an attack. 378 00:20:35,860 --> 00:20:37,300 I just think that's cool. 379 00:20:37,580 --> 00:20:40,380 And no bodge wire to find 5 volts. 380 00:20:41,020 --> 00:20:42,220 So, it's installed. 381 00:20:42,220 --> 00:20:42,940 You've seen it. 382 00:20:42,940 --> 00:20:44,340 You know what it looks like? 383 00:20:44,340 --> 00:20:46,820 Where is the chip on this motherboard? 384 00:20:52,060 --> 00:20:54,240 Yeah, okay, the picture is kind of ugly. 385 00:20:54,680 --> 00:20:56,340 It is there! 386 00:20:57,600 --> 00:20:59,320 Alright, there it is! 387 00:20:59,320 --> 00:20:59,900 Yay! 388 00:21:00,800 --> 00:21:01,520 Okay. 389 00:21:02,960 --> 00:21:04,780 You can find it. 390 00:21:04,780 --> 00:21:10,660 Look, I can take a high schooler and I can teach him to look for bad solder joints, alright, because this is hand-soldered. 391 00:21:10,660 --> 00:21:12,580 It's not going to look as good as a machine soldering. 392 00:21:12,580 --> 00:21:15,920 But, it can take a little while. 393 00:21:16,440 --> 00:21:18,300 So, I put it on the motherboard, right? 394 00:21:18,560 --> 00:21:19,920 I'm going to put it somewhere. 395 00:21:20,560 --> 00:21:25,120 In this case, it's on the bottom of the motherboard, because that's where it fit better. 396 00:21:25,500 --> 00:21:33,620 Which means you have to take out 14 screws, pull out the front plate, pull out these little light pipes, take the motherboard out and turn it over to even be able to see it. 397 00:21:33,840 --> 00:21:42,180 So, when you get a brand new piece of equipment designed to protect your network, who, at first, takes it all apart and lays it across their desk before they begin? 398 00:21:43,260 --> 00:21:43,720 What? 399 00:21:47,100 --> 00:21:53,380 Alright, so, your boss will probably give you funny looks if you take all of your equipment apart very first. 400 00:21:54,920 --> 00:22:00,860 There's also another place to hide it, and this is my trade secret, so I'm just sharing it with you all. 401 00:22:02,060 --> 00:22:08,180 This is the RJ45 and the two USB ports in this metal can. 402 00:22:08,880 --> 00:22:19,800 If you flip this board over and unsolder these four points that holds this can on, in the back of this can, there's a hole about the same volume as in the front. 403 00:22:19,800 --> 00:22:22,660 I can stack up like 15 of those chips in there. 404 00:22:22,820 --> 00:22:26,320 So, you can put it in there, solder this tin back on it. 405 00:22:26,320 --> 00:22:33,340 Now, for somebody to find it, they have to take all the 14 screws out, they have to take the motherboard out, turn it upside down, they have to start desoldering all these cans. 406 00:22:33,340 --> 00:22:41,700 There are actually several of them around the motherboard, if you look, and see if Monty's hidden something stupid in one of them. 407 00:22:41,700 --> 00:22:43,500 So, not very likely. 408 00:22:44,040 --> 00:22:49,280 I didn't do that for this because I thought it wasn't fair, right, if you couldn't somehow see it. 409 00:22:49,280 --> 00:22:57,680 This is my... this is my, you know, emergency safety trick to solve all the problems. 410 00:22:57,680 --> 00:23:01,060 I found these really nice Warranty Voided for Mood stickers. 411 00:23:01,060 --> 00:23:05,660 They have holograms, they are individually serial numbered, they have a barcode. 412 00:23:05,660 --> 00:23:11,780 They even say, if you look carefully, it says genuine authentic in the hologram. 413 00:23:13,080 --> 00:23:13,800 Right? 414 00:23:14,260 --> 00:23:19,260 So, you slap that on the outside of the box, you've already eliminated 80% of the population right there. 415 00:23:19,260 --> 00:23:22,840 If you take some new pieces of equipment, the first thing you do is cut the warranty void. 416 00:23:24,340 --> 00:23:26,800 Alright, that's my backup plan. 417 00:23:27,800 --> 00:23:31,240 Alright, so, we are going to look at the video of the demo. 418 00:23:31,240 --> 00:23:32,820 Normally, 419 00:23:36,580 --> 00:23:39,900 I plug these up, but we're on a kind of short time frame. 420 00:23:39,900 --> 00:23:41,820 It's actually built in the bottom of this motherboard. 421 00:23:42,300 --> 00:23:49,660 Here is my test rig, by the way, in TSA-friendly Tupperware, so that I can travel with it. 422 00:23:49,660 --> 00:23:57,140 But, instead, let's go through a video. 423 00:24:06,870 --> 00:24:10,150 Alright, so, I will describe this as we go along. 424 00:24:10,150 --> 00:24:17,030 This top window is just capturing the data as it would look to the Cisco device. 425 00:24:17,030 --> 00:24:18,590 I'm not typing or anything. 426 00:24:19,370 --> 00:24:25,150 Anything that happens up here is the result of the Cisco device and this embedded chip that we've put in so far. 427 00:24:25,150 --> 00:24:34,810 You notice that there's a little timer that says, and that's just me highlighting it, a timer that says you can press escape to go into ROM-MOM mode. 428 00:24:34,990 --> 00:24:40,870 Alright, so, it presses escape and then it does this config register 0x41. 429 00:24:40,950 --> 00:24:44,970 This is what allows you to modify an existing piece of hardware. 430 00:24:44,970 --> 00:24:47,790 I got this off eBay with a full config installed. 431 00:24:47,790 --> 00:24:49,250 We'll talk about that offline. 432 00:24:50,910 --> 00:24:53,650 It allows me to boot it without knowing the password. 433 00:24:53,650 --> 00:25:04,890 So, now the implanted device, after it does that, and it boots, I might not know what the... it's booting blank, but I got in without a password. 434 00:25:04,970 --> 00:25:10,030 I don't know what their existing network is like, really, or what the existing network configuration is. 435 00:25:10,030 --> 00:25:19,050 So, the first thing that it does is it loads up the existing config that's stored on this device. 436 00:25:19,230 --> 00:25:22,970 And, we'll see that come up in a second. 437 00:25:22,970 --> 00:25:37,250 And then we're going to take that existing config and modify it, adding a SSH port, opening up a connection to the outside interface, which is probably connected to the internet, along with credentials that are only known to us. 438 00:25:37,410 --> 00:25:37,850 Right? 439 00:25:37,850 --> 00:25:38,570 That's nice. 440 00:25:38,570 --> 00:25:41,850 And this down here in the bottom is just a testing script I have running. 441 00:25:41,850 --> 00:25:43,950 I'm trying to ping this firewall. 442 00:25:43,950 --> 00:25:46,830 We see it's not responding yet because it's not booted. 443 00:25:48,130 --> 00:25:49,470 It's going to the config. 444 00:25:49,470 --> 00:25:50,830 It's generating the... right? 445 00:25:50,830 --> 00:25:54,390 If we're going to control this device remotely, we're going to do it securely, right? 446 00:25:54,390 --> 00:25:57,390 SSH all the way for the win. 447 00:25:58,850 --> 00:25:59,890 And so forth. 448 00:25:59,890 --> 00:26:02,730 So, you can follow along there for a second. 449 00:26:02,730 --> 00:26:12,210 One other little piece of magic tip is that you cannot see this happen if you plug into the console port. 450 00:26:12,210 --> 00:26:18,030 If you plug into the console port, the voltage overrides that small resistor and it doesn't happen. 451 00:26:18,190 --> 00:26:20,090 So, imagine you get this box. 452 00:26:20,090 --> 00:26:21,390 You plug it up. 453 00:26:21,510 --> 00:26:22,650 You configure it. 454 00:26:22,650 --> 00:26:23,510 It's all great. 455 00:26:23,510 --> 00:26:25,010 You will never see this happen. 456 00:26:25,090 --> 00:26:26,230 You unplug it. 457 00:26:26,230 --> 00:26:27,290 You put it in the rack. 458 00:26:27,290 --> 00:26:29,970 And then when you power it up, you're owned. 459 00:26:30,810 --> 00:26:34,990 Now, assuming you go back around and scan the machine and see there's something wrong with it, what do you do? 460 00:26:34,990 --> 00:26:36,590 Well, you try it two or three times. 461 00:26:36,590 --> 00:26:38,550 It keeps getting owned every time you reboot it. 462 00:26:38,550 --> 00:26:39,150 You pull it out. 463 00:26:39,150 --> 00:26:39,950 You put it on your desk. 464 00:26:39,950 --> 00:26:41,430 You connect the serial cable up to it. 465 00:26:41,430 --> 00:26:43,650 You're like, oh, you reconfigure it. 466 00:26:43,650 --> 00:26:44,450 It's great. 467 00:26:44,450 --> 00:26:45,590 You put it back in the rack. 468 00:26:45,590 --> 00:26:46,630 You reboot it. 469 00:26:46,770 --> 00:26:53,230 So, if you test your configs every month, I get an average of 15 days to screw with it. 470 00:26:53,230 --> 00:26:55,250 And you're going to pull it out at least once and put it back. 471 00:26:55,250 --> 00:26:57,690 So, I'll get two times 15 days. 472 00:26:57,970 --> 00:26:58,270 All right. 473 00:26:58,270 --> 00:27:04,190 In the bottom, we got the ping back and we... 474 00:27:04,850 --> 00:27:06,710 Let me get back up just a little bit. 475 00:27:06,710 --> 00:27:10,170 We saw that the SSH port was open. 476 00:27:10,170 --> 00:27:14,310 We connected with our credentials only known to us. 477 00:27:14,310 --> 00:27:21,650 And now we have enabled, which is admin-level access, and just printed out part of the config of this device. 478 00:27:21,650 --> 00:27:24,850 So , that's the plate demonstration. 479 00:27:24,850 --> 00:27:27,950 At some point, maybe we can do it live for real. 480 00:27:30,270 --> 00:27:31,790 That's pretty much it. 481 00:27:31,790 --> 00:27:32,710 I've got... 482 00:27:39,920 --> 00:27:43,300 So, Cisco defines this attack as password recovery. 483 00:27:43,300 --> 00:27:48,660 There's a document there that basically describes how you do this, sort of adding the accounts. 484 00:27:48,980 --> 00:27:55,540 We could make this more sophisticated, but not really. 485 00:27:55,560 --> 00:27:58,640 I used to call these attacks the Miyagi-style attacks. 486 00:27:58,660 --> 00:28:00,000 You remember the movie? 487 00:28:00,000 --> 00:28:03,840 He says, right, the creator's like, if do right, no can defend. 488 00:28:03,840 --> 00:28:06,760 So, you can't see it in the firmware. 489 00:28:06,760 --> 00:28:07,740 You can't detect it. 490 00:28:07,740 --> 00:28:09,100 It happens on its own. 491 00:28:09,100 --> 00:28:09,940 You can reflash it. 492 00:28:09,940 --> 00:28:10,820 It doesn't work. 493 00:28:10,820 --> 00:28:12,600 That's not quite true. 494 00:28:12,900 --> 00:28:27,580 If you pull your brand new equipment apart and look very carefully, look for rework, look for bad solder joints, and regularly baseline your equipment, look to see if it's changed, in-map it, check the configs and so forth, that's your opportunity. 495 00:28:28,400 --> 00:28:30,600 Alright, that's it. 496 00:28:30,600 --> 00:28:32,240 What I've learned is this really isn't very hard. 497 00:28:32,240 --> 00:28:33,720 I did this in my basement. 498 00:28:34,000 --> 00:28:37,000 You know, I'm okay, but I'm not that good at it. 499 00:28:37,000 --> 00:28:40,220 You could get this and follow along if you've done any hobbyist work. 500 00:28:40,540 --> 00:28:45,060 I think, really though, it's a pain in the butt to do, and nobody's going to do that. 501 00:28:45,060 --> 00:28:47,300 This is currently only for targeted attacks. 502 00:28:47,300 --> 00:28:49,220 Why only targeted attacks? 503 00:28:49,600 --> 00:28:52,380 Because your security sucks, right? 504 00:28:52,400 --> 00:28:57,880 Cisco's had lots of vulnerabilities in their firmware, and you don't even have to modify it to get there. 505 00:28:57,880 --> 00:28:59,880 So, I'm Monte Elkins. 506 00:28:59,880 --> 00:29:01,660 Catch up with me on Twitter. 507 00:29:01,660 --> 00:29:03,880 Don't forget to do Coke and Strippers. 508 00:29:03,880 --> 00:29:05,580 I mean, the YouTube channel. 509 00:29:05,900 --> 00:29:07,500 And we'll see you next time, DEF CON. 510 00:29:07,500 --> 00:29:08,400 Thank you very much.