1 00:00:14,640 --> 00:00:16,620 How's everyone here enjoying DEF CON 11? 2 00:00:19,600 --> 00:00:20,280 Fucking A! 3 00:00:21,120 --> 00:00:24,200 See, this is DEF CON, this is not Black Hat, so I can say fucking A. 4 00:00:25,960 --> 00:00:27,860 Alright, so I'm here to fuck with your heads. 5 00:00:28,480 --> 00:00:29,220 That's the job. 6 00:00:30,760 --> 00:00:31,840 Work for Avaya now. 7 00:00:32,280 --> 00:00:34,160 They don't give a fuck, I'm still here to fuck with your heads. 8 00:00:34,880 --> 00:00:35,280 There. 9 00:00:35,920 --> 00:00:37,340 So what are we here to talk about? 10 00:00:38,660 --> 00:00:40,420 Peace through superior firepower. 11 00:00:40,600 --> 00:00:42,220 That is my philosophy of security. 12 00:00:43,860 --> 00:00:44,260 History. 13 00:00:44,460 --> 00:00:48,020 Last year I came out here, talked about Black Ops and TCP IP. 14 00:00:49,120 --> 00:00:50,560 This is sort of the sequel talk. 15 00:00:50,800 --> 00:00:51,880 This is me saying great. 16 00:00:52,100 --> 00:00:53,980 Found lots and lots of cool little primitives. 17 00:00:54,200 --> 00:00:56,140 Let's go ahead and make some applied services. 18 00:00:56,320 --> 00:00:59,320 Let's see what the result is of all the research from last year. 19 00:00:59,500 --> 00:01:00,200 It's kind of fun. 20 00:01:00,280 --> 00:01:03,940 We didn't even have the collection of tools that implemented everything last year. 21 00:01:04,060 --> 00:01:06,580 We didn't have this Paketo Kiretsu. 22 00:01:06,900 --> 00:01:08,760 See, I have to pronounce this correctly, 23 00:01:09,000 --> 00:01:13,940 because if I don't, every time this very friendly Japanese person walks up and says, 24 00:01:14,960 --> 00:01:16,320 it's not Kiretsu. 25 00:01:18,440 --> 00:01:20,600 So, basically we had a collection of tools, 26 00:01:20,740 --> 00:01:22,540 really fast port scanner, 27 00:01:23,500 --> 00:01:24,300 implementations in that, 28 00:01:24,780 --> 00:01:28,300 implementations that made network access a lot easier. 29 00:01:28,560 --> 00:01:29,300 Bunch of toys. 30 00:01:29,720 --> 00:01:31,940 So the goal is to bring new tools to the table. 31 00:01:32,120 --> 00:01:36,160 To keep with the primary advantage of being a defender. 32 00:01:36,740 --> 00:01:40,480 Which is you, and of course the irony being is off the screen, 33 00:01:40,620 --> 00:01:42,060 but you don't need to be stealthy. 34 00:01:42,420 --> 00:01:43,080 You don't. 35 00:01:43,200 --> 00:01:44,060 It's really funny. 36 00:01:44,220 --> 00:01:46,480 Latest 2600 actually mentioned ScanRand. 37 00:01:46,760 --> 00:01:48,940 And it says, oh yeah, I showed up on this network. 38 00:01:49,120 --> 00:01:52,420 And I like scanned it stealthily with ScanRand. 39 00:01:54,100 --> 00:01:58,780 This is code that like spews packets at tens of thousands per second. 40 00:01:58,980 --> 00:02:00,740 This not equal stealth. 41 00:02:01,140 --> 00:02:02,340 Just so y'all know. 42 00:02:02,760 --> 00:02:03,440 Uh-uh. 43 00:02:03,920 --> 00:02:07,100 So, Black Hat. 44 00:02:07,380 --> 00:02:10,520 Well the Black Hat guys actually went ahead and they are the reason the code's out. 45 00:02:10,760 --> 00:02:12,640 So that link should work. 46 00:02:13,120 --> 00:02:14,160 It could work. 47 00:02:14,300 --> 00:02:15,380 It don't work. 48 00:02:15,560 --> 00:02:18,400 Because that entire piece of the net is dead right now. 49 00:02:19,880 --> 00:02:22,520 Sorry, you can blame someone for the fact that you don't get a lot of credit. 50 00:02:22,520 --> 00:02:22,780 It's a live demo. 51 00:02:23,220 --> 00:02:24,400 Or the slides immediately. 52 00:02:24,620 --> 00:02:25,380 Or the code immediately. 53 00:02:25,740 --> 00:02:30,660 But I'm sure if you harass me enough after this I'll give it to you on CD or USB or something. 54 00:02:31,140 --> 00:02:33,240 But the big thing is the code actually exists. 55 00:02:33,580 --> 00:02:36,340 As opposed to last year where it's like, hey, I'll go write it later. 56 00:02:37,080 --> 00:02:37,580 No, no. 57 00:02:37,640 --> 00:02:38,800 Now the code actually exists. 58 00:02:41,060 --> 00:02:42,520 So, flipping the order around. 59 00:02:43,740 --> 00:02:45,560 We're going to start at the top of the stack. 60 00:02:46,360 --> 00:02:50,120 We're going to talk about a hack that I discovered, I don't know, two and a half years ago. 61 00:02:50,260 --> 00:02:51,240 And I've been keeping it silent. 62 00:02:51,240 --> 00:02:56,040 Because I kind of felt they were going to patch it right after I got it out. 63 00:02:57,060 --> 00:02:59,600 So I've been playing with this myself for a while. 64 00:02:59,780 --> 00:03:00,240 And this sucks. 65 00:03:00,320 --> 00:03:02,640 This really does need a live demo for you guys to see it. 66 00:03:03,340 --> 00:03:09,020 It turns out ActiveX, you can use it for more than deploying spyware. 67 00:03:09,500 --> 00:03:12,220 Gator is not the only thing that you can do with ActiveX. 68 00:03:12,580 --> 00:03:14,740 You can actually deploy anything. 69 00:03:15,160 --> 00:03:16,740 Any piece of code at all. 70 00:03:17,000 --> 00:03:18,420 So I've got this great history. 71 00:03:18,500 --> 00:03:19,140 I'll go around. 72 00:03:19,220 --> 00:03:19,980 Go to these talks. 73 00:03:20,100 --> 00:03:21,080 And I'll find an internet. 74 00:03:21,240 --> 00:03:21,800 Kiosk. 75 00:03:22,060 --> 00:03:25,760 And I'm like, I'm not using this web browser stuff. 76 00:03:26,020 --> 00:03:26,980 I want SSH. 77 00:03:27,760 --> 00:03:30,920 And usually at this point, I go ahead and I do my live demo. 78 00:03:31,000 --> 00:03:31,940 And go to a web page. 79 00:03:32,020 --> 00:03:32,280 And poof. 80 00:03:32,300 --> 00:03:32,860 What pops up? 81 00:03:32,860 --> 00:03:33,600 An SSH client. 82 00:03:34,380 --> 00:03:35,300 How did I do that? 83 00:03:35,600 --> 00:03:36,560 How does this work? 84 00:03:36,780 --> 00:03:42,380 Well, it turns out normally ActiveX applications have to be specifically compiled to be, oh, 85 00:03:42,520 --> 00:03:43,600 this is for a web page. 86 00:03:43,760 --> 00:03:44,700 This is an OCX. 87 00:03:44,800 --> 00:03:45,800 This has been specially done. 88 00:03:46,000 --> 00:03:47,620 It turns out none of it is necessary. 89 00:03:48,220 --> 00:03:50,620 You just sort of put in an executable. 90 00:03:50,620 --> 00:03:51,440 And it just works. 91 00:03:51,760 --> 00:03:54,680 And OCXs have these things called GUIDs. 92 00:03:54,680 --> 00:03:55,520 They're signatures. 93 00:03:55,840 --> 00:03:58,800 They say, ah, yes, this is its globally unique identifier. 94 00:03:59,180 --> 00:04:00,660 Yeah, IE doesn't check it. 95 00:04:00,700 --> 00:04:01,000 They don't care. 96 00:04:02,840 --> 00:04:03,300 That's it. 97 00:04:03,560 --> 00:04:09,080 Now, you might think, now, Dan, this must be very hard to make an executable work. 98 00:04:09,300 --> 00:04:10,500 You have to sign it. 99 00:04:10,560 --> 00:04:11,700 It needs to be signed. 100 00:04:12,460 --> 00:04:16,300 The signature doesn't need to be anything you can't generate in about two lines of code. 101 00:04:16,440 --> 00:04:17,520 But you need to sign it. 102 00:04:17,560 --> 00:04:19,420 Dan, how am I going to do this? 103 00:04:24,340 --> 00:04:25,280 I know. 104 00:04:26,760 --> 00:04:29,040 Scary ten character commands. 105 00:04:31,080 --> 00:04:31,960 Make your cert. 106 00:04:32,940 --> 00:04:34,160 Convert it to an SPC. 107 00:04:34,820 --> 00:04:35,500 Sign it. 108 00:04:35,780 --> 00:04:37,760 And then you have an object. 109 00:04:38,160 --> 00:04:43,200 And the object, instead of foo.ocx or foo.ax or whatever, foo.exe. 110 00:04:43,520 --> 00:04:45,140 And that class ID doesn't matter. 111 00:04:45,240 --> 00:04:46,420 It just needs to be some class ID. 112 00:04:47,000 --> 00:04:48,980 Now, this is interesting. 113 00:04:49,420 --> 00:04:50,760 But it's not cool. 114 00:04:51,040 --> 00:04:52,180 It's not awesome. 115 00:04:52,280 --> 00:04:52,520 Why? 116 00:04:53,040 --> 00:04:58,820 Because you could just sort of take an executable file and make it the href on a web link and it would just sort of work. 117 00:04:59,180 --> 00:05:01,760 IE says to the user, that's a nice executable. 118 00:05:01,820 --> 00:05:02,580 Should I open it? 119 00:05:02,880 --> 00:05:04,400 I do this all the time for Putty. 120 00:05:04,500 --> 00:05:06,960 So this is just sort of a stunt to make it an object. 121 00:05:07,540 --> 00:05:15,980 Now, where it gets cool, you notice sometimes Windows executables are, well, they're just not complete by themselves. 122 00:05:16,460 --> 00:05:18,400 They need some support files. 123 00:05:18,400 --> 00:05:19,740 Some DLLs. 124 00:05:19,740 --> 00:05:21,420 Some bitmaps and whatnot. 125 00:05:21,760 --> 00:05:31,560 Wouldn't it be nice if instead of having to run this really painful install procedure, you just went to a web page and everything just auto unpacked and there you were? 126 00:05:32,560 --> 00:05:33,860 No problem, boss. 127 00:05:35,200 --> 00:05:37,340 You can also sign CAB files. 128 00:05:37,920 --> 00:05:40,840 And you make your object a CAB file and you sign it. 129 00:05:40,900 --> 00:05:42,160 And in the CAB you put all your stuff. 130 00:05:42,820 --> 00:05:44,600 Now, you may be familiar with CABs. 131 00:05:44,600 --> 00:05:48,220 You know, also seen in Windows setup whenever it builds itself. 132 00:05:48,220 --> 00:05:49,480 It builds itself from CABs. 133 00:05:50,200 --> 00:05:52,820 And so you put a stupid little INF file inside. 134 00:05:53,160 --> 00:05:57,100 And the INF file is there so the application knows how to do a setup. 135 00:05:57,340 --> 00:05:58,140 How to build itself. 136 00:05:58,780 --> 00:06:05,040 Well, you basically say, well, my installer is just like the command that I want this thing to run. 137 00:06:05,260 --> 00:06:05,960 You don't install. 138 00:06:06,080 --> 00:06:07,700 You just run it from the setup directory. 139 00:06:08,320 --> 00:06:14,420 Now, what's great is not only do you run it from the setup directory, but after you're done it goes ahead and clears itself off. 140 00:06:15,320 --> 00:06:15,760 Usually. 141 00:06:16,200 --> 00:06:18,740 So, I know it's really hard. 142 00:06:18,880 --> 00:06:21,560 You make a CAB that has, you make an INF file that has that. 143 00:06:21,820 --> 00:06:24,200 And it doesn't need to be any INF file name will work. 144 00:06:24,560 --> 00:06:27,580 And then you generate the CAB using the command called CABARC. 145 00:06:28,160 --> 00:06:28,620 That's it. 146 00:06:28,780 --> 00:06:30,360 All you do is you take your CAB. 147 00:06:30,480 --> 00:06:32,440 Instead of foo.exe, it's foo.cab. 148 00:06:32,720 --> 00:06:36,560 Now, any Windows application you want, write off a web page. 149 00:06:37,460 --> 00:06:38,340 That's how it works. 150 00:06:38,880 --> 00:06:40,660 And I'd show you this great demo. 151 00:06:40,960 --> 00:06:41,820 I mean, I've got this demo. 152 00:06:41,920 --> 00:06:44,080 You click a link and, oh, look, packet sniffer. 153 00:06:44,220 --> 00:06:44,800 You click a link. 154 00:06:44,800 --> 00:06:45,680 Oh, look, SSH client. 155 00:06:45,920 --> 00:06:46,560 You click a link. 156 00:06:46,640 --> 00:06:48,200 Oh, look, I can push a person down the stairs. 157 00:06:48,900 --> 00:06:50,000 No, no, I'm serious. 158 00:06:50,100 --> 00:06:51,840 There's this great game called Porus Durvat. 159 00:06:52,020 --> 00:06:53,840 It came out at Assembly02 last year. 160 00:06:54,280 --> 00:06:56,700 Basically, you push a guy down the stairs. 161 00:06:57,100 --> 00:07:00,740 And that's how you say screw you, all you Flash applications that think you're so cool. 162 00:07:03,500 --> 00:07:07,460 So, that's the high level, we're going to screw with stuff talk. 163 00:07:08,120 --> 00:07:11,120 Now, we go ahead and we get into what's all good. 164 00:07:11,580 --> 00:07:13,140 The TCP IP stuff. 165 00:07:13,140 --> 00:07:17,600 So, how many people here were here at my talk last year? 166 00:07:19,260 --> 00:07:20,940 Got some loyalty going on. 167 00:07:21,000 --> 00:07:21,540 Thanks, guys. 168 00:07:22,440 --> 00:07:27,100 So, last year I came out here with a 12 pack of Coronas. 169 00:07:27,120 --> 00:07:29,740 And by the time I got off stage, there were none left. 170 00:07:31,520 --> 00:07:34,460 I'm sorry, you know, I work for a company. 171 00:07:34,580 --> 00:07:36,540 I can't do that again, you know. 172 00:07:36,980 --> 00:07:41,640 I really wish there was some way this could still happen. 173 00:07:41,640 --> 00:07:47,320 You know, but I can't do it. 174 00:07:47,360 --> 00:07:49,860 I could have nothing to do with this, guys. 175 00:07:50,860 --> 00:07:57,500 However, I will be very happy with people in the audience who happen to mess with my head. 176 00:07:58,040 --> 00:07:59,480 So, here's the deal, guys. 177 00:07:59,620 --> 00:08:01,000 This is not a BS thing. 178 00:08:01,120 --> 00:08:04,180 You are here to fuck with my head like I'm here to fuck with yours. 179 00:08:04,460 --> 00:08:07,520 Write notes, take notes, like Fizz here last year, 180 00:08:07,680 --> 00:08:11,500 who I unfortunately totally forgot to give props to. 181 00:08:12,560 --> 00:08:13,760 Been bugging me all year. 182 00:08:15,020 --> 00:08:19,080 So, if I am happy, good things may occur. 183 00:08:24,640 --> 00:08:25,620 Welcome to DEF CON. 184 00:08:26,420 --> 00:08:27,720 So, what are we talking about? 185 00:08:27,880 --> 00:08:29,040 Well, what pisses me off? 186 00:08:29,260 --> 00:08:33,700 What pisses me off is trying to get an IP address when there's no DHCP server to say, 187 00:08:33,740 --> 00:08:34,300 here you go, Dan. 188 00:08:34,680 --> 00:08:35,400 Go have one. 189 00:08:35,500 --> 00:08:35,880 Have fun. 190 00:08:37,160 --> 00:08:38,520 So, I started a little research. 191 00:08:38,660 --> 00:08:40,480 I'm like, how do we go ahead and we fix this problem? 192 00:08:40,480 --> 00:08:41,820 Well, what's the classic approach? 193 00:08:42,280 --> 00:08:48,340 Well, ARP goes ahead and it spews out all this traffic looking for IP to MAC address translations. 194 00:08:49,020 --> 00:08:52,800 Now, let me go ahead and take a second for the people in the audience who don't know, 195 00:08:52,880 --> 00:08:55,820 I don't know, the absolute precise mechanism of ARP. 196 00:08:56,300 --> 00:08:59,880 The way Ethernet works, it's a little like taking a taxi. 197 00:09:00,080 --> 00:09:03,340 If you're going somewhere in town, you're going to take a taxi. 198 00:09:03,480 --> 00:09:05,380 You're going to use local transport. 199 00:09:05,700 --> 00:09:09,340 But if you're traveling 3,000 miles to some random conference, 200 00:09:09,340 --> 00:09:12,280 well, you're still going to take a taxi. 201 00:09:12,480 --> 00:09:15,540 Because you still need to get, wherever you are ain't where you want to be. 202 00:09:15,800 --> 00:09:18,220 But you're going to take a taxi to the airport. 203 00:09:18,620 --> 00:09:21,300 Now, this is very much how Ethernet works. 204 00:09:21,640 --> 00:09:25,540 In Ethernet, you look, okay, am I going somewhere on my network? 205 00:09:25,800 --> 00:09:31,840 If so, I tell the taxi driver, hey, you know, let's go to this address in wherever we are. 206 00:09:32,220 --> 00:09:36,460 And as is anything, anytime you want to go to a destination, you want to go to a store, 207 00:09:36,640 --> 00:09:38,620 you go to Yahoo, you get the address. 208 00:09:38,620 --> 00:09:39,800 You get the local address. 209 00:09:40,100 --> 00:09:41,440 That's what ARP does. 210 00:09:41,680 --> 00:09:43,020 It gets the local address. 211 00:09:43,320 --> 00:09:47,140 But, let's say you want to go too far to go by taxi. 212 00:09:47,400 --> 00:09:48,560 Then you go to the airport. 213 00:09:48,760 --> 00:09:50,000 You take the address of the airport. 214 00:09:50,320 --> 00:09:52,520 Your destination is still really far away. 215 00:09:52,720 --> 00:09:55,540 But your address that you're taking the taxi to is the airport. 216 00:09:56,040 --> 00:09:57,700 Now, let's talk about some new techniques. 217 00:09:59,260 --> 00:10:00,560 Well, router detection. 218 00:10:01,940 --> 00:10:05,760 Turns out, you can bounce packets, still talking locally, 219 00:10:06,040 --> 00:10:08,600 you can bounce packets off of your network. 220 00:10:08,620 --> 00:10:09,160 You can bounce packets off of routers. 221 00:10:09,660 --> 00:10:12,580 That's how you decide, find out that they are routers. 222 00:10:12,720 --> 00:10:14,780 One of the things you need to do when you're on a network 223 00:10:14,780 --> 00:10:16,000 is you need to find out, well, what's a router? 224 00:10:16,260 --> 00:10:18,780 So you can look at all the MAC addresses that are out there. 225 00:10:19,620 --> 00:10:21,980 And you just basically send them traffic. 226 00:10:22,140 --> 00:10:24,580 And you send them traffic in a way such that you see, 227 00:10:24,780 --> 00:10:28,560 hey, I need you to send this local packet ideally to me. 228 00:10:30,020 --> 00:10:31,580 And you see if you get something back. 229 00:10:31,980 --> 00:10:35,260 It's the basic equivalent of going to the airport 230 00:10:35,260 --> 00:10:37,180 and picking up another taxi 231 00:10:37,180 --> 00:10:38,880 and going somewhere else local in town. 232 00:10:39,300 --> 00:10:40,500 That's how you know it's an airport 233 00:10:40,500 --> 00:10:42,700 because it's very easy to pick up taxis there. 234 00:10:43,440 --> 00:10:48,420 So the first new thing is you can send a packet to a Cisco on your LAN 235 00:10:49,080 --> 00:10:50,820 and you can detect that it's a router 236 00:10:50,820 --> 00:10:53,860 because if you basically back address to yourself, 237 00:10:54,180 --> 00:10:57,780 in other words, you take an IP in its addressable range, 238 00:10:58,020 --> 00:11:00,600 like, you know, you basically say I'm still coming to the same city, 239 00:11:01,200 --> 00:11:03,600 it'll go ahead and it'll send traffic back to you. 240 00:11:03,900 --> 00:11:07,000 Now, it turns out you need to go ahead and when you're talking to the router 241 00:11:07,180 --> 00:11:08,780 and doing this spoofed local transaction, 242 00:11:09,480 --> 00:11:13,460 you need to actually be telling the router you're coming to somewhere local. 243 00:11:14,000 --> 00:11:16,360 So you can actually figure out the ranges 244 00:11:16,360 --> 00:11:19,840 within which the router will route locally on your interface 245 00:11:19,840 --> 00:11:23,800 based off of what is the range of acceptable IPs. 246 00:11:23,960 --> 00:11:27,760 So you try a 10.0, a 10.1, 10.2. 247 00:11:27,820 --> 00:11:29,220 You see what is the range. 248 00:11:29,360 --> 00:11:30,620 You do what's called a binary search. 249 00:11:30,760 --> 00:11:31,620 It's relatively straightforward. 250 00:11:31,880 --> 00:11:32,800 It works really quickly. 251 00:11:34,280 --> 00:11:36,160 Now, here's where it gets really interesting. 252 00:11:36,160 --> 00:11:37,260 This is whatever. 253 00:11:38,600 --> 00:11:40,600 What if all the IP addresses are taken? 254 00:11:40,740 --> 00:11:42,140 What if you just don't have any more? 255 00:11:42,500 --> 00:11:44,480 And this is not a theoretical issue. 256 00:11:44,780 --> 00:11:46,860 When I was at Black Hat, I'm like paying, you know, 257 00:11:46,860 --> 00:11:47,920 can I go ahead and have an IP? 258 00:11:48,140 --> 00:11:49,120 I've got some hacking to do. 259 00:11:49,280 --> 00:11:51,080 And she's like, Dan, I'm sorry, you know, 260 00:11:51,540 --> 00:11:53,700 all the exhibitors have taken the IPs. 261 00:11:53,700 --> 00:11:54,920 I'm like, that sucks. 262 00:11:56,080 --> 00:11:56,900 Check this out. 263 00:11:57,140 --> 00:12:01,220 How do we normally, normally how do we get new IP addresses? 264 00:12:01,960 --> 00:12:02,900 Well, we use NAT. 265 00:12:03,580 --> 00:12:06,140 NAT means, you know, the NAT is only respectful. 266 00:12:06,160 --> 00:12:07,340 You're not expecting one IP address. 267 00:12:07,900 --> 00:12:12,220 Usually the IP address that you're getting from your DSL provider or something. 268 00:12:12,820 --> 00:12:13,460 Usually. 269 00:12:13,740 --> 00:12:15,120 I don't do things usually. 270 00:12:17,060 --> 00:12:21,880 So what this basically means, if you send a packet from this magic IP, 271 00:12:22,760 --> 00:12:25,480 packets will be returned to this magic IP. 272 00:12:26,700 --> 00:12:28,260 Now, problem two. 273 00:12:28,920 --> 00:12:31,160 Multiple hosts need to be networked. 274 00:12:31,380 --> 00:12:33,820 You've got one address, you've got multiple hosts. 275 00:12:33,820 --> 00:12:38,280 So what NAT does is it takes this one address that the outside world likes, 276 00:12:38,860 --> 00:12:40,880 and it uses a different range internally. 277 00:12:41,120 --> 00:12:42,500 And then it translates between the two. 278 00:12:43,720 --> 00:12:45,980 So we've got here what I just described, 279 00:12:46,040 --> 00:12:48,220 a problem where the network is out of IP addresses. 280 00:12:48,560 --> 00:12:49,720 They're all in use. 281 00:12:50,000 --> 00:12:52,700 There are more hosts that want IPs than there are IPs to give. 282 00:12:53,040 --> 00:12:55,220 Well, we couldn't use NAT. 283 00:12:55,420 --> 00:12:57,120 I mean, there's not even one IP, right? 284 00:12:57,240 --> 00:12:58,120 We don't have anything. 285 00:12:59,600 --> 00:13:02,040 Anyone here ever heard of an art man in the middle attack? 286 00:13:02,340 --> 00:13:02,620 No. 287 00:13:04,400 --> 00:13:07,040 So you just sort of take someone else's IP. 288 00:13:08,240 --> 00:13:11,300 And now you've got an IP that the outside world likes. 289 00:13:11,580 --> 00:13:14,160 You tell the client you're the router, the router you're the client. 290 00:13:14,280 --> 00:13:17,340 You now control traffic for an externally respected IP address. 291 00:13:17,540 --> 00:13:20,260 You NAT off of someone else's IP, guys. 292 00:13:21,620 --> 00:13:23,400 So this is relatively straightforward. 293 00:13:23,720 --> 00:13:26,460 You've taken someone's IP and... 294 00:13:26,460 --> 00:13:27,680 Hang on, how am I going to do this? 295 00:13:27,740 --> 00:13:28,800 Usually I do this with a couple hands. 296 00:13:29,480 --> 00:13:29,860 So. 297 00:13:31,280 --> 00:13:32,180 Let me do this. 298 00:13:33,140 --> 00:13:33,620 What's up? 299 00:13:35,580 --> 00:13:37,760 Can a goon go ahead and give this guy a mic? 300 00:13:41,800 --> 00:13:44,520 What if the router doesn't support gratuitous ARP? 301 00:13:44,800 --> 00:13:45,160 Ah. 302 00:13:46,700 --> 00:13:48,220 A, surprisingly rare. 303 00:13:49,080 --> 00:13:50,900 B, you go ahead and you wait. 304 00:13:50,980 --> 00:13:53,400 And sooner or later, they will update their cache. 305 00:13:53,860 --> 00:13:56,540 And when you try it, basically you're stuck in a delay mode. 306 00:13:57,340 --> 00:14:01,980 Then you basically go ahead and try to find a silent node that is still out there. 307 00:14:01,980 --> 00:14:03,520 And you convince the router. 308 00:14:03,740 --> 00:14:06,000 Because at this point, it's expired from his cache. 309 00:14:06,420 --> 00:14:08,700 At this point, you go ahead and you feed him. 310 00:14:09,260 --> 00:14:12,300 So you might say, Dan, you know, how come you're a heck of a lot... 311 00:14:12,300 --> 00:14:14,320 You're going to beat the legitimate host. 312 00:14:14,840 --> 00:14:19,240 Well, because I use raw packets and I'm not messing around with kernels. 313 00:14:19,500 --> 00:14:21,520 And I write really fast code. 314 00:14:21,880 --> 00:14:23,500 But you're absolutely right. 315 00:14:23,600 --> 00:14:30,240 If you have a router that is not respecting gratuitous ARPs and has a very small window in which it's willing to accept ARP cache updates. 316 00:14:32,360 --> 00:14:34,060 Then you're not in a good place. 317 00:14:35,320 --> 00:14:35,840 Alright. 318 00:14:35,940 --> 00:14:37,080 So basically what happens. 319 00:14:37,260 --> 00:14:39,300 You made in the middle against an existing IP. 320 00:14:40,960 --> 00:14:43,660 So now you are passing someone else's traffic. 321 00:14:44,240 --> 00:14:44,760 Legitimately. 322 00:14:45,400 --> 00:14:47,160 Packet goes from the client to the router. 323 00:14:47,340 --> 00:14:48,420 Packet goes from the router. 324 00:14:48,480 --> 00:14:50,800 You manually move it back to the client. 325 00:14:51,080 --> 00:14:52,500 But there's another possibility. 326 00:14:53,200 --> 00:14:55,620 In this second magic network of yours. 327 00:14:55,700 --> 00:15:00,220 You are injecting traffic into this other person's network. 328 00:15:00,220 --> 00:15:02,060 And the traffic goes out. 329 00:15:02,380 --> 00:15:03,520 Traffic comes back. 330 00:15:03,600 --> 00:15:04,920 You say, hey, wait a second. 331 00:15:05,160 --> 00:15:06,560 Do I recognize this? 332 00:15:06,820 --> 00:15:13,780 Does this correspond to a packet from an outgoing session that I went ahead and initiated and not the legitimate client? 333 00:15:14,520 --> 00:15:17,780 Well, then I'm going to go ahead and I'm going to NAT it back where it was supposed to be. 334 00:15:18,060 --> 00:15:21,700 And if it's not something I recognize, that must be a packet to the legitimate host. 335 00:15:21,980 --> 00:15:24,380 So basically you get to splice in. 336 00:15:24,900 --> 00:15:28,000 Now you might say, Dan, this is pretty black hat for you. 337 00:15:28,060 --> 00:15:29,500 You usually just mess with stuff. 338 00:15:29,500 --> 00:15:30,940 You don't do anything that's just for attacks. 339 00:15:31,680 --> 00:15:35,660 Well, the day I do something that's just for attacks is the day I'm not very creative. 340 00:15:35,900 --> 00:15:41,180 Because it turns out this is a great, great way to migrate a server from one machine to another. 341 00:15:41,420 --> 00:15:43,440 Because think about this for a second. 342 00:15:43,580 --> 00:15:44,400 You can go ahead. 343 00:15:44,480 --> 00:15:45,760 You start up a second server. 344 00:15:46,000 --> 00:15:48,300 And it handles all new sessions. 345 00:15:48,660 --> 00:15:51,940 The old sessions, you keep moving back to the old host. 346 00:15:52,120 --> 00:15:57,840 And since you're keeping track of all the sessions you're moving, you know the moment the old host has no one else listening. 347 00:15:57,840 --> 00:16:00,820 So this goes ahead and lets you do a graceful migration. 348 00:16:01,280 --> 00:16:03,440 It lets you do a phased migration. 349 00:16:03,940 --> 00:16:06,840 It links in with change control and change management. 350 00:16:07,040 --> 00:16:12,700 These are all kind of really cool things in the if you take the network down, I'm going to kick your ass world. 351 00:16:15,620 --> 00:16:17,480 So, wait, wait, get someone the mic. 352 00:16:22,340 --> 00:16:24,220 Ah, very, very little. 353 00:16:24,360 --> 00:16:26,020 I mean very, very little. 354 00:16:26,020 --> 00:16:34,580 I mean the code I'm doing, I cannot make it get past like .5% CPU on like a really weak processor. 355 00:16:34,960 --> 00:16:38,600 It turns out NAT is really, really low, low CPU. 356 00:16:38,840 --> 00:16:40,560 That's why idiot boxes can do it. 357 00:16:41,760 --> 00:16:43,880 So don't even worry about load. 358 00:16:44,640 --> 00:16:51,060 It does get a little bit questionable if you are starting to get into the thousands, tens of thousands, hundreds of thousands of sessions model. 359 00:16:51,280 --> 00:16:55,280 Then you actually want to go ahead and you don't use some random proof of concept. 360 00:16:55,280 --> 00:16:57,080 You use a dedicated load balancer box. 361 00:16:57,940 --> 00:16:58,580 All right. 362 00:16:58,760 --> 00:17:00,240 So, more tricks. 363 00:17:01,080 --> 00:17:01,820 Oh, yeah. 364 00:17:01,900 --> 00:17:03,760 So this, a little word of warning. 365 00:17:04,000 --> 00:17:08,160 This is the kind of thing that people have been discovering every three or four months for the past ten years. 366 00:17:09,000 --> 00:17:20,240 It turns out when there's a scan ran scan or there's a big port flood or scanning flood, a router has to go ahead and it says, okay, what's the local address for all of these IP addresses? 367 00:17:20,480 --> 00:17:21,540 And some of them aren't there. 368 00:17:22,040 --> 00:17:24,700 So these requests are broadcast. 369 00:17:25,280 --> 00:17:33,020 When you receive an incoming session or incoming scan, not only do you see the scan, you also see all these broadcasts. 370 00:17:33,020 --> 00:17:42,580 So even on a switch network, your paranoia level can be increased because, oh, wait a second, not only am I getting flooded, but I see evidence everyone around me is getting flooded as well. 371 00:17:43,420 --> 00:17:45,680 It's an additional thing we can do for paranoia. 372 00:17:45,720 --> 00:17:46,180 I'm serious. 373 00:17:46,420 --> 00:17:48,560 It's rediscovered every three or four months. 374 00:17:48,720 --> 00:17:52,120 I think I'm the latest guy since, you know, the PCAP team. 375 00:17:53,760 --> 00:17:54,520 Link cat. 376 00:17:54,940 --> 00:17:56,060 Neat little fun toy. 377 00:17:57,200 --> 00:17:59,020 So, you know, packet coding is great. 378 00:17:59,100 --> 00:18:00,100 Packet coding is wonderful. 379 00:18:00,320 --> 00:18:08,900 I'm actually working my, working really hard to make it easier, working on libpaketo to make it so you can just have a nice, unified interface for the network. 380 00:18:09,200 --> 00:18:13,860 You don't need to go through the misery that I did, you know, I code so you don't have to, all that stuff. 381 00:18:14,520 --> 00:18:19,080 But that being said, at the end of the day, some of you just do not want to muck around with C. 382 00:18:19,500 --> 00:18:22,100 You do not want to muck around with my language of toys, my code. 383 00:18:22,100 --> 00:18:23,240 My library of choice and whatnot. 384 00:18:23,720 --> 00:18:24,240 But you know what? 385 00:18:24,280 --> 00:18:29,660 I think anybody who's anyone who's even done any programming can handle moving around raw text. 386 00:18:30,440 --> 00:18:30,940 That's it. 387 00:18:31,140 --> 00:18:36,720 Like, raise your hand if you've ever used copy and paste in a clipboard. 388 00:18:39,300 --> 00:18:40,860 I'm here to support you. 389 00:18:42,560 --> 00:18:45,560 So, let's talk about some fun stuff we can do with link cat. 390 00:18:46,020 --> 00:18:48,080 First of all, we can run the net through strings. 391 00:18:49,180 --> 00:18:50,740 Strings is a very simple tool. 392 00:18:50,740 --> 00:18:53,580 It basically says, hey, does this look like something a human being could read? 393 00:18:53,840 --> 00:18:54,580 Oh, it is? 394 00:18:54,760 --> 00:18:56,440 Okay, I'll go ahead and I'll dump it to screen. 395 00:18:57,160 --> 00:18:58,780 So, it trashes all the headers. 396 00:18:59,360 --> 00:19:04,400 But you actually get to see every single type of packet that's going on in the network that's human readable. 397 00:19:05,660 --> 00:19:08,780 Unfortunately, the text on screen is not human readable because it's really tiny. 398 00:19:10,080 --> 00:19:10,480 Damn. 399 00:19:10,800 --> 00:19:13,720 But basically, what you're seeing there is, oh, there's a CDP packet. 400 00:19:13,880 --> 00:19:16,440 There's a C2900XL on that network. 401 00:19:16,740 --> 00:19:20,500 Here's a web request to my website and, you know, some other stuff. 402 00:19:20,740 --> 00:19:23,640 Like EHP, the Cisco identifying its interface and so on. 403 00:19:23,780 --> 00:19:25,660 Turns out you don't even need link cat to do this. 404 00:19:26,080 --> 00:19:33,460 You run tcpdump-w and run dash saying go ahead and spit the output out to command, out to the standard out. 405 00:19:33,840 --> 00:19:36,620 The dash S2000 says give me the entire packet. 406 00:19:36,800 --> 00:19:38,580 And then you pipe that into strings. 407 00:19:38,980 --> 00:19:39,900 And what do you see? 408 00:19:39,960 --> 00:19:42,840 Again, you see the raw packet data run through strings. 409 00:19:43,080 --> 00:19:46,140 And so we see some UPnP traffic, some SSH traffic. 410 00:19:46,440 --> 00:19:47,440 And that thing down there? 411 00:19:50,100 --> 00:19:50,580 EJEDEFCAZ. 412 00:19:50,740 --> 00:19:55,680 Yeah, that's how IBM decided it would be a good idea to encode the name BSD. 413 00:19:57,440 --> 00:20:06,540 Yeah, so Samba SMB, the spec was basically written in about 1984 by some very, very strange IBM engineers. 414 00:20:07,040 --> 00:20:09,680 I someday must buy them a drink. 415 00:20:10,760 --> 00:20:11,820 There's some strange folk. 416 00:20:13,040 --> 00:20:14,980 So, ping over copy and paste. 417 00:20:15,100 --> 00:20:16,440 This is me supporting you guys. 418 00:20:16,740 --> 00:20:20,420 So I go ahead and I go up there and I go ahead and I ping news.com. 419 00:20:21,080 --> 00:20:23,060 What happens at that link cat window? 420 00:20:23,520 --> 00:20:25,280 I see and it's in the blue text. 421 00:20:25,520 --> 00:20:27,580 Those are the bytes that contain a ping. 422 00:20:27,800 --> 00:20:33,480 And you'll see at the end if you're really, really close to the string, 303132333435. 423 00:20:33,740 --> 00:20:36,760 It's basically a stock little ICMP header. 424 00:20:37,380 --> 00:20:43,240 Now I go ahead and so when I do the ping, the blue thing is what was sent. 425 00:20:43,380 --> 00:20:46,920 The green is the response from the internet, from news.com. 426 00:20:47,080 --> 00:20:49,420 And as you see at the top, there's an actual response. 427 00:20:50,560 --> 00:20:52,580 Now we go ahead and we copy that. 428 00:20:53,300 --> 00:20:54,960 Now we go ahead and we put link cat in. 429 00:20:55,380 --> 00:20:57,920 Not only do we receive packets, we also send them. 430 00:20:58,180 --> 00:21:01,960 We take that same green string of bytes and we paste it. 431 00:21:02,060 --> 00:21:02,380 That's it. 432 00:21:03,420 --> 00:21:04,940 And it shows up on the network in blue. 433 00:21:05,180 --> 00:21:06,520 And in green is the reply. 434 00:21:08,060 --> 00:21:09,640 Clippy just forged a ping. 435 00:21:12,800 --> 00:21:13,420 All right. 436 00:21:13,500 --> 00:21:16,220 So let's move on to ScanRam, the toy that everyone loves. 437 00:21:17,920 --> 00:21:18,900 ScanRam, what is it? 438 00:21:19,420 --> 00:21:21,220 I'm not here to repeat the talk last year. 439 00:21:21,260 --> 00:21:21,580 Don't worry. 440 00:21:21,980 --> 00:21:23,280 I'm a little more creative than that. 441 00:21:23,400 --> 00:21:24,440 Not much, but a little. 442 00:21:24,640 --> 00:21:24,900 Oh, wait. 443 00:21:25,160 --> 00:21:26,520 Goon, can we get a mic over here? 444 00:21:28,620 --> 00:21:29,360 Oh, forget it. 445 00:21:29,380 --> 00:21:30,120 I'm probably closer. 446 00:21:32,400 --> 00:21:37,680 It's a stateless TCP port scanner that uses the concept of TCP sin cookies. 447 00:21:39,540 --> 00:21:40,280 Man's got it. 448 00:21:46,440 --> 00:21:47,860 And you don't. 449 00:21:50,020 --> 00:21:55,240 One of the cooler things that I didn't really talk about that much last year is ScanRam 450 00:21:55,240 --> 00:21:56,800 isn't just a really fast port scanner. 451 00:21:57,000 --> 00:22:01,900 It happens to be able to use the TTL value to estimate how far a packet has traveled. 452 00:22:02,260 --> 00:22:03,400 Now, this has been done before. 453 00:22:03,800 --> 00:22:07,460 Notably, POF, the passive OS fingerprinter, has a module that does this. 454 00:22:07,460 --> 00:22:12,600 But I go ahead and I'm starting to point out, you know, we can go ahead and we can use 455 00:22:13,140 --> 00:22:13,500 TTLs. 456 00:22:13,720 --> 00:22:15,000 Let me give you a little bit of background. 457 00:22:16,040 --> 00:22:20,000 A TTL is a value that is decremented every time a packet hops once. 458 00:22:20,180 --> 00:22:21,920 Oh, by the way, what time do I have to finish this talk? 459 00:22:23,400 --> 00:22:24,720 I happen to need to know that. 460 00:22:27,660 --> 00:22:28,500 When do I have to? 461 00:22:29,420 --> 00:22:30,380 30 minutes left? 462 00:22:30,580 --> 00:22:30,760 OK. 463 00:22:31,880 --> 00:22:32,240 Zoom. 464 00:22:32,420 --> 00:22:32,660 No. 465 00:22:33,940 --> 00:22:37,440 So basically, your TTL value will start at 32, 64, 75. 466 00:22:37,460 --> 00:22:38,800 Or 128 or 255. 467 00:22:39,160 --> 00:22:39,640 Why? 468 00:22:39,800 --> 00:22:42,320 No other reason but programmers like powers of two. 469 00:22:42,880 --> 00:22:46,800 So the TTL is decremented every time a packet goes over a router. 470 00:22:47,180 --> 00:22:50,840 So if you get a packet with a TTL of 60, it was decremented four times. 471 00:22:51,240 --> 00:22:52,000 Not necessarily. 472 00:22:52,020 --> 00:22:54,880 There are evil people like Fizz here who might fuck with the net. 473 00:22:55,960 --> 00:23:01,020 But in general, if you receive a packet with a TTL of 50, it went 14 hops. 474 00:23:01,240 --> 00:23:06,520 If you receive a packet that has a TTL of 15, it went 17 hops. 475 00:23:06,640 --> 00:23:06,820 Yeah. 476 00:23:07,460 --> 00:23:11,740 So, you know, you wonder why when you ping a host, it shows you the TTL. 477 00:23:11,820 --> 00:23:14,380 Because this was realized, you know, 10, 15 years ago. 478 00:23:14,520 --> 00:23:17,580 The only thing is you can actually apply it to arbitrary traffic. 479 00:23:18,560 --> 00:23:22,160 If anyone here is working on P2P, please go ahead. 480 00:23:22,420 --> 00:23:31,920 Use the TTLs on the incoming traffic to try to go ahead and shrink the maximum number of hops that your virtual network that you've overlaid goes ahead and uses. 481 00:23:32,120 --> 00:23:35,180 Because you're connected in Nutella to like 40 or 50 machines. 482 00:23:35,660 --> 00:23:36,680 Guess what, guys? 483 00:23:36,680 --> 00:23:42,280 You can go ahead and look at the TTLs and figure out which ones are close on the network and which ones are far away. 484 00:23:42,540 --> 00:23:44,180 And will it be a perfect optimization? 485 00:23:44,540 --> 00:23:44,760 No. 486 00:23:44,880 --> 00:23:46,460 But it will be a heck of a lot better. 487 00:23:48,920 --> 00:23:50,820 So, some returns from ScanRand. 488 00:23:51,080 --> 00:23:52,920 One, we've got email hijacking. 489 00:23:53,520 --> 00:23:55,440 This was at Black Hat Con. 490 00:23:56,140 --> 00:23:59,600 And I'm testing ScanRand, making sure I'm not about to look like an idiot. 491 00:24:00,280 --> 00:24:01,420 And I'm like, oh, okay. 492 00:24:01,500 --> 00:24:04,800 So I see, you know, it's 19 hops away for my web server. 493 00:24:04,940 --> 00:24:06,660 19 hops away for my SSL server. 494 00:24:06,660 --> 00:24:10,920 But somehow my mail server has teleported to four hops away. 495 00:24:11,600 --> 00:24:14,540 Not the rest of my machine, just my mail process. 496 00:24:16,000 --> 00:24:16,480 Yeah. 497 00:24:16,720 --> 00:24:20,060 So the hotel was hijacking all our outgoing email. 498 00:24:21,600 --> 00:24:22,080 Busted. 499 00:24:22,580 --> 00:24:24,960 This is one of the problems with hijacking, guys. 500 00:24:25,020 --> 00:24:30,760 You go ahead and you screw with the TTL and it's not straightforward to figure out what it's supposed to be. 501 00:24:33,640 --> 00:24:36,640 So, this is an opportunity for someone to correct me, by the way. 502 00:24:36,660 --> 00:24:47,280 So, we went ahead and we detected that every single, all traffic to port 25 anywhere on the internet was being routed through this hotel server. 503 00:24:47,980 --> 00:24:52,340 This lasted about five or ten minutes after I discovered it because I mentioned it to the wrong person. 504 00:24:54,020 --> 00:24:56,060 So that's one thing you can do with ScanRand. 505 00:24:56,220 --> 00:24:58,720 Look for differences in the TTLs when you do your scans. 506 00:24:59,220 --> 00:25:01,240 Another thing is we can go ahead, look at this thing. 507 00:25:01,460 --> 00:25:04,560 It's hard to see, but basically we have three different situations here. 508 00:25:04,560 --> 00:25:06,940 We have up ports that are 11 hops away. 509 00:25:07,140 --> 00:25:09,260 We have down ports that are 12 hops away. 510 00:25:09,440 --> 00:25:11,720 We have down ports that are 22 hops away. 511 00:25:11,820 --> 00:25:12,700 What's going on here? 512 00:25:13,320 --> 00:25:22,540 Well, it turns out that the PIX firewall, when it blocks a packet, the packet decrements all the way to the PIX. 513 00:25:22,800 --> 00:25:25,140 And then the PIX looks at it and says, I'm supposed to block it. 514 00:25:25,700 --> 00:25:27,880 And it flips the addresses around. 515 00:25:28,040 --> 00:25:29,120 It flips the ports around. 516 00:25:29,360 --> 00:25:31,440 It sets the response to a reset ACK. 517 00:25:31,560 --> 00:25:33,020 And it sends it back out. 518 00:25:33,020 --> 00:25:39,280 Now note, I did not say it sets the TTL back up to 255 or 128 or 64. 519 00:25:39,700 --> 00:25:42,680 So what happens is the packet decremented all the way there. 520 00:25:42,840 --> 00:25:45,460 And it decrements all the way back. 521 00:25:46,240 --> 00:25:53,380 That's why a legitimate up is 11 hops away, but somehow an illegitimate down is 22 hops away. 522 00:25:53,540 --> 00:25:55,440 Because 11 times 2 is 22. 523 00:25:59,040 --> 00:26:00,720 That's what I'm here for. 524 00:26:01,800 --> 00:26:03,020 This doesn't work. 525 00:26:03,840 --> 00:26:06,860 This does not work nearly as much as I wish it still did. 526 00:26:07,820 --> 00:26:12,880 Unfortunately, the problem with giving talks that a bunch of NAT vendors go to is they get a clue from you. 527 00:26:14,080 --> 00:26:16,580 This is why I didn't talk about the ActiveX lead for so long. 528 00:26:17,220 --> 00:26:22,020 So yeah, so ICMP errors contain a full copy of the IP packet that elicited them. 529 00:26:22,380 --> 00:26:29,800 Yeah, on old NATs, they NAT the IP, but they do not NAT the IP inside of the NAT, inside of the ICMP error. 530 00:26:29,800 --> 00:26:36,820 So on this NAT here, where it's blue underlined, 172.16.197 is a private IP. 531 00:26:37,100 --> 00:26:40,900 We get two hops out, we get past the NAT, the ICMP error on the tracer out. 532 00:26:41,080 --> 00:26:41,940 Guess what, guys? 533 00:26:42,160 --> 00:26:44,280 216.137.24.206. 534 00:26:44,480 --> 00:26:45,700 Don't attack that, guys. 535 00:26:48,620 --> 00:26:50,160 Multi-home node detection. 536 00:26:50,380 --> 00:26:51,240 This was a dare. 537 00:26:51,720 --> 00:26:55,000 This is one of my coworkers saying, I bet you can't do this. 538 00:26:55,180 --> 00:26:56,280 That's not possible. 539 00:26:57,340 --> 00:26:58,340 So I went ahead. 540 00:26:58,600 --> 00:26:58,860 You know. 541 00:26:59,800 --> 00:27:00,380 I bled for a while. 542 00:27:02,580 --> 00:27:04,720 You have a firewalled corporate network. 543 00:27:05,280 --> 00:27:08,080 It's not supposed to be receiving port scans from the outside world. 544 00:27:09,100 --> 00:27:10,360 So let me ask you something. 545 00:27:10,540 --> 00:27:16,080 What happens if you get a port scan from the outside world just show up on your firewalled network? 546 00:27:16,300 --> 00:27:17,100 It's just there. 547 00:27:17,420 --> 00:27:18,380 Hello, how you doing? 548 00:27:18,420 --> 00:27:20,060 Here's all these packets from this external NAT. 549 00:27:21,800 --> 00:27:25,180 Well, what should happen is it hits all these machines. 550 00:27:25,460 --> 00:27:28,260 And the machines reply if the port's up or the port's down. 551 00:27:28,260 --> 00:27:31,580 And the replies go ahead and go to go out your firewall. 552 00:27:31,740 --> 00:27:31,940 Right? 553 00:27:33,340 --> 00:27:39,200 And your firewall looks at all these syntax and it's like, who are you responding to? 554 00:27:39,360 --> 00:27:40,400 What is your point here? 555 00:27:40,660 --> 00:27:42,240 And it goes ahead and it kicks you out. 556 00:27:42,520 --> 00:27:43,480 I mean, it drops the packet. 557 00:27:43,600 --> 00:27:45,440 This is not what I'm here to do. 558 00:27:46,160 --> 00:27:53,340 Ah, but what if you've got a host on a DSL link that is only going ahead and using the internal network to access internal network IPs? 559 00:27:53,940 --> 00:27:56,700 Well, then what it does, it goes ahead and looks at this routing table. 560 00:27:56,900 --> 00:27:57,680 It says, oh. 561 00:27:57,680 --> 00:28:00,060 I've got a packet destined for the internet. 562 00:28:00,220 --> 00:28:02,360 I'm going to send it out of my illicit DSL line. 563 00:28:03,920 --> 00:28:05,760 You control the machine on the internet. 564 00:28:06,120 --> 00:28:18,240 And what happens is this machine, this packet, this outgoing response doesn't go through the firewall, goes out through the DSL line, shows up on the outside box with your corporate IP address. 565 00:28:18,560 --> 00:28:23,980 You've just gone ahead and found a node that was not going, that did not have outgoing packets going through the firewall. 566 00:28:25,160 --> 00:28:25,960 Kind of cool. 567 00:28:26,200 --> 00:28:27,660 And this works, by the way. 568 00:28:27,660 --> 00:28:29,480 Someone get a mic over there. 569 00:28:29,980 --> 00:28:35,720 This works because ScanRand actually has completely separate scanning and receiving processes. 570 00:28:36,380 --> 00:28:39,980 And so you have a sender that's on the inside of your network. 571 00:28:40,120 --> 00:28:42,960 You have a receiver that's, you know, on a completely different network. 572 00:28:43,100 --> 00:28:44,460 But the two are able to communicate. 573 00:28:44,800 --> 00:28:46,720 Now, we had a question or comment over here? 574 00:28:50,980 --> 00:28:54,640 Now, would that only work for the host that's dual-homed? 575 00:28:54,680 --> 00:28:57,640 Or are you saying that the packets are going on to the internal network? 576 00:28:57,640 --> 00:29:00,360 And then going back out via the dual-homed host? 577 00:29:00,460 --> 00:29:23,300 Any host that is routing, basically any host that does not end up routing through the firewalled exit but is actually has its own way out will, when it looks at its route table to see where to send the reply, it's going to send it out towards its illicit default gateway as opposed to the legitimate one. 578 00:29:23,560 --> 00:29:23,800 Right. 579 00:29:24,140 --> 00:29:24,660 . 580 00:29:27,100 --> 00:29:27,620 . 581 00:29:27,620 --> 00:29:27,900 . 582 00:29:27,900 --> 00:29:28,700 Yeah. 583 00:29:29,480 --> 00:29:29,920 . 584 00:29:30,700 --> 00:29:31,140 . 585 00:29:32,420 --> 00:29:32,860 Okay. 586 00:29:33,100 --> 00:29:34,360 Now, there's a little issue. 587 00:29:35,080 --> 00:29:36,740 What about if they've got a NAT? 588 00:29:36,860 --> 00:29:41,760 They've got a link system that's before the firewall. 589 00:29:42,200 --> 00:29:45,800 So, basically, they're running their own firewall before the DSL line. 590 00:29:46,220 --> 00:29:49,000 Basically, they're running their own firewall, but it's a crappy one. 591 00:29:49,620 --> 00:29:53,640 It violates policy, but it's not as nasty of a situation. 592 00:29:53,820 --> 00:29:55,140 But you still want to try to find it. 593 00:29:55,360 --> 00:29:55,580 . 594 00:29:57,160 --> 00:29:58,000 . 595 00:30:05,120 --> 00:30:05,960 . 596 00:30:05,960 --> 00:30:06,560 . 597 00:30:06,560 --> 00:30:06,980 . 598 00:30:06,980 --> 00:30:07,160 . 599 00:30:07,160 --> 00:30:07,260 . 600 00:30:07,260 --> 00:30:07,480 . 601 00:30:07,480 --> 00:30:07,560 . 602 00:30:09,180 --> 00:30:10,020 . 603 00:30:16,240 --> 00:30:17,080 . 604 00:30:21,760 --> 00:30:22,600 . 605 00:30:22,600 --> 00:30:22,620 . 606 00:30:22,620 --> 00:30:22,640 . 607 00:30:22,640 --> 00:30:22,900 . 608 00:30:24,720 --> 00:30:25,560 . 609 00:30:25,560 --> 00:30:31,540 patch about 20 minutes after this talk better, is to try to use some kind of UDP message that 610 00:30:31,540 --> 00:30:36,900 goes ahead and elicits an echo, some kind of sending. Basically any kind of UDP service that 611 00:30:36,900 --> 00:30:43,580 if I send a packet to it, it sends a reply. SMB can work. This is just, you know, simple 612 00:30:43,580 --> 00:30:48,740 Windows file sharing. Very widely deployed and whatnot. The only problem is some DSL networks 613 00:30:48,740 --> 00:30:57,020 go ahead and they specifically filter this. UDP 161 also can work very, very well, but it's not 614 00:30:57,020 --> 00:31:01,460 nearly as widely deployed. It's more deployed than you would think, but it's not nearly as widely 615 00:31:01,460 --> 00:31:09,760 deployed. If there are suggestions for things to use, let me know. Wait, what? Hang on. 616 00:31:11,620 --> 00:31:17,740 Who's talking? Use 111 if it's Unix. 617 00:31:18,040 --> 00:31:18,620 Ah. 618 00:31:18,740 --> 00:31:24,800 That's port mapper, right? He's right. You'll go ahead and you'll find all the Unix machines 619 00:31:24,800 --> 00:31:29,620 that are multi-hosted, which has the nice little convenient feature of the smartest people will go 620 00:31:29,620 --> 00:31:35,120 ahead and be able to set up this multi-homing. Go ahead, guy with the mic. 621 00:31:35,260 --> 00:31:39,200 You could do 135 in Windows boxes, which you can't turn off unless you're running a local 622 00:31:39,200 --> 00:31:39,560 firewall. 623 00:31:40,000 --> 00:31:44,000 Ah, that's true. But the issue is that the DSL networks are shutting them. 624 00:31:44,160 --> 00:31:48,320 Or could you do the ICMP port unreachables for UDP with the firewall pass-throughs? 625 00:31:48,360 --> 00:31:48,720 Yeah. 626 00:31:48,740 --> 00:31:53,420 The only problem is an ICMP port unreachable would theoretically be, it would still be 627 00:31:53,420 --> 00:32:00,580 linked to the state table. Okay, we've got to keep moving through this. How am I doing for 628 00:32:00,580 --> 00:32:13,800 time? Okay, we're doing great, guys. Y'all got, everyone having fun here? Yeah. All right. 629 00:32:14,840 --> 00:32:18,720 ScanRand is really lazy code. It is. Especially 1.1. It's really easy to use. It's really easy to 630 00:32:18,720 --> 00:32:26,640 run. It's crap. So, yeah, that'll take the wind out of your sails. Now, ScanRand does not keep 631 00:32:26,640 --> 00:32:32,180 track of anything. I mean, it sends a packet, it receives it, it dumps it to the next, dumps it to 632 00:32:32,180 --> 00:32:38,340 standard out, and that's it. This happens to be good enough because even though ScanRand is 633 00:32:38,340 --> 00:32:43,140 dumping it to standard out, we are people and we have minds. And though people keep saying 634 00:32:43,140 --> 00:32:48,480 users are dumb and people are dumb, it turns out we're really good at integrating data across 635 00:32:48,480 --> 00:32:54,120 multiple lines, across time, across space, and so on. So, basically, we see 10 replies from 636 00:32:54,120 --> 00:32:59,460 ScanRand and we're able to analyze them as a group. Even though ScanRand as a program has no 637 00:32:59,460 --> 00:33:05,020 friggin' idea that there's any relationship. ScanRand doesn't know that, you know, that port 25 638 00:33:05,020 --> 00:33:12,440 was four hops away and port 443 was 19 hops away. But as a user, you see it, you integrate the 639 00:33:12,440 --> 00:33:18,460 data, and you know something ain't right. Packets don't exist in isolation. They don't exist 640 00:33:18,480 --> 00:33:25,300 together. There's more data in packets than just one. Let me give you an example. So, in TCP, TCP 641 00:33:25,300 --> 00:33:31,840 goes ahead and it does error correction. If a packet is dropped, it'll retry. You know, you're, 642 00:33:32,100 --> 00:33:39,200 someone hangs up on a phone. You're like, hello? Hello? Hello? Well, how many times do you say 643 00:33:39,200 --> 00:33:45,400 hello? What is the exact delay you use between your hellos? Networks have the same thing, but it's 644 00:33:45,400 --> 00:33:48,460 not specified. So, each different operating system has a specific delay. So, each different operating 645 00:33:48,480 --> 00:33:54,420 system will go ahead, and when you just shut up in TCP, the other side tries an unspecified 646 00:33:54,420 --> 00:33:59,160 amount of time to reestablish the connection. I didn't discover this. This is discovered by 647 00:33:59,160 --> 00:34:05,120 Frank Vesit. Veset. I don't know. French guy. Really cool guy. Can we do this with ScanRand? 648 00:34:05,480 --> 00:34:09,440 Well, it turns out that we can, but we need to prevent the kernel from going ahead and resetting 649 00:34:09,440 --> 00:34:14,860 it. Bug me later if you want the specifics. Just trying to be quick on it. But if you look, we're 650 00:34:14,860 --> 00:34:18,460 going ahead and we're allowing the other side to reply as many times as you want. So, we're going 651 00:34:18,460 --> 00:34:19,580 ahead and we're allowing the other side to reply as many times as you want. There's no resets going 652 00:34:19,580 --> 00:34:28,120 out. First host, we get a reply at 0.2 seconds, 3.2 seconds, and 9.1 seconds. That's a plus three 653 00:34:28,120 --> 00:34:33,600 and a plus six. This is a Windows machine. Next host, plus three and a plus six. That's another 654 00:34:33,600 --> 00:34:41,720 Windows machine. Next host, we got a one at 0.7. We got one at 4.5. We got one at 10.5, 22.7, 655 00:34:41,740 --> 00:34:48,320 and 46.7. Here's a plus four, a plus six, a plus 12, a plus four, 46 seconds after we sent the 656 00:34:48,320 --> 00:34:54,820 send to this host, it's still sending us Cinex. Guys, that's a Linux box. There's nothing 657 00:34:54,820 --> 00:35:01,980 in the packet. Nothing special about the packets. This is bits of data that are outside anything 658 00:35:01,980 --> 00:35:06,280 in there. We cannot find this out without integrating data across packets. 659 00:35:06,680 --> 00:35:11,220 So what's been done? You know, this is all the hype. You know, guess what? I don't want 660 00:35:11,220 --> 00:35:14,920 to write a state management engine. I don't want to write yet another database. So scan 661 00:35:14,920 --> 00:35:18,820 Rand will now just output SQL. You just pipe it into MySQL, pipe it into Postgres, pipe 662 00:35:18,820 --> 00:35:24,020 it into whatever. Write your own stuff to go ahead and parse it out. That's the model 663 00:35:24,020 --> 00:35:29,340 that I'm looking at to see us being able to take the data from scan Rand and really make 664 00:35:29,340 --> 00:35:35,640 it useful for large scale analysis. Just dumping out SQL, pipe it into the database. It turns 665 00:35:35,640 --> 00:35:41,340 out you can even do this over SSH. So you SSH into a remote host and pipe the data 666 00:35:41,340 --> 00:35:44,900 back into your local database. Or the other way around. Yes, I am. 667 00:35:44,900 --> 00:35:49,300 I know. There are injection attacks. The patch to get around, that's going to happen soon. 668 00:35:51,280 --> 00:35:55,620 So I got this strategy for OS fingerprinting. Let's focus on things where code actually 669 00:35:55,620 --> 00:36:00,940 exists. But the summary, you go ahead and you send out a batch of packets that go ahead 670 00:36:00,940 --> 00:36:05,540 and uniquely identify a host. Maybe it's what Fyodor is using for Nmap or what Ofer is using 671 00:36:05,540 --> 00:36:10,200 for Xprobe. Maybe it's the temporal fingerprinting stuff. You go ahead and you send out all the 672 00:36:10,200 --> 00:36:14,620 requests. Now you go ahead and you get a bunch of replies, right? There are three 673 00:36:14,620 --> 00:36:21,300 possibilities with your replies. A, you got no reply for a given host at all. B, you got some 674 00:36:21,300 --> 00:36:26,860 replies but not all of them, meaning you need to go ahead and do a retry on that host. Or C, you 675 00:36:26,860 --> 00:36:32,020 got all the necessary replies. You send a set of replies into Nmap's algorithm or Xprobe's 676 00:36:32,020 --> 00:36:37,480 algorithm or whatnot. What's cool about this, you know how scan Rand lets you scan an entire 677 00:36:37,480 --> 00:36:42,880 network for hosts in like four seconds? This will probably let you OS fingerprint them all in 678 00:36:42,880 --> 00:36:43,340 about a minute. 679 00:36:48,460 --> 00:36:57,320 So, this is the worst joke here. Who's down with TCP? Yeah, you know me. So, let's talk about TCP for a 680 00:36:57,320 --> 00:37:03,340 moment. This is so you understand what I'm about to talk about in a bit. TCP creates a reliable 681 00:37:03,340 --> 00:37:09,160 communication medium over a somewhat unreliable path. Now, errors are fixed at the end points. You 682 00:37:09,160 --> 00:37:14,480 can't have errors all the time. If you have errors at every hop, wireless. There's a protocol called 683 00:37:14,620 --> 00:37:21,360 Airhook. It's beautiful. It's genius. Go check it out. TCP is stream-oriented. It doesn't care how 684 00:37:21,360 --> 00:37:26,040 many packets it took to get bytes across. It is totally byte-oriented. When you're doing error 685 00:37:26,040 --> 00:37:34,760 recovery, it's like, hey, I got everything up to byte 10,200, wait, 12,345, and that's too many 686 00:37:34,760 --> 00:37:41,600 coronas. So, you're on a certain byte, not a certain packet number. Now, instead of expressing 687 00:37:41,600 --> 00:37:44,600 these byte offsets directly, they're represented by a certain number of packets. So, you're on a 688 00:37:44,620 --> 00:37:47,060 certain number of packets. They're represented as offsets from some initial value that's 689 00:37:47,060 --> 00:37:51,780 randomly generated. Randomly now, because if it's not randomly, there's a bunch of great blind 690 00:37:51,780 --> 00:37:55,820 spoofing attacks we're not going to go into. So, you can think of it like, hey, we started at 691 00:37:55,820 --> 00:38:04,800 1 million, and now I'm acknowledging 1,012,345. Do a subtraction. Gee, the last thing I got 692 00:38:04,800 --> 00:38:10,700 code from you was the 12,345th byte. Now, this is done, among other reasons, to prevent TCP 693 00:38:11,160 --> 00:38:14,600 spoofing. Someone wants to send you a packet. They have to know where in this 30-second period. 694 00:38:14,620 --> 00:38:20,820 two-bit range that you were last talking a little bit of window but we won't go into that so you 695 00:38:20,820 --> 00:38:26,560 can't do tcp spoofing right well what if what if the server sends it to the spoofer intentionally 696 00:38:27,520 --> 00:38:34,940 let me give you a little story you are the president of the united states god bless our souls 697 00:38:36,700 --> 00:38:40,100 hello to all the feds out there you guys rule so check it out 698 00:38:40,840 --> 00:38:47,440 let's be you're the president and everyone wants to talk to you and you cannot manage talking to 699 00:38:47,440 --> 00:38:53,440 everyone but don't worry it's capitol hill you've got no shortage of interns out there to 700 00:38:54,360 --> 00:38:58,740 handle the public for you so basically you're the president you receive letters 701 00:38:58,740 --> 00:39:03,180 and you pass it off to one of this horde of engineers or excuse me of interns 702 00:39:04,200 --> 00:39:07,740 you do not scale but anonymous interns scale just fine 703 00:39:10,100 --> 00:39:14,380 and they go ahead and when they reply of course they don't say oh hi you know i'm very nice to hear 704 00:39:14,380 --> 00:39:19,300 your opinion thank you anonymous intern number 345 no no no they say that the president united 705 00:39:19,300 --> 00:39:27,440 states hallelujah turns out we can do this with packets as well is it possible for a single host 706 00:39:27,440 --> 00:39:32,500 to do load balancing across nearly arbitrary network boundaries without any special code on 707 00:39:32,500 --> 00:39:37,920 the client yeah yeah it turns out we can do load balancing without any kind of care for network 708 00:39:37,920 --> 00:39:39,320 boundaries by basically 709 00:39:40,100 --> 00:39:41,600 client thinks it's talking to a server 710 00:39:42,320 --> 00:39:48,320 server is actually a redirector redirector goes ahead and sends the actual tcp packets although it works for any ip service 711 00:39:48,900 --> 00:39:50,400 any ip service 712 00:39:51,580 --> 00:39:53,360 goes out to the anonymous servers 713 00:39:54,220 --> 00:39:56,720 by some kind of i'll tell you how that works 714 00:39:57,160 --> 00:40:02,060 and when the servers reply they spoof the source ip of the redirector so from the client's 715 00:40:02,060 --> 00:40:07,060 perspective it sent a packet to a host and the host sends the packet back 716 00:40:07,600 --> 00:40:09,520 now let's talk about some details here 717 00:40:10,100 --> 00:40:12,920 again redirector upon receiving a packet from a client 718 00:40:12,920 --> 00:40:17,600 changes the ip destination recalculates the checksums sends the packet out the appropriate 719 00:40:17,600 --> 00:40:18,040 interface 720 00:40:18,500 --> 00:40:21,300 there are two session-based rules first of all you have to keep 721 00:40:21,300 --> 00:40:24,360 the whatever role you do has to be consistent by session 722 00:40:25,700 --> 00:40:29,880 hey you can use a tcp sort sport into a mod based on the number of re directors 723 00:40:29,880 --> 00:40:30,320 you have 724 00:40:30,780 --> 00:40:34,360 you can use the i- MC source especially once you get into geocoding 725 00:40:34,360 --> 00:40:39,280 so you look at the database to figure out what ip is and what country or what area and you going to try 726 00:40:39,280 --> 00:40:39,740 to minimize 727 00:40:39,740 --> 00:40:45,020 minimize the distance. There's all sorts of methods. There's a stateless. Stateful rules 728 00:40:45,020 --> 00:40:50,420 is you say, you know, I know who's talking where. I know I sent this many hosts over here. This 729 00:40:50,420 --> 00:40:54,700 guy's got some open slots. I'll send it there. Those are the stateful rules. They're harder to 730 00:40:54,700 --> 00:41:00,980 code, so I haven't done that yet. The anonymous server goes ahead. It receives this packet IP 731 00:41:00,980 --> 00:41:06,180 destined to it with some source of the legitimate source. And so normal socket code, normal 732 00:41:06,180 --> 00:41:13,140 application, squid, shoutcast proxy, whatever. It goes ahead and it replies. But the last moment 733 00:41:13,140 --> 00:41:17,600 in the, this Linux specific for the moment, last moment IP tables goes ahead and says, wait, 734 00:41:17,680 --> 00:41:22,600 wait, wait, wait, wait. If I send this reply from the anonymous server's IP, nobody's going to like 735 00:41:22,600 --> 00:41:27,740 it. Just like if the anonymous intern replies from the anonymous intern's name, people are going 736 00:41:27,740 --> 00:41:34,340 to be like, who the hell are you? So it fakes its IP to be that of the redirector. And then the 737 00:41:34,340 --> 00:41:36,160 packet goes to the client and the client. 738 00:41:36,180 --> 00:41:42,160 It's all happy. The client can actually notice this because of TTL errors. Now, where does it get 739 00:41:42,160 --> 00:41:47,940 you? First of all, global load distribution. Anyone can go ahead and have a server go ahead and 740 00:41:47,940 --> 00:41:53,920 spoof something else's IP. Somewhere, someone out there has extra bandwidth that they bought that 741 00:41:53,920 --> 00:42:00,380 they're not using. I want to start being able to see this being used to serve our traffic. But 742 00:42:00,380 --> 00:42:05,940 check it out. There's more that's happening here. Because the client, where is it acknowledging 743 00:42:05,940 --> 00:42:12,400 to? Is it acknowledging this great, nice data it's getting to the anonymous server that's doing 744 00:42:12,400 --> 00:42:18,020 everything? No, it's saying, thank you for the thousand bytes to the redirector. Thank you for 10,000 745 00:42:18,020 --> 00:42:23,240 bytes to the redirector. Thank you, thank you, thank you. The redirector's receiving information on 746 00:42:23,240 --> 00:42:29,220 how much data the client's getting. The redirector is receiving every couple of, you know, dozens of 747 00:42:29,220 --> 00:42:35,500 milliseconds updates on how much data it's getting from this anonymous server. Just by looking at the 748 00:42:35,940 --> 00:42:41,740 data set in the acts. This works today, this works now. You are able to measure the amount of traffic 749 00:42:41,740 --> 00:42:47,520 going on without even seeing it. And it's not even, you're not even being told, oh yeah, let me tell you 750 00:42:47,520 --> 00:42:51,980 something, I sent, you know, 10,000 bytes to this guy. No, the guy's telling you, hey, this guy just sent me 751 00:42:51,980 --> 00:42:58,360 10,000 bytes. Advanced things you can do which haven't been implemented yet. Theoretically, you can say, you 752 00:42:58,360 --> 00:43:04,000 know, that session over here is only getting 5K a second. This mirror sucks. By the way, have you gone, raise your 753 00:43:04,000 --> 00:43:08,820 hand if you've gone to a site that said, which of these 50 mirrors would you like to download a file from? 754 00:43:11,100 --> 00:43:17,020 This, this sucks. Guys, the way it needs to work is you go to one redirector, you download from the 755 00:43:17,020 --> 00:43:22,700 redirector, and if it says, okay, this is way too slow, it just moves you somewhere else. And it does all 756 00:43:22,700 --> 00:43:28,380 the application-specific negotiation for you, so you go ahead and you get the byte updated at the exact 757 00:43:28,380 --> 00:43:33,640 right point. That's how it should work. So this works for everything. Unfortunately, I have no net, so I 758 00:43:34,000 --> 00:43:39,680 couldn't do the live demo. But if I could do the live demo, I spent my time developing this, listening to 759 00:43:39,680 --> 00:43:46,080 digitally imported, and I was actually bouncing digitally imported off of this server. Excuse me, off the 760 00:43:46,080 --> 00:43:51,120 network of around three servers that every time I connected, it would come from a different source. Why is it 761 00:43:51,120 --> 00:43:58,840 great to do this? Because this means the music you're coding to is coming through your code. So if your code 762 00:43:58,840 --> 00:44:03,920 breaks, the music stops, and it sucks. So you're really motivated to fix it. 763 00:44:08,700 --> 00:44:15,920 Finally, this is the last thing I'm up to. I am so happy to finally get this to work. SSL versus IDS is the eternal 764 00:44:15,920 --> 00:44:24,500 conflict. SSL annoys me. Why does it annoy me? Because if your cert goes, oh, you're screwed. Oh, my God. Like all 765 00:44:24,500 --> 00:44:32,760 the traffic you've ever sent, like all your traffic from a year ago, exposed. All your traffic a year from now, exposed. So 766 00:44:32,760 --> 00:44:33,980 one day, they come in. They take the code. They take the code. They take the code. They take the code. They take the code. They 767 00:44:33,980 --> 00:44:40,660 make a cert, and you are screwed. This is like the only link-based protocol that has this flaw. I went and I 768 00:44:40,660 --> 00:44:46,360 harassed one of the authors of SSL about this, and he's like, Dan, we had like 1.5% of the available 769 00:44:46,360 --> 00:44:53,240 CPU power back then. Like, you got a point? That being said, SSL does some cool stuff. I respect the 770 00:44:53,240 --> 00:44:58,620 people who like it. IDS also annoys me. Hey, look, we're under attack. Oh, that's nice. 771 00:45:03,980 --> 00:45:10,200 Like, do you just not want to be able to sleep permanently? But that being said, I respect people who like 772 00:45:10,200 --> 00:45:19,460 both. Here's the problem. IDS says, I'm going to look on the network and see what's going on to make sure nothing bad 773 00:45:19,460 --> 00:45:27,680 gets through. SSL says, I'm going to go ahead and encrypt anything that is on the network so that no one else can 774 00:45:27,680 --> 00:45:32,900 watch it. You get one, you get the other, you don't get both. Ouch. 775 00:45:33,980 --> 00:45:38,680 Now, there are certain solutions. You can go ahead and you can transfer the cert and your IDS can do RSA 776 00:45:38,680 --> 00:45:46,120 decryption, and you know how IDSs are just busting at the seams with extra CPU cycles. No. You can go 777 00:45:46,120 --> 00:45:51,960 ahead and you can cut off SSL early so that your endpoints get plain text, and now you've gone ahead 778 00:45:51,960 --> 00:45:56,980 and done all this work to end-to-end crypto, and the last minute you just switch out of it. And you 779 00:45:56,980 --> 00:46:02,880 got to do HTTP rewriting, and it's a pain. So, God, that's a messy slide. 780 00:46:03,600 --> 00:46:03,960 So, I'm going to go ahead and do all this work to end-to-end crypto, and the last minute you just switch out of it. 781 00:46:03,980 --> 00:46:11,060 So, it turns out SSL goes ahead and negotiates a session key. In other words, each individual, you 782 00:46:11,060 --> 00:46:17,140 don't go ahead and use RSA for your mass encryption. Use like triple desk, use RC4, lately use AES. This 783 00:46:17,140 --> 00:46:23,100 is relatively fast. And there's an individual key for each session that is used. Here's an idea, 784 00:46:23,280 --> 00:46:27,780 let's send that key to the IDS and have it just, have it work. This isn't just talked about 785 00:46:27,780 --> 00:46:33,760 anymore. As of about three days ago, it works. Today, the key is transferred to the IDS over an 786 00:46:33,760 --> 00:46:39,180 SSH link. SSL actually asks you, what is the password of the host you would like to leak the keys to? 787 00:46:40,640 --> 00:46:46,180 Ah, but it gets cooler, because there's independent keys for each direction. So, there's a key from the client to 788 00:46:46,180 --> 00:46:50,340 the server, and there's a key from the server to the client. You can tell the IDS a key for only a single 789 00:46:50,340 --> 00:46:56,180 direction. You're a bank, you don't want the IDS to be able to read traffic from this really sensitive area inside 790 00:46:56,180 --> 00:47:03,680 your bank because regulations. But you don't trust traffic from the outside world. How can the IDS go ahead and read the bad traffic 791 00:47:03,680 --> 00:47:09,280 but not the trusted one? You just give it the key from the client to the server. This works today. 792 00:47:11,440 --> 00:47:18,640 It's also not entirely necessary, guys. HTTP is a sucky protocol overall, but it turns out you can go ahead, it takes 793 00:47:18,640 --> 00:47:25,600 everything you've got in your request, it gives you a nice big batch that you toss off to your web application. You take this 794 00:47:25,600 --> 00:47:33,660 nice big batch and you say, hey IDS, is this a good thing or a bad thing? If it says it's a good thing, then you pass it to your 795 00:47:33,680 --> 00:47:39,060 application. Guys, we need mod IDS for Apache. This would not be hard to write. 796 00:47:40,040 --> 00:47:47,920 The advantage of this method, by the way, it's so straightforward, it's totally immune to TCP attacks. You can filter out 797 00:47:47,920 --> 00:47:55,740 bytes, Excel passwords and numbers and whatnot, but it's not as cool. You don't mess with SSL in this really weird way. 798 00:47:56,160 --> 00:48:03,400 But it's really straightforward to write. Everyone here as a web developer could write it today. So guys, those are my 799 00:48:03,680 --> 00:48:03,760 boys. 800 00:48:12,620 --> 00:48:17,960 All right. I don't know how much time we got for questions, but who here's got something? We got five minutes for 801 00:48:17,960 --> 00:48:23,720 questions? Who's got something that'll scare me? This guy over here. I'll mic him. 802 00:48:27,540 --> 00:48:33,620 You have talked about networker director. Wouldn't you get a problem of when you're 803 00:48:33,680 --> 00:48:39,260 sending Arp, you're spoofing Arp packets and sending them to the router, wouldn't the original 804 00:48:39,260 --> 00:48:44,980 station would also respond sometimes with their Arp packets? Wouldn't the Arp be detected by the 805 00:48:44,980 --> 00:48:53,480 router or by the hosts? So you're actually referring to TheNotInTheMiddle case, right? Basically what he's 806 00:48:53,480 --> 00:49:00,760 saying is that every once in a while you're going to gratuitously get your legitimate client going ahead and 807 00:49:00,760 --> 00:49:03,660 sending out Arps. ArpMan the Middle! I don't know what you're referring to. It sounds like it's a good case ifyou're 808 00:49:03,680 --> 00:49:07,840 middle attacks work. They really do. As long as everybody thinks that everything is going 809 00:49:07,840 --> 00:49:11,620 through. Now the legitimate client's going to go ahead and start sending out ARPs possibly 810 00:49:11,620 --> 00:49:16,940 if it's not getting traffic through. So your big thing is make sure the legitimate guy 811 00:49:16,940 --> 00:49:20,540 who has the address gets his traffic through and then he's not going to go ahead and be 812 00:49:20,540 --> 00:49:24,840 spitting out too many ARPs gratuitously himself. But it is an issue with any mark man and middle 813 00:49:24,840 --> 00:49:30,900 attack. Any other questions? Right over there. Hit me. 814 00:49:30,900 --> 00:49:37,020 What about egress filtering and your re-director? Ah, yes. Egress filtering. Security 815 00:49:37,020 --> 00:49:43,320 professionals saying star topologies are the best thing in the world. This is me saying 816 00:49:43,320 --> 00:49:47,620 when you turn on egress filtering you actually do lose some significant functionality. You 817 00:49:47,620 --> 00:49:53,460 lose what is effectively a really good way to make load balancing distributed. Truly 818 00:49:53,460 --> 00:49:58,260 distributed. Other questions? Right there. 819 00:50:05,480 --> 00:50:12,620 I was thinking about the IP redirection on the server. What am I missing when I'm thinking 820 00:50:12,620 --> 00:50:19,780 that that would be an ideal way for peer to peer people serving up files peer to peer 821 00:50:19,780 --> 00:50:24,920 to be... You're missing NAT. So many people are behind NATs now and you can't send a packet 822 00:50:24,920 --> 00:50:30,880 with a spoofed source IP behind a NAT. That's the problem. If you didn't have all the NATs, 823 00:50:30,900 --> 00:50:35,260 I mean, on the flip side, there are a lot of peer to peer users who aren't behind NATs. 824 00:50:35,360 --> 00:50:41,320 And yes, in that situation, it's just fantastic. In which case, the problem becomes Windows 825 00:50:41,320 --> 00:50:46,720 doesn't have nearly the nice way to go ahead and intercept the packet right before it leaves. 826 00:50:46,940 --> 00:50:51,820 And if someone here can tell me a good way to do it, a case of this stuff is yours. But 827 00:50:51,820 --> 00:51:00,280 I'm not involved with that. Any other questions or thoughts? If not, thank you. Oh, wait. 828 00:51:00,280 --> 00:51:08,640 One more. This is the last question. In reference to ARP updates, how would you 829 00:51:08,640 --> 00:51:13,940 deal with static ARP tables? You couldn't. But they're very rare. Even at Black Hat, 830 00:51:14,020 --> 00:51:18,820 where people are told, please, for the love of God, here's your ARP address. Please, we're 831 00:51:18,820 --> 00:51:24,080 telling you, you're going to get spoofed. You're at the Black Hat briefings. Everybody. Okay, I 832 00:51:24,080 --> 00:51:29,460 got one last story to tell you guys. This is last year. This is my favorite event at any con. So, 833 00:51:29,480 --> 00:51:30,260 by the way, so what do I do? I'm going to go ahead and do this. I'm going to go ahead and do this. 834 00:51:30,280 --> 00:51:36,460 What happens is this guy is giving a talk about sniffing email passwords. He goes ahead and at 835 00:51:36,460 --> 00:51:40,180 the beginning of the talk, he says, here's a shirt. I'm going to be giving this out at the end of the 836 00:51:40,180 --> 00:51:45,440 talk. He gives this entire talk about sniffing email passwords over wireless networks. At the 837 00:51:45,440 --> 00:51:50,200 end, he says, all right, will Bob Dobbs please come up? I don't remember what his real name was. 838 00:51:50,280 --> 00:51:56,460 Bob Dobbs, please come up. Guy comes up. How did you know I was in this talk? Sir, you came to a 839 00:51:56,460 --> 00:52:00,120 sniffing email passwords talk and you checked your email. 840 00:52:00,280 --> 00:52:02,140 Without encryption. Thank you.