1 00:00:00,000 --> 00:00:02,160 All right now, wasn't that fun? 2 00:00:07,020 --> 00:00:11,340 So, yeah, I had to do that, got forced to do that. 3 00:00:11,740 --> 00:00:19,100 Good morning, everyone. I'm FX, this is FTR, and we're from Phenolite, nobody can pronounce that. 4 00:00:19,880 --> 00:00:25,480 And we're talking about attacking network-embedded systems, all kinds of, actually. 5 00:00:25,480 --> 00:00:32,020 Yeah, what are we going to do? It's like today's session over here. 6 00:00:32,140 --> 00:00:35,480 I can't see my screen, so I have to look over there all the time. 7 00:00:36,140 --> 00:00:41,500 We're talking about design failures. Actually, FTR is going to cover some neat shit you can do with printers. 8 00:00:43,060 --> 00:00:45,700 Basically, complimentary to Little Wolf's talk yesterday. 9 00:00:46,620 --> 00:00:50,580 And we, of course, released some tools, so you guys have some fun. 10 00:00:52,300 --> 00:00:55,300 And, yeah, after that, we talk about software vulnerability. 11 00:00:55,480 --> 00:01:03,600 And embedded systems, get some examples out, and then run a tutorial on how to root a Cisco. 12 00:01:04,180 --> 00:01:06,260 So, I pass on to FTR. 13 00:01:08,080 --> 00:01:08,980 Thanks for that. 14 00:01:11,120 --> 00:01:15,420 Okay, first, we have to define somehow what, for us, an embedded system is. 15 00:01:15,800 --> 00:01:24,940 And for the purpose of this speech, we think about an embedded system just as a small computer device running its custom OS. 16 00:01:25,480 --> 00:01:28,580 Which is used for one particular job. 17 00:01:28,840 --> 00:01:31,460 And, yeah, it's actually something small. 18 00:01:31,620 --> 00:01:34,260 It doesn't need a keyboard or a screen or something like that. 19 00:01:34,500 --> 00:01:41,680 And it's more fun if it has some kind of network connection, so that we can play with it and we'll have some fun. 20 00:01:42,840 --> 00:01:46,780 What are the most common problems with embedded systems? 21 00:01:49,380 --> 00:01:55,320 Obviously, since nobody is thinking about attacking them, the operating system itself covers... 22 00:01:55,480 --> 00:02:05,840 ...lots of undocumented functionality, which is still hidden, and therefore, normally, developers leave back some backdoors from the beginning of the development. 23 00:02:06,280 --> 00:02:14,100 And you can still access these functionalities, and so you can play with the system and have some more fun. 24 00:02:14,260 --> 00:02:23,360 And there are lots of different other features, like auto-do-something functions, which basically means you get a system out of the box and start it, and it's getting, from somewhere, a configuration. 25 00:02:23,600 --> 00:02:25,400 And therefore, some kind of... 26 00:02:25,400 --> 00:02:29,420 ...communication required, and sometimes, you can break into these protocols and have some fun with it. 27 00:02:31,420 --> 00:02:39,400 Finally, the biggest problem for the developers of these kinds of systems is that marketing comes up with a cool new feature that's required on a marketplace. 28 00:02:39,640 --> 00:02:46,160 Everything is fine, we're going to need this, and they enforce the developers to bring it out, and bring it up and running, and they develop it. 29 00:02:46,340 --> 00:02:54,480 And the time frame is really short and really limited, and so nobody is able to spend a solid security on how the new feature impacts the original design. 30 00:02:55,400 --> 00:02:56,240 And that's why we're going to need this embedded system. 31 00:02:59,040 --> 00:03:01,160 Okay, let's have some examples. 32 00:03:02,560 --> 00:03:04,760 Our first example will be the Lucent Brick. 33 00:03:05,180 --> 00:03:08,040 Lucent Brick actually is a really cool, really... 34 00:03:12,000 --> 00:03:20,300 ...handy layer 2 firewall, which is certified from the NSA, and seems to be secure, but it somehow has some problems with the ARP functionality. 35 00:03:21,200 --> 00:03:21,560 And the... 36 00:03:23,380 --> 00:03:24,780 What was the beam over there? 37 00:03:24,920 --> 00:03:25,380 Oh, it's the ARP. 38 00:03:29,820 --> 00:03:45,800 The ARP functionality in there has some really, really, really important problems, like at first, the biggest problem is that all ARP traffic will be forwarded to any... 39 00:03:45,800 --> 00:03:46,340 I hate that. 40 00:03:48,480 --> 00:03:49,640 Oh, thanks. 41 00:03:51,560 --> 00:03:55,380 All ARP traffic from a brick, through a brick, is forwarded to any... 42 00:03:55,400 --> 00:03:59,020 ...network segment this brick firewall is based on. 43 00:03:59,640 --> 00:04:08,460 And so, with the user knowing that ability, you can do an ARP sweep through the whole network, regardless what the firewall rule itself says. 44 00:04:08,520 --> 00:04:09,700 And that might be a big problem. 45 00:04:10,740 --> 00:04:21,700 Actually, a firewall is supposed to block traffic somehow, and if you use the blocking feature as firewall rules and it's still forwarding traffic, I mean, what's the use in that? 46 00:04:23,000 --> 00:04:25,380 The next problem in here is... 47 00:04:25,380 --> 00:04:27,700 ...is that you will be able to... 48 00:04:28,560 --> 00:04:31,380 ...poisoning the ARP table itself. 49 00:04:31,900 --> 00:04:42,480 If you just send an ARP reply at this normal C9 network, it will insert this entry into the ARP table and replace the existing one. 50 00:04:42,880 --> 00:04:44,080 And therefore, we have a cool example. 51 00:04:44,340 --> 00:04:47,700 The management server on top of the system... 52 00:04:49,620 --> 00:04:50,260 Thanks. 53 00:04:50,680 --> 00:04:54,280 ...is actually the heartbeat of the whole box. 54 00:04:54,280 --> 00:04:58,120 I mean, all configuration, all logging, everything is done on this and with this server. 55 00:04:58,340 --> 00:04:59,960 And therefore, it's really needful. 56 00:05:00,140 --> 00:05:10,220 And if you send in a spoofed ARP reply with the IP address of that server and another MAC address, the brick firewall will insert this one into its own ARP table. 57 00:05:10,640 --> 00:05:14,560 And will replace the ARP to the MAC address from the management server. 58 00:05:14,760 --> 00:05:16,000 And you guess what? 59 00:05:16,120 --> 00:05:18,540 The solution, the result of this is... 60 00:05:18,540 --> 00:05:21,760 ...yeah, the management server goes away and is no longer available. 61 00:05:22,220 --> 00:05:23,920 And what that means for us is... 62 00:05:23,920 --> 00:05:25,840 ...actually, no logging, no more management. 63 00:05:26,120 --> 00:05:27,560 I mean, then that's when the fun begins. 64 00:05:27,800 --> 00:05:27,920 Okay? 65 00:05:32,080 --> 00:05:33,520 I mean, this is one point. 66 00:05:33,700 --> 00:05:39,440 And it becomes harder since the whole ARP functionality is not stateful as it is supposed to be. 67 00:05:39,620 --> 00:05:42,860 You can send in tons of ARP replies. 68 00:05:43,120 --> 00:05:45,600 They never ask it for and it will fill out the ARP table. 69 00:05:45,780 --> 00:05:49,580 That means normally it's not a problem since the ARP cache is supposed to time out. 70 00:05:49,700 --> 00:05:53,680 But loose and brick firewall doesn't even let the ARP cache time out. 71 00:05:53,920 --> 00:05:58,560 So far you just fill up the ARP table till all the memory is exhausted and the machine crashes. 72 00:05:58,980 --> 00:06:03,600 And I think that's something different than I would expect from an NSA certified device. 73 00:06:06,980 --> 00:06:07,660 That's it. 74 00:06:09,820 --> 00:06:12,040 Maybe, maybe the NSA wants to have it that way. 75 00:06:12,080 --> 00:06:12,480 Who knows? 76 00:06:13,940 --> 00:06:17,960 The next example we have over here is from Ascend routers. 77 00:06:18,740 --> 00:06:22,460 The Ascend routers themselves uses an undocumented discovery protocol. 78 00:06:22,460 --> 00:06:26,360 Which is sent to the discard port. 79 00:06:26,600 --> 00:06:30,960 And normally you would expect that the discard port discards the packet while that's what it's used for. 80 00:06:31,060 --> 00:06:34,520 But no, we adapt this time and we do something different. 81 00:06:34,720 --> 00:06:36,400 Lost the idea by Ascend. 82 00:06:36,680 --> 00:06:42,720 And so when you send the right packet to this port you will get a new packet with lots of nice informations on it. 83 00:06:42,900 --> 00:06:50,140 These informations contain the IP addresses, the MAC addresses, the names, even what kind of devices you will find on the machine. 84 00:06:50,320 --> 00:06:52,440 Like T1 interface or something like that. 85 00:06:52,440 --> 00:06:55,440 I mean that's one thing. 86 00:06:55,560 --> 00:06:56,860 You can gather some information. 87 00:06:57,100 --> 00:07:03,000 But if you use that packet and change the values and send it right back and use the SNMP write community. 88 00:07:03,300 --> 00:07:05,340 Which is by guideline write. 89 00:07:05,700 --> 00:07:07,480 You can change these values. 90 00:07:07,740 --> 00:07:12,600 And obviously you don't want that someone is changing the IP address of your T1 interface. 91 00:07:16,460 --> 00:07:17,020 Okay. 92 00:07:17,140 --> 00:07:18,100 The next point. 93 00:07:18,840 --> 00:07:19,840 HP printers. 94 00:07:20,580 --> 00:07:21,600 HP printers. 95 00:07:22,440 --> 00:07:25,020 They are quite handy and useful for printing. 96 00:07:25,500 --> 00:07:31,880 And to configure these machines you can have several ways of accessing these machines. 97 00:07:32,040 --> 00:07:34,540 Like HTTP, Telenet, FTP, whatever. 98 00:07:34,940 --> 00:07:40,520 The most important ones are the HTTP port and the PJL port. 99 00:07:40,720 --> 00:07:45,420 Which allows you different information gathered from the machine. 100 00:07:46,400 --> 00:07:48,860 HP thought about security in some way. 101 00:07:48,980 --> 00:07:52,320 And introduced several ways of access this restriction. 102 00:07:52,440 --> 00:07:55,140 So it seems to be pretty cool. 103 00:07:55,300 --> 00:07:57,480 But there is one little problem. 104 00:07:57,620 --> 00:08:01,240 You have someone who thought about security. 105 00:08:01,560 --> 00:08:03,020 And the other one thought about usability. 106 00:08:03,920 --> 00:08:05,740 They are sitting far away in HP. 107 00:08:05,880 --> 00:08:09,180 And they don't know each other until we come to one major problem. 108 00:08:10,060 --> 00:08:14,300 For example, with only the knowledge of the SNMP read community. 109 00:08:14,680 --> 00:08:22,200 You can gather with this SNMP variable the HTTP password for full access. 110 00:08:22,200 --> 00:08:24,980 And once you got this, the printer is more or less yours. 111 00:08:27,160 --> 00:08:27,640 Okay. 112 00:08:27,680 --> 00:08:29,600 Next up is HTTP printers. 113 00:08:30,400 --> 00:08:30,880 PJL. 114 00:08:31,840 --> 00:08:32,320 PJL. 115 00:08:32,720 --> 00:08:35,100 It's supposed to be the printer job language. 116 00:08:35,380 --> 00:08:40,400 And normally whenever you do something with a printer and you print something out, you use this PJL. 117 00:08:40,840 --> 00:08:41,940 This is quite cool. 118 00:08:42,560 --> 00:08:44,500 You send out your stuff in that there. 119 00:08:44,580 --> 00:08:46,700 And you have some environment variables you can use it for. 120 00:08:47,280 --> 00:08:48,960 How many copies you want to print. 121 00:08:50,520 --> 00:08:51,000 Yeah. 122 00:08:51,000 --> 00:08:52,560 Which paper tray you want to use. 123 00:08:52,760 --> 00:08:53,800 And all this information. 124 00:08:53,800 --> 00:08:54,720 This is quite easy. 125 00:08:54,820 --> 00:08:55,760 And quite handy. 126 00:08:55,800 --> 00:08:57,220 And you very often use it. 127 00:08:57,700 --> 00:09:04,900 The whole security on even PJL for the environment variables is based on one single password. 128 00:09:05,020 --> 00:09:10,120 Which is actually a number between 1 and 65,535. 129 00:09:10,560 --> 00:09:15,120 And easily you can remotely brute force this in within six hours. 130 00:09:15,180 --> 00:09:17,580 And I mean, what kind of security is this in here? 131 00:09:18,500 --> 00:09:19,020 Okay. 132 00:09:19,060 --> 00:09:19,720 Let's go on. 133 00:09:19,780 --> 00:09:20,620 This is the PJL. 134 00:09:30,520 --> 00:09:31,000 PJL. 135 00:09:31,000 --> 00:09:31,640 That's what I want to go to. 136 00:09:32,460 --> 00:09:36,480 PJL also allows you access to the file system of the printer itself. 137 00:09:36,700 --> 00:09:39,240 I mean, it's a cool idea that the new printers. 138 00:09:40,940 --> 00:09:41,420 PJL. 139 00:09:41,800 --> 00:09:42,400 It's nice. 140 00:09:44,060 --> 00:09:44,860 My fault. 141 00:09:45,720 --> 00:09:46,200 PJL. 142 00:09:46,340 --> 00:09:46,820 Anyway. 143 00:09:48,540 --> 00:09:49,020 Yeah. 144 00:09:49,220 --> 00:09:50,980 PJL itself gives you access to the printer. 145 00:09:50,980 --> 00:09:55,040 file system of the printer. And with that file system, you will find lots of 146 00:09:55,040 --> 00:09:58,780 needful things like the firmware of the printer, like the print jobs, 147 00:09:59,320 --> 00:10:03,000 everything that's going on in the printer that's actually based on that 148 00:10:03,000 --> 00:10:06,300 file system. Once you have access to it, you can manipulate it in the way you like it. 149 00:10:07,540 --> 00:10:10,080 For example, we have here, it should be coming now. 150 00:10:14,720 --> 00:10:16,200 This is actually the 151 00:10:16,680 --> 00:10:20,920 one printer of the file system. It's a file system as you know it normally from every other 152 00:10:20,920 --> 00:10:24,920 system. It's just file entries, files you can 153 00:10:24,920 --> 00:10:28,480 copy, you can download, you can do whatever you want. You can create software like 154 00:10:28,480 --> 00:10:30,480 everything you need is on that machine. 155 00:10:39,280 --> 00:10:42,960 In order to get the PGL interface much more handy 156 00:10:42,960 --> 00:10:46,980 for you guys, we developed two kinds of tools. The first tool we developed is a command line 157 00:10:46,980 --> 00:10:50,040 tool. With that command line tool, you can access 158 00:10:51,360 --> 00:10:57,300 the file system, even the environment variables and all that stuff. This is running from the same 159 00:10:57,300 --> 00:11:01,340 source through our Windows and our Linux. It's really cool. It's really handy. The screenshot 160 00:11:01,340 --> 00:11:06,060 you have seen earlier is actually out of this tool. And for all the guys who don't like any 161 00:11:06,060 --> 00:11:15,480 kind of command line tools and need something to click on, we created a really, really nice 162 00:11:15,480 --> 00:11:17,280 looking tool that's called HiJetter. 163 00:11:27,040 --> 00:11:50,900 Ok, this is the basic interface. I mean it's very complicated to use. You have to type in the IP address in the right port which is more or less always the same. And just connect to the printer and then you will have access to the environment variables, the file system or even the display. For example, right here, you have the file system. On the left-hand side you have your local system and on the right-hand side you have the system of the printer. Just to get sure that you know how to use this system. 164 00:11:50,920 --> 00:11:59,420 two, okay? And as you can see, there you have the web server staff, the firmware staff, 165 00:11:59,620 --> 00:12:05,440 and everything you want to get on. The second is just for setting environment variables. 166 00:12:06,400 --> 00:12:12,440 Then there's a third dialog for setting display message. One cool thing is we have done, and 167 00:12:12,440 --> 00:12:17,840 we really scared people with their following idea, just setting the environment variable 168 00:12:17,840 --> 00:12:22,040 for locking the printer panel, so that nobody can go on the printer and switch on ready 169 00:12:22,040 --> 00:12:26,740 or something like that, and change the display message as a failure to insert coin. People 170 00:12:26,740 --> 00:12:27,800 get scared of that. 171 00:12:36,940 --> 00:12:39,280 Oh, shit. Okay, now I have to hurry up a bit. 172 00:12:40,560 --> 00:12:46,800 Another new feature within HP printers is ChaiVM. ChaiVM is a Java virtual machine, which 173 00:12:46,800 --> 00:12:47,260 is... 174 00:12:47,840 --> 00:12:54,440 introduced by HP normally for printers, but ChaiVM also, and that's a statement quoted 175 00:12:54,440 --> 00:12:58,600 from HP, and the last sentence is the most interesting. These appliances are powered 176 00:12:58,600 --> 00:13:04,280 by HP Chai-embedded software. That basically means HP is not going to do this only to supply 177 00:13:04,280 --> 00:13:09,740 printers with ChaiVM, also other systems. And that's where it comes interesting, because 178 00:13:09,740 --> 00:13:17,820 ChaiVM allows you to insert new modules onto the system. And that's a very interesting 179 00:13:17,840 --> 00:13:24,820 system to run your own services on a printer. In order to do this, HP introduced one service 180 00:13:24,820 --> 00:13:29,900 that's called ThisIs.Loader. This is a nice and really, really cool security feature that 181 00:13:29,900 --> 00:13:37,080 all the new servers you want to introduce has to be signed by HP. But it wasn't that 182 00:13:37,080 --> 00:13:42,160 stale as it should be, so HP released a new loader, the Easy Loader. The Easy Loader is 183 00:13:42,160 --> 00:13:46,520 a signed Java packet, so that you can upload it to the printer, but if you get this one 184 00:13:46,520 --> 00:13:47,720 running, you don't need... 185 00:13:47,720 --> 00:13:53,460 to get your new Java packet just signed in some, or you can just upload any kind of stuff 186 00:13:53,460 --> 00:14:00,220 you want to do. That's the complicated way and the more easiest way. Both of these loaders 187 00:14:00,220 --> 00:14:05,840 are actually nothing else to... and do nothing else than transforming the CS config file, 188 00:14:05,920 --> 00:14:09,140 which is based in a file system. Once you have access to the file system, you change 189 00:14:09,140 --> 00:14:16,620 this file, load it in your app, and yep, you have uploaded your new service. I think 190 00:14:16,620 --> 00:14:22,480 I'm going to skip this one, because we are a bit in a hurry. Anyway, as far as we have 191 00:14:22,480 --> 00:14:32,140 played with Chaibeam, Chaibeam is very stable. We had real problems with the development 192 00:14:32,140 --> 00:14:36,680 environment. You can get the HP in the real world. Something that runs in a development 193 00:14:36,680 --> 00:14:43,660 environment not necessarily must run stable on the printer. And, yeah, therefore, very 194 00:14:43,660 --> 00:14:46,600 often to use the... there's an impure way to reset the printer, but it's not going to 195 00:14:46,620 --> 00:14:49,480 do that. You get the Chai stuff up and running without going on the machine. 196 00:14:50,620 --> 00:14:58,880 What you can do with Chaibeam... yeah. What you can do with Chaibeam, we have developed 197 00:15:00,240 --> 00:15:04,740 one port scanner, which is actually running on the printer and scanning from the printer 198 00:15:04,740 --> 00:15:09,060 the remote network, so that we might just kick this on, wait a while, come back and 199 00:15:09,060 --> 00:15:13,460 get results. And that's more than funny. I mean, I don't even have to be on site. I'm 200 00:15:13,460 --> 00:15:14,080 using a printer. 201 00:15:17,160 --> 00:15:21,380 The next thing is, we decided that we don't want to spend power circuits on 202 00:15:21,380 --> 00:15:25,060 all laptops. We decided to use the printer for that. And we implemented a Chai Cracker, 203 00:15:25,160 --> 00:15:30,100 which is used to just break cryptic passwords, and somehow... 204 00:15:32,200 --> 00:15:36,580 The summarization of that is, everything you get running with Java, that you get running 205 00:15:36,580 --> 00:15:40,780 on the printer, you can do with the printer. I mean, this is fun, isn't it? I mean, the 206 00:15:40,780 --> 00:15:44,880 printer is not anymore a printer. It's more, it's actually a full powered machine you can 207 00:15:44,880 --> 00:15:45,380 play with. 208 00:15:48,000 --> 00:15:53,540 This is actually a screenshot from the Crypt Cracker running on the printer. 209 00:15:55,980 --> 00:16:01,160 The last thing I want to describe here is that there are already lots of nice services 210 00:16:01,160 --> 00:16:02,700 with Chai in the wild available. 211 00:16:03,180 --> 00:16:05,740 The most interesting are two ones of them. 212 00:16:05,840 --> 00:16:06,900 The one is the Notifier Service. 213 00:16:07,340 --> 00:16:12,900 The Notifier Service enables you to get a notification when something nice is going 214 00:16:12,900 --> 00:16:13,800 on on the printer. 215 00:16:13,800 --> 00:16:18,000 Maybe your boss is printing something after six and you want to know what it is, you get 216 00:16:18,000 --> 00:16:19,300 an email and you know what it is. 217 00:16:22,200 --> 00:16:24,800 And the last service, quite cool, is the Email Service. 218 00:16:25,380 --> 00:16:30,920 You can configure your printer to pull a certain pop account somewhere in the wild world. 219 00:16:32,800 --> 00:16:37,080 And whenever you send the right formatted email to this pop account, the printer pulls 220 00:16:37,080 --> 00:16:39,460 it down and executes a command which is hidden in. 221 00:16:39,760 --> 00:16:41,020 What does that mean to us? 222 00:16:41,180 --> 00:16:43,540 We just jump on the network, pick up the printer. 223 00:16:43,540 --> 00:16:46,940 We implement that service and whatever you do with your firewall, I don't care. 224 00:16:47,060 --> 00:16:51,420 As long as you let POP3 going out of the network, I can play with your printer. 225 00:16:51,540 --> 00:16:52,760 I don't need to be on site anymore. 226 00:16:55,080 --> 00:16:56,420 That's it from my side currently. 227 00:16:57,100 --> 00:17:01,060 All the stuff we have done you will find on finality.hp. 228 00:17:02,300 --> 00:17:03,760 You can download it from there. 229 00:17:04,060 --> 00:17:10,060 You will find there the command line tools, some of the Chai services, and even the Hydra 230 00:17:10,060 --> 00:17:10,440 as well. 231 00:17:11,100 --> 00:17:12,560 Now I have to hand over to TC. 232 00:17:13,540 --> 00:17:13,700 FX. 233 00:17:14,420 --> 00:17:16,660 Anyway, different style, different area. 234 00:17:17,340 --> 00:17:21,260 He wants you to describe software vulnerabilities and have some fun with Cisco. 235 00:17:22,940 --> 00:17:23,840 Thanks, FDR. 236 00:17:31,420 --> 00:17:33,560 Hey, hey, hey, don't waste my time, okay? 237 00:17:34,880 --> 00:17:36,000 Software vulnerabilities. 238 00:17:36,620 --> 00:17:38,300 I mean, yeah. 239 00:17:41,700 --> 00:17:46,960 Just try to figure out how to spell our website and then put slash HP on it. 240 00:17:49,880 --> 00:17:51,260 Okay, software vulnerabilities. 241 00:17:52,500 --> 00:17:56,060 Well, embedded systems actually are just a bunch of codes. 242 00:17:56,300 --> 00:18:00,300 So, and the guys who code it are just a bunch of developers. 243 00:18:02,620 --> 00:18:07,660 So, they do the same faults like Windows and Unix coders do, which basically is like 244 00:18:07,660 --> 00:18:08,460 input validation. 245 00:18:08,720 --> 00:18:09,660 We all know that stuff. 246 00:18:10,180 --> 00:18:12,520 Format strings, especially in the logging code. 247 00:18:12,800 --> 00:18:13,720 It's real bad. 248 00:18:15,080 --> 00:18:16,940 Buffer overflows, well-known stuff. 249 00:18:17,220 --> 00:18:21,340 I mean, even some buffer overflows on embedded systems got published to bug trick. 250 00:18:21,740 --> 00:18:24,680 And yes, you can do crosshead scripting on it. 251 00:18:24,780 --> 00:18:26,860 Actually, the HP printers are one example. 252 00:18:27,020 --> 00:18:30,200 You just go in, enter some additional information. 253 00:18:30,200 --> 00:18:31,400 It will show up on the website. 254 00:18:31,640 --> 00:18:33,200 And of course, it's crosshead scriptable. 255 00:18:33,740 --> 00:18:37,640 So, yeah, most embedded HTTP daemons I played with died pretty quickly. 256 00:18:37,640 --> 00:18:39,040 Like within five minutes. 257 00:18:39,880 --> 00:18:44,860 I never saw a rock-stable HTTP daemon for embedded systems. 258 00:18:45,720 --> 00:18:53,020 So, yeah, summary, limited resources lead to the fact that the developers think, oh, 259 00:18:53,040 --> 00:18:57,960 well, I skipped that check, I skipped that check, and the user's going to be nice. 260 00:18:59,540 --> 00:19:03,440 Buffer overflows, we have like four, just for starters. 261 00:19:04,760 --> 00:19:06,880 ZDR routers, quite nice routers. 262 00:19:07,640 --> 00:19:11,580 Actually, Ellucian product, actually pretty good routers. 263 00:19:11,700 --> 00:19:14,160 And they have an HTTP daemon. 264 00:19:14,540 --> 00:19:17,200 You do a long get request, you crash the router. 265 00:19:17,760 --> 00:19:19,640 I mean, it's so plain simple. 266 00:19:20,660 --> 00:19:22,680 Brother network printer, same thing. 267 00:19:22,920 --> 00:19:25,500 But you don't actually have to do a long get request. 268 00:19:25,660 --> 00:19:28,240 You just go to the Brother printer, to the web page. 269 00:19:28,440 --> 00:19:30,500 It asks you for the administrator password. 270 00:19:30,820 --> 00:19:33,820 You put over 100 characters in, click submit, it dies. 271 00:19:36,240 --> 00:19:36,760 HP. 272 00:19:36,760 --> 00:19:38,280 They did a cool switch. 273 00:19:38,580 --> 00:19:39,100 Prokoff. 274 00:19:40,280 --> 00:19:44,580 Actually, that vulnerability is pretty neat, because normally with SNMP right, you would 275 00:19:44,580 --> 00:19:46,120 really badly abuse the switch. 276 00:19:46,320 --> 00:19:47,580 No, you don't do that. 277 00:19:47,660 --> 00:19:52,460 You just fill that variable over here with 85 characters, and it doesn't die. 278 00:19:52,580 --> 00:19:56,360 No, it dies next time the admin tries to access the printer switch. 279 00:19:59,080 --> 00:20:00,140 That's like awesome. 280 00:20:00,560 --> 00:20:05,960 And, of course, even like cigarette box sized devices. 281 00:20:05,960 --> 00:20:09,580 And for the non-smokers, this is how a cigarette box looks like. 282 00:20:11,420 --> 00:20:13,380 There's a print service hanging off printers. 283 00:20:14,000 --> 00:20:16,480 They actually have the same vulnerabilities. 284 00:20:17,260 --> 00:20:18,680 You go to the print server. 285 00:20:18,880 --> 00:20:20,460 It asks you for a password. 286 00:20:20,600 --> 00:20:21,280 Guess what you do? 287 00:20:21,340 --> 00:20:22,320 You put a bunch of As in. 288 00:20:22,480 --> 00:20:23,360 You click submit. 289 00:20:23,520 --> 00:20:25,000 It dies, and it takes the printer with it. 290 00:20:26,540 --> 00:20:27,920 That's actually how the device looks. 291 00:20:28,200 --> 00:20:29,540 I mean, it's innocent, isn't it? 292 00:20:31,680 --> 00:20:32,120 Yeah. 293 00:20:32,320 --> 00:20:33,240 Common misconceptions. 294 00:20:33,240 --> 00:20:38,580 Stuff I always hear about exploiting embedded systems, it's like, it's so hard. 295 00:20:38,700 --> 00:20:41,940 It's way harder than writing a hack for Windows. 296 00:20:43,320 --> 00:20:48,060 I mean, you really have to reverse engineer the full firmware to find out how it's going. 297 00:20:48,440 --> 00:20:54,500 And then you really need to know how the syscalls work and how the libraries all get in and all that. 298 00:20:54,800 --> 00:20:58,540 And basically the worst thing that can happen is the device crashes. 299 00:20:59,300 --> 00:21:00,200 You know what? 300 00:21:05,500 --> 00:21:12,080 And, yeah, for all the guys here just don't know what to do after DEF CON, and to prove 301 00:21:12,080 --> 00:21:17,200 that wrong and make sure embedded system vendors actually understand that they should care 302 00:21:17,200 --> 00:21:24,380 about security and get some good coders, we're going to do a kind of tutorial on how 303 00:21:24,380 --> 00:21:25,940 to write exploits for iOS. 304 00:21:26,380 --> 00:21:29,480 So, now we go to some heavy duty shit. 305 00:21:31,100 --> 00:21:33,100 Actually, yeah, the problem here is... 306 00:21:33,240 --> 00:21:36,780 If you do something to a Cisco router, it will crash. 307 00:21:36,980 --> 00:21:37,780 I mean, honestly. 308 00:21:37,920 --> 00:21:39,720 If it doesn't feel good, it will crash. 309 00:21:41,240 --> 00:21:45,900 They have a bunch of platforms, so we need something that is, like, widely used. 310 00:21:46,400 --> 00:21:51,220 And, of course, we can't go to, like, ios.sourceforge.net and check out how it works. 311 00:21:52,560 --> 00:22:01,280 Actually, this is from the Cisco TFTP advisory saying that the worst thing that can happen is that the Cisco crashes. 312 00:22:01,820 --> 00:22:02,940 Let's see if that's true. 313 00:22:04,620 --> 00:22:05,180 Yeah. 314 00:22:05,920 --> 00:22:09,260 According to Cisco, the biggest problem are memory corruptions. 315 00:22:09,300 --> 00:22:12,800 Actually, 85% of all iOS bugs are memory corruptions. 316 00:22:12,900 --> 00:22:23,020 Now, if you put a bunch of A's somewhere in and it dies and it is a memory corruption, you can guess it is a heap exploit or at least a heap overflow. 317 00:22:23,440 --> 00:22:24,880 Let's see if we can explore that. 318 00:22:25,360 --> 00:22:31,520 So, to research the vulnerability, we actually found something with a TFTP server. 319 00:22:31,520 --> 00:22:35,080 Nobody uses it anyway, but we needed some to research it. 320 00:22:35,760 --> 00:22:37,020 It's just a lame bug. 321 00:22:37,340 --> 00:22:41,900 I mean, you send a TFTP request with a long file name, it crashes. 322 00:22:42,460 --> 00:22:42,980 Good. 323 00:22:43,120 --> 00:22:47,880 Actually, someone said yesterday to me that this was already published two years ago. 324 00:22:47,960 --> 00:22:50,080 So, if that's the case, I'm sorry. 325 00:22:52,220 --> 00:22:52,740 Okay. 326 00:22:52,960 --> 00:22:53,900 Taking it apart. 327 00:22:54,180 --> 00:23:00,460 Then, if we get, like, a crash dump on the console, that's basically one part of it. 328 00:23:00,460 --> 00:23:01,180 That's how it looks. 329 00:23:01,440 --> 00:23:12,060 So, without doing all that IDE stuff on the iOS image, we just do a correlation between the crash dump, this kind of info, core dumps, all kinds of stuff. 330 00:23:12,300 --> 00:23:13,860 And what we find out is this. 331 00:23:14,520 --> 00:23:16,520 Look, we have a block magic. 332 00:23:16,700 --> 00:23:18,240 This is like, okay, I start here. 333 00:23:18,440 --> 00:23:19,100 Common sense. 334 00:23:20,440 --> 00:23:22,940 The next thing is probably the process ID. 335 00:23:23,860 --> 00:23:26,960 I can't think of anything else that needs a 2 in here. 336 00:23:27,520 --> 00:23:30,180 Then, we have a memory block that is later. 337 00:23:30,460 --> 00:23:32,260 In memory, like, higher up. 338 00:23:32,360 --> 00:23:34,620 And also starts with the block magic. 339 00:23:34,820 --> 00:23:36,360 So, it's probably the next block. 340 00:23:36,520 --> 00:23:40,780 And if something points lower in memory, it might be the previous block. 341 00:23:41,740 --> 00:23:51,700 And, yeah, finally, we have the size over there with a quite funny, most significant bit, which we found out is used for, is that block in use or not? 342 00:23:53,640 --> 00:23:55,800 So, again, going to Cisco's website. 343 00:23:55,940 --> 00:23:57,740 They're all verbose about it. 344 00:23:58,520 --> 00:24:00,440 We check which memory address it is. 345 00:24:00,460 --> 00:24:00,920 Which addresses are used. 346 00:24:01,160 --> 00:24:05,660 Just to make sense of it, we check, oh, here, these are the models we have in the lab. 347 00:24:05,840 --> 00:24:11,700 So, and, of course, we are most interested in the NVRAM because it stores the config. 348 00:24:13,760 --> 00:24:17,240 So, putting it together, that's basically how it looks. 349 00:24:17,300 --> 00:24:19,120 Oh, great, you don't even see the errors. 350 00:24:20,800 --> 00:24:22,900 Yeah, let's do some laser pointer magic here. 351 00:24:23,720 --> 00:24:24,980 We have the magic block. 352 00:24:25,260 --> 00:24:26,300 We have the PID. 353 00:24:26,420 --> 00:24:27,840 We have some addresses. 354 00:24:27,960 --> 00:24:29,580 I mean, that's like serious overhead. 355 00:24:30,460 --> 00:24:32,880 We have the next pointer, previous pointer. 356 00:24:33,060 --> 00:24:34,320 Then we have size and usage. 357 00:24:34,700 --> 00:24:36,760 Then we have some field that's mostly one. 358 00:24:36,920 --> 00:24:41,460 I don't really care about it, but it's called RFCNT. 359 00:24:42,040 --> 00:24:43,600 For me, that sounds like reference count. 360 00:24:44,380 --> 00:24:51,960 And then we have a red zone that's basically a canary and makes sure that iOS catches it when it overflows the buffer. 361 00:24:52,320 --> 00:24:54,760 So, okay. 362 00:24:55,000 --> 00:25:00,440 What we plan to do here is we have that host block with our legitimate address. 363 00:25:00,460 --> 00:25:00,920 That's our legitimate data. 364 00:25:01,100 --> 00:25:02,820 That's basically where we're sitting in. 365 00:25:03,020 --> 00:25:04,600 That's why we call it the host block. 366 00:25:05,220 --> 00:25:12,800 And what we try to do is we overflow it, and the next block after that also has a header. 367 00:25:13,040 --> 00:25:23,540 So, we try to overflow it the way that we can influence that header here as intelligent as possible and hope that iOS makes some use of it and abuses itself. 368 00:25:24,780 --> 00:25:26,960 That's basically how it's planned to work. 369 00:25:29,400 --> 00:25:34,760 So, what happens if iOS frees the memory block we just overwrote? 370 00:25:35,400 --> 00:25:37,460 Basically, they have a double linked list. 371 00:25:37,820 --> 00:25:40,440 It's pointing back and forward. 372 00:25:40,700 --> 00:25:46,900 I mean, everyone who knows how that goes, it's just two pointers always pointing to the next and the previous block. 373 00:25:47,100 --> 00:25:55,280 And when it frees that, it will try to take out this block off the linked list, which is basically, yeah, that's the way it looks. 374 00:25:56,140 --> 00:26:00,880 It's a common pointer exchange operation, and that's what we looked for. 375 00:26:01,140 --> 00:26:02,920 Oh, I'm actually burning the table here. Cool. 376 00:26:04,080 --> 00:26:07,640 FTR, could you, like, take care of that fire stuff over here? 377 00:26:08,280 --> 00:26:08,940 Thank you. 378 00:26:10,600 --> 00:26:12,880 So, yeah, that's what we were looking for. 379 00:26:13,120 --> 00:26:15,360 And, yeah, let's see if we can exploit that a bit. 380 00:26:17,940 --> 00:26:21,500 But first, we have to find out what iOS actually needs of that. 381 00:26:21,680 --> 00:26:23,060 And it's quite funny. 382 00:26:23,100 --> 00:26:24,020 Because if you look... 383 00:26:24,020 --> 00:26:26,120 That's red, that's red, that's red. 384 00:26:27,060 --> 00:26:28,860 So, what is the other stuff for? 385 00:26:29,360 --> 00:26:34,960 I mean, you usually have to buy new memory if you put a new iOS image on the router. 386 00:26:35,240 --> 00:26:36,280 Now you know why. 387 00:26:39,120 --> 00:26:41,060 Okay, so we have that magic block. 388 00:26:41,100 --> 00:26:42,080 Of course, that's checked. 389 00:26:42,180 --> 00:26:46,020 The PID and these RAM addresses here are not checked at all. 390 00:26:46,100 --> 00:26:48,380 I don't actually know what they're used for. 391 00:26:49,740 --> 00:26:52,280 Funny, the next pointer is not checked. 392 00:26:52,280 --> 00:26:55,320 But the previous pointer has to be 100% correct. 393 00:26:55,840 --> 00:26:59,220 And the size field shouldn't contain any bullshit. 394 00:27:00,420 --> 00:27:04,980 And, of course, the red zone is checked so it finds out if it shit all over itself. 395 00:27:06,980 --> 00:27:08,420 But, you know what? 396 00:27:08,800 --> 00:27:09,940 Did you notice something? 397 00:27:11,260 --> 00:27:14,340 From here to here, we know everything. 398 00:27:14,600 --> 00:27:17,480 Or we can put in bogus values and it will not care. 399 00:27:18,280 --> 00:27:21,440 But one of the two pointers is used in a pointer operation. 400 00:27:23,200 --> 00:27:24,280 Let's take a Cisco. 401 00:27:25,120 --> 00:27:26,980 We overflow it over here. 402 00:27:27,200 --> 00:27:30,120 Put some stuff that's like the red zone from the last block. 403 00:27:30,320 --> 00:27:32,140 That's the magic beginning. 404 00:27:32,240 --> 00:27:33,620 We put some stuff in here. 405 00:27:33,720 --> 00:27:34,500 It doesn't really matter. 406 00:27:35,040 --> 00:27:37,680 Put the NVRAM address over here. 407 00:27:38,080 --> 00:27:47,800 And on a 2500, the free, this pointer exchange operation will then write this previous pointer right into the NVRAM. 408 00:27:48,400 --> 00:27:51,360 The fun part is what happens if this happens. 409 00:27:52,280 --> 00:27:54,780 The device notices, oh, fuck. 410 00:27:54,920 --> 00:27:56,020 I fucked up my memory. 411 00:27:56,260 --> 00:27:57,100 It's all toast. 412 00:27:57,880 --> 00:27:59,840 So safest thing to do, reboot. 413 00:28:00,700 --> 00:28:02,000 We got all used to that. 414 00:28:03,240 --> 00:28:07,620 But it comes up and says, oops, config checks on wrong. 415 00:28:08,240 --> 00:28:09,740 So what am I going to do? 416 00:28:10,120 --> 00:28:17,480 Either I sit here and be a useless piece of shit or I go out on the network and ask for a config. 417 00:28:18,280 --> 00:28:18,760 Well. 418 00:28:22,440 --> 00:28:22,960 So. 419 00:28:26,320 --> 00:28:30,820 What we do, obviously, we send that stuff over here. 420 00:28:31,160 --> 00:28:32,680 Device shits all over itself. 421 00:28:34,360 --> 00:28:35,540 Asks for a config. 422 00:28:35,720 --> 00:28:37,220 And, of course, we're the nice guys. 423 00:28:37,360 --> 00:28:37,700 You know. 424 00:28:40,200 --> 00:28:41,700 It's so hilarious. 425 00:28:41,820 --> 00:28:44,260 You don't need any special knowledge about it. 426 00:28:44,700 --> 00:28:47,320 That part, okay, here comes the review. 427 00:28:48,080 --> 00:28:50,920 Disadvantages, it only works on a 2500. 428 00:28:51,280 --> 00:28:51,940 So that sucks. 429 00:28:52,680 --> 00:28:56,980 And the attacker has to be on the same subnet or own the TFTP server. 430 00:28:58,000 --> 00:28:58,960 That also sucks. 431 00:28:59,100 --> 00:29:01,420 But the good part is you don't need to know shit. 432 00:29:01,640 --> 00:29:02,380 I mean, really. 433 00:29:02,520 --> 00:29:06,040 You just send it over and provide the new config. 434 00:29:06,520 --> 00:29:08,880 But let's see if it can get some more devices. 435 00:29:10,880 --> 00:29:14,980 In order to do that, we have to get around this annoying previous pointer check. 436 00:29:16,480 --> 00:29:18,720 It took us really a while to figure that out. 437 00:29:18,780 --> 00:29:21,260 But that's basically for the guys who know C. 438 00:29:21,260 --> 00:29:23,280 That's basically how it looks like. 439 00:29:24,300 --> 00:29:29,020 Means the block we are sitting in, the host block, actually gets checked. 440 00:29:29,180 --> 00:29:30,020 And iOS checks. 441 00:29:30,940 --> 00:29:32,200 Is that still okay? 442 00:29:32,380 --> 00:29:43,760 And while checking the next pointer of the host block, it sees if the place where it points to points back to the place where it got the address from in the first place. 443 00:29:44,120 --> 00:29:49,680 Like I'm pointing to FTR and someone is going to check if FTR is pointing back to me. 444 00:29:49,680 --> 00:29:51,940 So, yeah. 445 00:29:52,060 --> 00:29:53,360 How do we get around that? 446 00:29:53,700 --> 00:29:56,020 Still have no stable solution for that. 447 00:29:56,140 --> 00:29:57,880 But a pretty okay one. 448 00:29:58,220 --> 00:29:59,940 We just overflow it once. 449 00:30:00,060 --> 00:30:00,580 Uncontrolled. 450 00:30:00,680 --> 00:30:02,020 Just a bunch of As in there. 451 00:30:02,240 --> 00:30:03,360 It reboots. 452 00:30:03,400 --> 00:30:06,120 And this puts the device in a fairly predictable state. 453 00:30:06,500 --> 00:30:11,460 Because after the reboot, you can pretty much tell how the memory looks like. 454 00:30:13,000 --> 00:30:16,180 So, that's basically how we get around the previous pointer issue. 455 00:30:17,160 --> 00:30:18,720 Now we have that size field. 456 00:30:18,720 --> 00:30:22,460 iOS doesn't like it if you put in the size field that you override. 457 00:30:22,740 --> 00:30:25,820 You put in something like huge numbers, all F. 458 00:30:26,060 --> 00:30:27,260 It will notice it. 459 00:30:27,320 --> 00:30:28,700 It will say, no, no, no, no, no. 460 00:30:28,740 --> 00:30:29,160 That's bullshit. 461 00:30:29,260 --> 00:30:30,280 I don't have so much memory. 462 00:30:30,520 --> 00:30:32,180 I could use it, but I don't have it. 463 00:30:33,860 --> 00:30:37,860 And you can't do like normal values because we are doing a string overflow here. 464 00:30:38,280 --> 00:30:39,140 So, it sucks. 465 00:30:39,360 --> 00:30:41,720 We can't just put no bytes in here. 466 00:30:43,340 --> 00:30:43,780 Funny. 467 00:30:44,320 --> 00:30:48,640 If we put seven and all F in here, it works. 468 00:30:49,360 --> 00:30:50,720 It's all happy about it. 469 00:30:51,480 --> 00:31:01,440 I assume some developer decided to use 32-bit fields on iOS, which is mostly 164-bit platform anyway. 470 00:31:02,800 --> 00:31:04,980 And do the calculation that way. 471 00:31:05,100 --> 00:31:10,300 And just by right-shifting, left-shifting, adding something, it all makes sense again. 472 00:31:10,480 --> 00:31:12,600 So, this is the size field we're using. 473 00:31:13,640 --> 00:31:16,980 But since the size field, okay, let's go back. 474 00:31:17,500 --> 00:31:21,900 That one has a seven over here, which means the most significant bit is not set. 475 00:31:22,720 --> 00:31:30,480 So, what we do, we take a look at free memory blocks because if the MSP is not set, iOS thinks it's free. 476 00:31:30,580 --> 00:31:32,780 So, we need to look at free memory blocks. 477 00:31:33,540 --> 00:31:38,540 Again, we take our crash dumps and our hex dumps and all that and figure the following out. 478 00:31:38,820 --> 00:31:43,220 After all the overhead we've already seen, we got similar overhead. 479 00:31:44,320 --> 00:31:46,140 Another magic value over here. 480 00:31:47,900 --> 00:31:49,360 Adding more padding. 481 00:31:50,780 --> 00:31:54,680 This is like eight bytes, just so you know where your memory goes. 482 00:31:55,800 --> 00:31:58,500 Some address and code space never used. 483 00:31:59,600 --> 00:32:02,080 A pointer and yet another pointer. 484 00:32:02,300 --> 00:32:06,840 And since they're only in free blocks, we decided to call them free next and free previous. 485 00:32:07,100 --> 00:32:08,840 They basically have the same purpose. 486 00:32:08,900 --> 00:32:10,960 They run yet another linked list. 487 00:32:11,820 --> 00:32:15,780 I honestly never want to get the full picture on iOS memory management. 488 00:32:16,140 --> 00:32:26,000 And this information is probably also used when the block is freed to get two free blocks together to one big block. 489 00:32:26,300 --> 00:32:28,660 It's all textbook free exploit. 490 00:32:29,780 --> 00:32:32,000 And, yeah, we asked for it. 491 00:32:32,100 --> 00:32:32,720 We got it. 492 00:32:32,780 --> 00:32:34,500 These two pointers are not checked. 493 00:32:35,360 --> 00:32:40,520 So, we can write any pointer to any address in the address space of iOS. 494 00:32:40,860 --> 00:32:41,460 Thanks. 495 00:32:42,680 --> 00:32:44,140 That's basically what we do. 496 00:32:44,240 --> 00:32:45,320 There is a pointer. 497 00:32:45,320 --> 00:32:48,060 Pointer exchange can take place here. 498 00:32:48,300 --> 00:32:49,500 And it's all complicated. 499 00:32:49,840 --> 00:32:56,980 Like, where the previous pointer points to, that gets the value that's in the next pointer. 500 00:32:57,380 --> 00:33:01,220 So, and vice versa, plus 20 bytes for some offset. 501 00:33:02,240 --> 00:33:05,360 Yeah, so, we have something to write into memory. 502 00:33:07,240 --> 00:33:09,100 But what do we do with that? 503 00:33:09,420 --> 00:33:11,820 I mean, we can write one pointer. 504 00:33:12,020 --> 00:33:13,060 That's pretty neat. 505 00:33:13,060 --> 00:33:16,060 But where do we write it to? 506 00:33:16,340 --> 00:33:23,480 There is, if you do, like, a showman proc alloc, there is a place that's called process array. 507 00:33:25,500 --> 00:33:28,520 It obviously is an array of addresses. 508 00:33:28,980 --> 00:33:34,540 And, funny, it's the same number of elements like the number of processes you're running. 509 00:33:35,020 --> 00:33:38,640 So, it might be that it has an entry for every process. 510 00:33:39,480 --> 00:33:40,040 Yeah. 511 00:33:40,240 --> 00:33:41,460 It actually is that. 512 00:33:41,460 --> 00:33:44,180 It points to a huge process record. 513 00:33:44,440 --> 00:33:49,880 They have, I don't know, it's several hundred bytes of information for a process to run. 514 00:33:51,420 --> 00:33:57,360 But the first thing in this process record actually points to yet another memory block, which is the stack. 515 00:33:57,860 --> 00:34:01,420 And the second one points inside that memory block. 516 00:34:01,660 --> 00:34:03,760 So, obviously, it's a stack pointer. 517 00:34:04,220 --> 00:34:04,780 Cool. 518 00:34:06,880 --> 00:34:08,540 So, let's take it over. 519 00:34:08,540 --> 00:34:15,420 We have, like, on the 1600 series, we tested that. 520 00:34:15,620 --> 00:34:21,120 And it's quite easy because the free operation actually can write into any one stack. 521 00:34:21,940 --> 00:34:23,240 Every process you want. 522 00:34:23,780 --> 00:34:25,300 So, you just pick one. 523 00:34:25,900 --> 00:34:31,780 Mostly you pick a process that's not running too often, but it's kicked off, like, once a minute. 524 00:34:31,920 --> 00:34:36,860 A good target, I figured, is load meter because it doesn't do anything useful anyway. 525 00:34:36,980 --> 00:34:37,200 So. 526 00:34:38,260 --> 00:34:38,740 Yeah. 527 00:34:40,600 --> 00:34:45,060 And if you look at the stack here, that's, like, the safe stack pointer. 528 00:34:45,300 --> 00:34:46,800 And that's the safe return address. 529 00:34:48,820 --> 00:34:55,000 So, everyone who ever wrote an exploit knows that we now have, like, 5,000 ways of exploiting that thing. 530 00:34:55,440 --> 00:34:59,660 By either overriding the return address straight ahead over here. 531 00:35:00,580 --> 00:35:01,720 Overriding the stack pointer. 532 00:35:03,200 --> 00:35:06,640 And providing our own stack with the new return address. 533 00:35:08,060 --> 00:35:11,780 Actually changing the little stack pointer in that process array entry. 534 00:35:12,280 --> 00:35:16,920 Or just replace the little process array entry and provide our own. 535 00:35:18,360 --> 00:35:19,380 So, yeah. 536 00:35:19,460 --> 00:35:19,900 We got. 537 00:35:20,380 --> 00:35:23,260 We used the first one because it's, like, the most obvious. 538 00:35:25,160 --> 00:35:25,760 So. 539 00:35:26,380 --> 00:35:27,520 Next question. 540 00:35:27,660 --> 00:35:28,220 Buffer. 541 00:35:28,320 --> 00:35:30,680 We need some buffer to store some code. 542 00:35:31,380 --> 00:35:32,840 And here's the bad news. 543 00:35:33,500 --> 00:35:35,020 If you overflow it. 544 00:35:35,020 --> 00:35:37,560 And it thinks this is free. 545 00:35:37,820 --> 00:35:39,800 And this one should be freed. 546 00:35:40,020 --> 00:35:44,360 It will actually erase the memory and override it by OD. 547 00:35:45,080 --> 00:35:46,000 Oh, dear. 548 00:35:47,840 --> 00:35:54,020 But actually since the block we overflew is a free memory block. 549 00:35:54,220 --> 00:35:56,260 Or, yeah, we made it a free memory block. 550 00:35:56,300 --> 00:35:57,440 We don't care what it was before. 551 00:35:58,780 --> 00:36:02,680 We can have our exploit code in there. 552 00:36:03,180 --> 00:36:03,720 So. 553 00:36:05,940 --> 00:36:07,280 Let's write some shellcode. 554 00:36:08,800 --> 00:36:11,500 We have an example based on a Cisco 1600. 555 00:36:11,780 --> 00:36:13,660 It has that funny Motorola processor. 556 00:36:13,900 --> 00:36:17,000 Which really got me because I never coded Motorola before. 557 00:36:18,480 --> 00:36:23,900 The memory protection according to Motorola's manual is set in some base register. 558 00:36:24,340 --> 00:36:31,460 We found that base register after some serious wading through hex dumps over here in that address. 559 00:36:31,460 --> 00:36:33,800 Luckily it has no zeros in it. 560 00:36:33,900 --> 00:36:34,080 Cool. 561 00:36:35,360 --> 00:36:40,460 You can like disable that by changing the, actually the second bit. 562 00:36:40,620 --> 00:36:45,560 Changing it from one like protected memory to zero as in unprotected memory. 563 00:36:46,780 --> 00:36:51,340 And, yeah, then write some invalid value into the NVRAM and get the device. 564 00:36:52,040 --> 00:36:52,560 Yeah. 565 00:36:52,620 --> 00:36:53,580 So that's what we do. 566 00:36:53,720 --> 00:36:56,200 See, that code is like not huge. 567 00:36:56,500 --> 00:36:58,160 I mean, that's the whole code. 568 00:36:58,400 --> 00:36:59,380 That's all you need. 569 00:37:00,400 --> 00:37:01,440 It's totally free. 570 00:37:01,440 --> 00:37:01,820 It's incredibly simple. 571 00:37:02,060 --> 00:37:05,420 It takes the address of that protection base register. 572 00:37:06,440 --> 00:37:08,000 Does a write shift on it. 573 00:37:08,340 --> 00:37:10,500 Because the next bit is actually zero. 574 00:37:10,600 --> 00:37:12,120 So it's nice to us. 575 00:37:13,220 --> 00:37:16,060 We tricked the address of the NVRAM in here. 576 00:37:17,920 --> 00:37:22,520 And, yeah, then write some coffee babe stuff in there. 577 00:37:22,920 --> 00:37:26,620 So we got that NVRAM invalidated quite easily. 578 00:37:27,300 --> 00:37:31,060 What we actually did here to show how to get around pointer, 579 00:37:31,440 --> 00:37:34,040 is exchange things that work right in your shell code. 580 00:37:34,380 --> 00:37:37,900 This instruction over here, you see this 01010101. 581 00:37:38,500 --> 00:37:41,840 This is actually where the other pointer, it's an exchange. 582 00:37:42,160 --> 00:37:43,680 So, yeah, give and take. 583 00:37:43,820 --> 00:37:45,420 As in you buy beer, I buy beer. 584 00:37:45,860 --> 00:37:48,560 So that's where the other pointer is stored. 585 00:37:48,860 --> 00:37:51,260 You just put some innocent opcode in here. 586 00:37:51,400 --> 00:37:52,840 Get the data part overwritten. 587 00:37:53,080 --> 00:37:53,860 All set. 588 00:37:56,280 --> 00:37:56,760 Yeah. 589 00:37:57,340 --> 00:37:57,820 Summary. 590 00:37:57,940 --> 00:38:00,740 If you overflow once to get the predictable previous pointer, 591 00:38:01,440 --> 00:38:02,500 set all the stuff here. 592 00:38:02,580 --> 00:38:03,400 Fire it up. 593 00:38:03,560 --> 00:38:04,880 And you have the same reaction. 594 00:38:05,100 --> 00:38:06,840 Like it asks for a config. 595 00:38:08,600 --> 00:38:09,900 And that's how it looks like. 596 00:38:10,060 --> 00:38:12,580 I took out the legal ally here. 597 00:38:13,660 --> 00:38:14,140 Yeah. 598 00:38:14,280 --> 00:38:16,580 It has some error later on. 599 00:38:16,660 --> 00:38:17,080 I don't care. 600 00:38:17,720 --> 00:38:18,520 Comes up. 601 00:38:18,560 --> 00:38:20,660 Asks for the config. 602 00:38:21,000 --> 00:38:22,660 Asks for another config. 603 00:38:22,920 --> 00:38:23,160 Yeah. 604 00:38:23,180 --> 00:38:23,860 That's Cisco. 605 00:38:24,120 --> 00:38:25,680 And then you've got the device. 606 00:38:27,220 --> 00:38:28,680 But, you know, it still sucks. 607 00:38:28,980 --> 00:38:30,760 You still have to be on the same segment. 608 00:38:30,760 --> 00:38:31,780 So let's go on. 609 00:38:33,140 --> 00:38:34,900 We need some more info here. 610 00:38:35,820 --> 00:38:40,500 Which is iOS seems to use some kind of cooperative multitasking. 611 00:38:40,660 --> 00:38:48,080 But honestly, it more looks like a huge program that has tons of interrupt handlers to fire off important stuff. 612 00:38:48,620 --> 00:38:51,500 So it's not really tasked. 613 00:38:51,660 --> 00:38:54,140 I didn't find any task handler on it. 614 00:38:54,220 --> 00:38:57,320 There is no scheduling service or anything I'm aware of. 615 00:38:57,520 --> 00:38:59,960 Maybe one of you guys worked with Cisco 616 00:38:59,960 --> 00:39:01,380 and can tell me something. 617 00:39:01,600 --> 00:39:02,380 I don't know. 618 00:39:02,520 --> 00:39:05,920 But it's all interrupt driven. 619 00:39:06,280 --> 00:39:07,640 So that really sucks. 620 00:39:09,320 --> 00:39:13,160 The MVRAM actually contains a bit more than just the config. 621 00:39:13,400 --> 00:39:14,720 It has a checksum. 622 00:39:14,880 --> 00:39:17,040 It has a field for the size of the config. 623 00:39:17,800 --> 00:39:25,020 It actually contains the stack traces and all the stuff that you would normally use to do forensics on the router. 624 00:39:25,540 --> 00:39:29,040 So what's that? 625 00:39:29,180 --> 00:39:29,380 Yeah. 626 00:39:29,960 --> 00:39:32,120 So the config is actually like a long C string. 627 00:39:33,300 --> 00:39:35,740 It's just a string with some line feeds in it. 628 00:39:36,360 --> 00:39:38,200 You can do some funny shit with that. 629 00:39:38,400 --> 00:39:42,780 Anyone who gets bored with your Cisco, just play with the configs and long lines. 630 00:39:43,520 --> 00:39:44,920 I don't have to tell you more. 631 00:39:46,660 --> 00:39:50,520 And it's terminated by the end keyword and the normal zero byte. 632 00:39:50,580 --> 00:39:52,400 So it's basically a long C string. 633 00:39:53,680 --> 00:39:56,440 So what we do is write a remote share code. 634 00:39:56,440 --> 00:40:01,240 That one will have a minimum config in a backpack. 635 00:40:02,500 --> 00:40:05,060 Disable interrupts so we don't get interrupted. 636 00:40:06,640 --> 00:40:07,680 Unprotects MVRAM. 637 00:40:08,300 --> 00:40:11,480 Calculates the new checksum so iOS is all happy. 638 00:40:12,340 --> 00:40:13,700 Writes it to the MVRAM. 639 00:40:14,620 --> 00:40:17,180 And just to be nice, does a clean reset. 640 00:40:19,140 --> 00:40:21,440 Well, you don't need any Cisco. 641 00:40:21,760 --> 00:40:23,660 You don't need any knowledge about iOS. 642 00:40:23,800 --> 00:40:25,480 And the neat thing is it will run always. 643 00:40:25,480 --> 00:40:26,080 Always. 644 00:40:26,260 --> 00:40:27,620 Because you don't use iOS. 645 00:40:27,880 --> 00:40:29,160 You just kick it off. 646 00:40:31,660 --> 00:40:34,220 We still have that problem with the zero byte. 647 00:40:34,540 --> 00:40:37,520 Still, string overflow, no zero bytes. 648 00:40:37,720 --> 00:40:38,320 Everyone knows that. 649 00:40:39,020 --> 00:40:39,540 Yeah. 650 00:40:39,700 --> 00:40:41,820 But that's like solved ages ago. 651 00:40:42,100 --> 00:40:43,720 And we did it the same way. 652 00:40:43,820 --> 00:40:49,180 You have the self modifying code that first sits there, has no zero bytes. 653 00:40:49,580 --> 00:40:51,740 Bootstrap code decodes the rest of it. 654 00:40:52,440 --> 00:40:53,820 Uses a different pattern. 655 00:40:53,820 --> 00:40:55,640 Like D5 instead of 55. 656 00:40:55,800 --> 00:40:59,900 Because 55 would lead to colognes in the XOR config. 657 00:41:00,400 --> 00:41:05,420 And colognes are real bad in that particular overflow because they're used as delimiter 658 00:41:05,420 --> 00:41:07,760 between like file system name and file name. 659 00:41:07,940 --> 00:41:09,500 So that screws the overflow. 660 00:41:09,900 --> 00:41:11,620 Took me about three days to find that out. 661 00:41:13,560 --> 00:41:13,860 Yeah. 662 00:41:14,040 --> 00:41:15,080 Gets decoded. 663 00:41:15,160 --> 00:41:15,860 Gets executed. 664 00:41:17,580 --> 00:41:18,360 Plainly works. 665 00:41:19,220 --> 00:41:21,980 Then we had another problem which was really nice. 666 00:41:22,180 --> 00:41:22,880 The code worked. 667 00:41:22,880 --> 00:41:23,640 You're all happy. 668 00:41:23,800 --> 00:41:24,580 It comes up. 669 00:41:24,600 --> 00:41:26,320 It says, no, config fucked up. 670 00:41:26,500 --> 00:41:27,460 You check the config. 671 00:41:27,560 --> 00:41:29,920 You find out it wrote like every sixth byte. 672 00:41:31,440 --> 00:41:32,640 And it's a plain loop. 673 00:41:32,940 --> 00:41:34,640 I mean, it really writes every byte. 674 00:41:34,820 --> 00:41:38,560 And you try it again and it writes every other sixth byte. 675 00:41:39,060 --> 00:41:39,580 Hey. 676 00:41:40,580 --> 00:41:44,140 That's because the NVRAM chips are so fucking lame and slow. 677 00:41:46,240 --> 00:41:47,280 Like by design. 678 00:41:47,620 --> 00:41:51,560 And according to the manual, you're supposed to keep the address lines straight. 679 00:41:51,560 --> 00:41:54,640 So don't do any instructions on like A1 to A9. 680 00:41:55,800 --> 00:41:59,060 And pull the status register of that NVRAM thing. 681 00:42:00,200 --> 00:42:01,660 I don't know where that is. 682 00:42:02,020 --> 00:42:05,840 Honestly, in that huge memory area, I don't know where that is. 683 00:42:05,960 --> 00:42:09,040 So we just took some loops after every write. 684 00:42:09,120 --> 00:42:10,080 We loop a bit. 685 00:42:10,320 --> 00:42:12,280 Make the Cisco all happy and sweaty. 686 00:42:12,640 --> 00:42:13,640 And yeah. 687 00:42:14,700 --> 00:42:16,340 So we got around that problem. 688 00:42:18,040 --> 00:42:19,680 And that's what you can download. 689 00:42:19,680 --> 00:42:22,160 We call it Ultima Ratio. 690 00:42:22,320 --> 00:42:23,740 Go figure what that means. 691 00:42:24,980 --> 00:42:26,840 The code isn't actually that big. 692 00:42:27,040 --> 00:42:28,660 It has like the overflow. 693 00:42:29,620 --> 00:42:30,640 The fake block. 694 00:42:31,160 --> 00:42:34,880 This bootstrap code to decode all the other stuff. 695 00:42:35,580 --> 00:42:37,800 Export code to actually write a config. 696 00:42:38,040 --> 00:42:39,640 Has the config in the backpack. 697 00:42:40,220 --> 00:42:44,680 So what you do is you have your command line utility that takes the IP address. 698 00:42:44,980 --> 00:42:47,440 The previous pointer, which we still need, unfortunately. 699 00:42:48,940 --> 00:42:49,660 And you have this. 700 00:42:49,680 --> 00:42:52,780 And you have the config as like a file on your file system. 701 00:42:52,940 --> 00:42:53,600 Fired up. 702 00:42:53,740 --> 00:42:54,840 Got root on a Cisco. 703 00:42:57,040 --> 00:42:57,480 Yep. 704 00:42:57,720 --> 00:42:58,720 That's how it looks like. 705 00:42:58,820 --> 00:42:59,920 You see no crash info. 706 00:43:00,120 --> 00:43:01,080 No blah, blah, blah. 707 00:43:01,240 --> 00:43:02,400 I'm not feeling happy. 708 00:43:03,760 --> 00:43:04,860 Just boot straight. 709 00:43:05,400 --> 00:43:06,240 Legal lala. 710 00:43:07,720 --> 00:43:08,840 Figures out of the sudden. 711 00:43:08,940 --> 00:43:09,080 Oops. 712 00:43:09,260 --> 00:43:10,420 There's a new interface. 713 00:43:10,600 --> 00:43:13,520 Yeah, because the config we uploaded didn't say anything about Bree 0. 714 00:43:13,720 --> 00:43:16,020 So it just figured, oh, I'm a 1600. 715 00:43:16,240 --> 00:43:18,120 I'm all surprised about having a Bree interface. 716 00:43:19,680 --> 00:43:21,480 Yeah, then you just turn it to your router. 717 00:43:21,740 --> 00:43:23,540 And, well, it's your config. 718 00:43:23,640 --> 00:43:24,520 And it's your password. 719 00:43:27,180 --> 00:43:29,720 That's basically how it looks like in detail. 720 00:43:29,920 --> 00:43:33,000 I'm not expecting that everyone is going to get that right away. 721 00:43:33,120 --> 00:43:35,140 But, I mean, the presentation is on a CD. 722 00:43:36,320 --> 00:43:37,500 It's, again, the red block. 723 00:43:38,660 --> 00:43:40,680 Magic, PID, stuff, stuff. 724 00:43:41,780 --> 00:43:44,040 Next pointer, previous pointer, don't really matter. 725 00:43:46,200 --> 00:43:48,100 That size field, that funny size field. 726 00:43:48,100 --> 00:43:50,020 This ref field over here. 727 00:43:50,280 --> 00:43:50,800 Padding. 728 00:43:52,040 --> 00:43:52,920 Free magic. 729 00:43:53,520 --> 00:43:54,500 More padding. 730 00:43:54,880 --> 00:43:56,660 Actually, total crap over here. 731 00:43:59,160 --> 00:43:59,680 Yeah. 732 00:43:59,800 --> 00:44:00,560 More padding. 733 00:44:01,000 --> 00:44:01,840 Next pointer. 734 00:44:02,020 --> 00:44:02,800 Previous pointer. 735 00:44:03,060 --> 00:44:05,140 This one is pointing to the code. 736 00:44:05,320 --> 00:44:07,000 This one is pointing to the stack. 737 00:44:07,180 --> 00:44:08,060 And here we go. 738 00:44:08,300 --> 00:44:10,600 And that's how the XOR code is. 739 00:44:10,980 --> 00:44:12,040 That's what we use. 740 00:44:12,180 --> 00:44:17,360 I mean, if some guys here really know Motorola coding, you might come up with something more 741 00:44:17,360 --> 00:44:18,120 decent than that. 742 00:44:18,600 --> 00:44:20,620 But it's not too big. 743 00:44:20,800 --> 00:44:22,960 And you don't need any knowledge about iOS. 744 00:44:23,280 --> 00:44:26,220 I'm still putting the big M faces on that one. 745 00:44:28,460 --> 00:44:28,980 Yeah. 746 00:44:29,120 --> 00:44:29,920 Word to do. 747 00:44:30,380 --> 00:44:32,420 I mean, this is not like TESO SSH. 748 00:44:33,140 --> 00:44:39,120 This doesn't really, really work well if you don't have access, like, to the Syslog host 749 00:44:39,120 --> 00:44:43,140 or in the lab you do it with the console on and stuff. 750 00:44:43,540 --> 00:44:47,340 You don't, like, download it, fire it off, and turn off. 751 00:44:48,040 --> 00:44:49,100 That's not going to work. 752 00:44:50,460 --> 00:44:52,980 But I hope we showed that it works. 753 00:44:53,360 --> 00:44:59,220 And I hope that these heat exploits actually were basically a wake-up call. 754 00:44:59,360 --> 00:44:59,660 But anyway. 755 00:44:59,980 --> 00:45:01,320 So what do we have to do? 756 00:45:02,120 --> 00:45:03,520 We have to find differences. 757 00:45:04,520 --> 00:45:09,820 If someone has a bug for 12.2 iOS, just come over, tell me. 758 00:45:09,900 --> 00:45:11,300 I'll buy you a bunch of beers for it. 759 00:45:13,540 --> 00:45:16,280 We have the problem of smaller buffers. 760 00:45:16,280 --> 00:45:18,040 I mean, that buffer is just huge. 761 00:45:18,100 --> 00:45:21,560 It's 1,400 bytes, like, full UDP packet. 762 00:45:22,440 --> 00:45:24,320 We have to figure out how that works. 763 00:45:24,780 --> 00:45:28,000 Basically, my idea is to send in the shellcode via CDP. 764 00:45:29,620 --> 00:45:34,140 We have that previous pointer stack and stack addresses. 765 00:45:34,480 --> 00:45:37,160 That's still a problem, but bear with us. 766 00:45:37,220 --> 00:45:41,480 We will come back to you and have a solution for that one. 767 00:45:41,940 --> 00:45:45,340 And in VRAM config, we need some different shellcode, 768 00:45:45,340 --> 00:45:46,920 but that's, like, the easy part on it. 769 00:45:47,060 --> 00:45:52,960 We have to write to Flash instead of in VRAM to, like, take over GSRs. 770 00:45:54,000 --> 00:45:56,380 We need some anti-forensics shellcode, 771 00:45:56,500 --> 00:46:02,580 but actually after I had some people telling me how they do forensics on the Cisco, 772 00:46:02,760 --> 00:46:05,040 I decided that's not going to be needed 773 00:46:05,640 --> 00:46:09,160 because nobody actually looks at the in VRAM when doing forensics on Cisco. 774 00:46:09,900 --> 00:46:14,260 But it would be neat to have a shellcode that really does the same as ours, 775 00:46:14,260 --> 00:46:19,500 but additionally deletes all traces from your exploitation and stuff like that. 776 00:46:19,820 --> 00:46:23,620 And, you know, so the forensics guys are all happy about it. 777 00:46:24,500 --> 00:46:29,040 And, of course, real-time configuration modification code is, like, 778 00:46:29,040 --> 00:46:35,720 the next thing I'm going to do is a shellcode that goes over, removes all access list bindings, 779 00:46:35,860 --> 00:46:39,140 sets the passwords to something you might know, 780 00:46:39,300 --> 00:46:43,600 and reboots the device so you don't have to figure out which interfaces it has 781 00:46:43,600 --> 00:46:44,240 and stuff like that. 782 00:46:45,860 --> 00:46:46,720 Come on. 783 00:46:47,360 --> 00:46:47,980 Yeah. 784 00:46:48,080 --> 00:46:48,700 Summary. 785 00:46:50,820 --> 00:46:57,560 For the 1000, it's local export, like just invalidating in VRAM, 786 00:46:57,640 --> 00:46:59,340 or remote exploit. 787 00:47:01,560 --> 00:47:03,180 It's even simpler here. 788 00:47:03,240 --> 00:47:07,860 You can actually write your return address right into the exception handler for memory problems. 789 00:47:08,380 --> 00:47:12,680 That's pretty neat because as soon as it figures out that it screwed up the memory, 790 00:47:12,840 --> 00:47:14,000 it will screw up even more. 791 00:47:14,000 --> 00:47:18,200 The 1600, 2600, basically same issue. 792 00:47:18,560 --> 00:47:22,520 Fun part on the 2600, if you want to test that TFTP stuff, 793 00:47:22,960 --> 00:47:29,320 you have to be a bit more tricky because you have to fire up TFTP first with a valid request 794 00:47:30,280 --> 00:47:32,400 so the TFTP service gets loaded. 795 00:47:33,020 --> 00:47:39,140 I was looking for the process entry of the TFTP service for, like, ages before I figured out 796 00:47:39,140 --> 00:47:41,800 you have to fire it up once so it actually gets activated. 797 00:47:41,800 --> 00:47:44,080 But basically it's the same. 798 00:47:44,160 --> 00:47:49,640 The 2600 has a PowerPC processor, so you're not going to use this shellcode, 799 00:47:49,880 --> 00:47:52,280 but the concept is still the same. 800 00:47:52,940 --> 00:47:57,980 And 2500, so far we can't do remote exploits on it. 801 00:47:58,580 --> 00:47:59,660 That's going to change. 802 00:48:00,200 --> 00:48:03,520 And, yeah, it's like the loser Cisco. 803 00:48:04,040 --> 00:48:07,200 It's, yeah, the script kitty Cisco die thing. 804 00:48:08,340 --> 00:48:09,180 So what? 805 00:48:09,460 --> 00:48:11,260 For everyone who didn't get it yet, 806 00:48:11,260 --> 00:48:16,860 this is how you do exploits on 85% of bugs in iOS. 807 00:48:17,660 --> 00:48:23,380 So I hope someone is going to get a phone and call Cisco and tell them to fix this shit. 808 00:48:24,900 --> 00:48:26,840 You can do it, like, protocol-based. 809 00:48:27,520 --> 00:48:29,120 You can do it debug-based. 810 00:48:30,360 --> 00:48:33,260 You can actually do all kinds of stuff. 811 00:48:33,540 --> 00:48:37,380 And, I mean, who actually expects you to take over a Cisco? 812 00:48:37,500 --> 00:48:38,900 So it's still unprotected. 813 00:48:38,920 --> 00:48:39,860 I mean, really. 814 00:48:41,260 --> 00:48:43,840 And as I said, then VRAM still contains stuff. 815 00:48:44,060 --> 00:48:47,460 For the local exploitation, actually, it still contains the former config. 816 00:48:47,760 --> 00:48:51,780 So after you got it, you just turn it to it, get the former config down, 817 00:48:52,020 --> 00:48:55,620 which is a neat way to get around this no-service password recovery. 818 00:48:56,800 --> 00:48:58,320 You just exploit it. 819 00:48:59,000 --> 00:49:00,540 You get the config down. 820 00:49:00,600 --> 00:49:01,320 You get the passwords. 821 00:49:01,520 --> 00:49:06,900 You get, like, tunnel keys, IP addresses, net settings, all kinds of stuff. 822 00:49:09,000 --> 00:49:10,020 How to protect. 823 00:49:10,020 --> 00:49:12,660 I guess some of you have that question in mind right now. 824 00:49:13,660 --> 00:49:17,560 Basically, in general, do not rely on one type of device. 825 00:49:17,900 --> 00:49:24,320 If all your protection and frontline protection and firewall and IDS systems say Cisco on it, you're screwed. 826 00:49:26,300 --> 00:49:29,280 If it all says Checkpoint on it, you're screwed, too. 827 00:49:29,560 --> 00:49:30,920 So mix the two. 828 00:49:31,020 --> 00:49:33,920 Or better, get some different technology in there. 829 00:49:35,620 --> 00:49:40,000 Consider all your network equipment vulnerable and exploitable to the full extent. 830 00:49:40,020 --> 00:49:45,560 Someone is going to be sick enough, that's probably us, to write a check for it. 831 00:49:46,260 --> 00:49:46,960 Believe me. 832 00:49:47,760 --> 00:49:49,160 No, it is small. 833 00:49:49,380 --> 00:49:50,020 It is simple. 834 00:49:50,320 --> 00:49:53,120 It doesn't even have an LED on it or something. 835 00:49:53,480 --> 00:49:56,640 That doesn't mean that nobody's going to exploit it. 836 00:49:57,780 --> 00:49:58,500 They will. 837 00:49:59,080 --> 00:49:59,820 Believe me. 838 00:50:00,420 --> 00:50:01,920 If not, I make them do it. 839 00:50:04,280 --> 00:50:09,440 For the HPs, basically, use the features it has, even if they suck. 840 00:50:10,420 --> 00:50:11,720 Assign an admin password. 841 00:50:12,020 --> 00:50:13,980 Change SNMP read and write community. 842 00:50:14,800 --> 00:50:16,220 Do the PGA protection. 843 00:50:16,920 --> 00:50:18,500 Yeah, it gives you some time. 844 00:50:20,380 --> 00:50:27,520 Make sure, I mean, if you have a print server, the printer should only be accessed from the print server. 845 00:50:27,980 --> 00:50:28,500 Really. 846 00:50:28,700 --> 00:50:32,960 Because nobody is going to print directly to a printer if you print to the print server. 847 00:50:33,140 --> 00:50:36,040 Like you have that loser Windows network thing. 848 00:50:37,200 --> 00:50:41,300 The only server that has to talk to the printer is the print server. 849 00:50:42,500 --> 00:50:44,220 Get rid of this .loader. 850 00:50:44,300 --> 00:50:48,960 Actually use one of our elite tools to get rid of it. 851 00:50:49,580 --> 00:50:55,840 And consider putting your printer behind firewalls if it is really critical. 852 00:50:56,020 --> 00:51:00,560 Or really, if it is finance department or something, use common sense. 853 00:51:00,800 --> 00:51:03,860 I mean, the PCs have LPT ports for some reason. 854 00:51:04,280 --> 00:51:06,020 Just connect it to the PC. 855 00:51:06,620 --> 00:51:11,700 Actually, one thing I wanted to mention for this one. 856 00:51:11,840 --> 00:51:16,960 Be sure that your firewall does not allow outgoing connections from your printer to the internet. 857 00:51:17,160 --> 00:51:22,920 Because in the csconfig file here, you can actually put the location of the code. 858 00:51:23,280 --> 00:51:24,900 Not in, like, file system. 859 00:51:25,040 --> 00:51:27,800 Like, O, colon, backslash, mycode.class. 860 00:51:28,120 --> 00:51:34,500 But you can say, like, http://my.evil.server. 861 00:51:35,200 --> 00:51:35,680 Slash. 862 00:51:36,040 --> 00:51:37,800 My super evil dot class. 863 00:51:40,300 --> 00:51:45,000 Yeah, for the CISCOs, basically router hardening, textbook stuff. 864 00:51:45,900 --> 00:51:50,320 Other than that, yeah, try to convince people to have no overflows in iOS. 865 00:51:50,560 --> 00:51:52,260 Then it's all no issue. 866 00:51:53,620 --> 00:51:55,260 Keep your iOS up to date. 867 00:51:55,300 --> 00:52:00,100 I know it sucks, but they really just fix the stuff on the 12 series. 868 00:52:00,560 --> 00:52:02,020 Mostly just 12.2. 869 00:52:03,100 --> 00:52:03,660 Yeah. 870 00:52:03,660 --> 00:52:07,360 Find out which software version is fixed. 871 00:52:07,540 --> 00:52:09,000 Which is kinda hard sometimes. 872 00:52:09,260 --> 00:52:10,400 But try to find it out. 873 00:52:11,240 --> 00:52:12,740 Tell your IDS about it. 874 00:52:12,800 --> 00:52:13,700 That's basically the signature. 875 00:52:14,420 --> 00:52:20,020 If you really paid attention, you will see that this is like the red zone from the block we're coming from. 876 00:52:20,140 --> 00:52:20,760 This is the magic. 877 00:52:22,300 --> 00:52:25,880 There is an undocumented, thank you, debug command. 878 00:52:26,000 --> 00:52:27,360 That is debug sanity. 879 00:52:27,700 --> 00:52:28,840 It doesn't debug anything. 880 00:52:29,120 --> 00:52:31,960 It just makes iOS check it more often. 881 00:52:32,040 --> 00:52:32,720 The memory. 882 00:52:32,720 --> 00:52:34,780 It doesn't help. 883 00:52:35,260 --> 00:52:37,580 You can still exploit it, but it gets it faster. 884 00:52:37,920 --> 00:52:40,440 So, if some loser tries it, you will get him. 885 00:52:41,960 --> 00:52:42,620 The hardware. 886 00:52:43,020 --> 00:52:43,920 Config register. 887 00:52:44,640 --> 00:52:45,080 Zero. 888 00:52:45,440 --> 00:52:47,700 Next time the thing boots, it will sit in Realm 1. 889 00:52:48,300 --> 00:52:52,820 If you do that, and you forget about it, and you say reload, you have to get in your car. 890 00:52:54,920 --> 00:52:59,220 Yeah, and of course, logging should be not like all visible. 891 00:53:00,060 --> 00:53:00,500 Yeah. 892 00:53:00,500 --> 00:53:11,100 Yeah, your syslog host should actually be protected correctly so that people don't use your syslog host as an information base how to get the pointer straight to exploit your syscodes. 893 00:53:13,100 --> 00:53:14,200 That's basically it. 894 00:53:15,420 --> 00:53:18,060 Thanks a lot, and I hope you enjoyed it. 895 00:53:18,360 --> 00:53:18,800 And, yeah. 896 00:53:19,020 --> 00:53:20,480 I hope to see you guys around. 897 00:53:30,500 --> 00:53:30,700 Thanks, guys. 898 00:53:32,120 --> 00:53:32,760 See you guys.