1 00:00:04,120 --> 00:00:08,660 All right, everyone. Welcome to Black Ops DNS. 2 00:00:14,800 --> 00:00:19,180 Now, usually we start our talks with a nice slide that says absolutely nothing. 3 00:00:19,480 --> 00:00:23,000 Instead, I seem to be showing you some kind of screen saver. 4 00:00:23,360 --> 00:00:25,160 Well, let me tell you guys a little story. 5 00:00:25,280 --> 00:00:27,000 I don't know how much you guys know about me. 6 00:00:27,000 --> 00:00:30,340 I wrote a really fast network scanner called ScanRand a while ago. 7 00:00:30,620 --> 00:00:36,460 And in the process of doing DNS research, well, I kind of adapted it to do DNS scanning. 8 00:00:36,840 --> 00:00:44,120 And I scanned the entire 64-dot range, and every single dot there is a DNS server. 9 00:00:44,740 --> 00:00:48,880 That is plotted X, Y, Z space according to the last three bytes in 64-dot. 10 00:00:49,120 --> 00:00:55,700 Long story short, there's about 140,000 DNS servers on one single chunk of the Internet alone. 11 00:00:56,200 --> 00:00:56,980 Maybe we can do it. 12 00:00:57,000 --> 00:00:59,820 Maybe we should look into the security aspects of this. 13 00:01:00,700 --> 00:01:03,000 So that's what we're talking about today. 14 00:01:04,840 --> 00:01:06,480 By the way, I want to thank all of you. 15 00:01:06,540 --> 00:01:08,540 You all waited in an incredibly long line. 16 00:01:08,700 --> 00:01:11,300 I can't believe how long that thing got. 17 00:01:12,360 --> 00:01:13,380 Thank you, everyone. 18 00:01:13,780 --> 00:01:19,420 And as it goes every year, first of all, I want questions. 19 00:01:19,680 --> 00:01:21,020 I really want good questions. 20 00:01:21,200 --> 00:01:24,100 So if you've got a good question, I'm going to give you a beer. 21 00:01:25,140 --> 00:01:26,260 Give me one second. 22 00:01:26,280 --> 00:01:29,020 I have to plug my laptop in, and we will begin this little shindig. 23 00:01:29,220 --> 00:01:32,080 Make sure they're over when we log in. 24 00:01:32,260 --> 00:01:32,840 All right. 25 00:01:32,840 --> 00:01:33,400 I'll do it. 26 00:01:34,400 --> 00:01:35,380 Thanks, Mom. 27 00:01:42,560 --> 00:01:47,200 I'll be careful. 28 00:01:48,440 --> 00:01:49,340 All right. 29 00:01:49,340 --> 00:01:49,880 I can't. 30 00:01:50,160 --> 00:01:50,840 He's right. 31 00:01:51,060 --> 00:01:51,800 You're under 21. 32 00:01:51,800 --> 00:01:52,940 I can't give you beer. 33 00:01:52,940 --> 00:01:53,020 Here. 34 00:01:53,020 --> 00:01:53,180 Here. 35 00:01:59,760 --> 00:02:00,480 All right. 36 00:02:01,660 --> 00:02:03,800 And anyway, guys, don't give Priest too much hell. 37 00:02:03,880 --> 00:02:07,600 He actually had a really good reason to be giving this speech, and he's right. 38 00:02:07,760 --> 00:02:10,860 They're really, just at the end of the day, I agree with the sentiment. 39 00:02:10,900 --> 00:02:13,640 So let's begin the tech stuff, though. 40 00:02:14,580 --> 00:02:15,840 First of all, who am I? 41 00:02:15,940 --> 00:02:16,520 I'm a geek. 42 00:02:20,020 --> 00:02:20,380 DNS. 43 00:02:20,680 --> 00:02:21,040 Why? 44 00:02:21,040 --> 00:02:23,140 Why are we going to be looking into this today? 45 00:02:23,580 --> 00:02:25,840 Well, DNS is globally deployed. 46 00:02:26,140 --> 00:02:27,080 This stuff is everywhere. 47 00:02:27,520 --> 00:02:31,380 You use DNS every time you access the Internet. 48 00:02:31,680 --> 00:02:36,880 If you run a server of any sort, you probably have some kind of server-level involvement 49 00:02:36,880 --> 00:02:37,860 in the protocol. 50 00:02:38,340 --> 00:02:40,780 It solves a deceptively simple problem. 51 00:02:41,220 --> 00:02:45,420 The Internet, like the telephone system, does not work on names. 52 00:02:45,660 --> 00:02:50,140 When you call your friend, you don't go to your phone and say, you know, Bob Dobbs, please. 53 00:02:50,140 --> 00:02:51,560 No, you put in a number. 54 00:02:51,740 --> 00:02:53,360 And it's the same way on the Internet. 55 00:02:53,520 --> 00:02:56,320 You don't put in www.defcon.org. 56 00:02:56,380 --> 00:02:59,360 Well, you may do that, but the computer has no idea what to do with that. 57 00:02:59,480 --> 00:03:00,960 It has to look up a number. 58 00:03:01,120 --> 00:03:08,700 And by DNS, it goes from defcon.org to 1.2.3.4 or whatever the Internet address happens to be. 59 00:03:09,140 --> 00:03:11,580 It is a very old protocol. 60 00:03:11,780 --> 00:03:14,440 We're talking early mid-'80s. 61 00:03:14,440 --> 00:03:18,100 It is the second oldest, what I call, uncontested... 62 00:03:20,140 --> 00:03:20,500 Hell yeah. 63 00:03:21,920 --> 00:03:24,880 You know, when you've been handed a random drink by Humperdinck, 64 00:03:25,000 --> 00:03:27,380 all logic says, do not drink it. 65 00:03:33,240 --> 00:03:34,020 Screw logic. 66 00:03:35,820 --> 00:03:36,500 All right. 67 00:03:37,380 --> 00:03:38,260 So, by... 68 00:03:38,260 --> 00:03:39,420 You know, you look at Telnet. 69 00:03:39,760 --> 00:03:40,580 You know, we... 70 00:03:40,580 --> 00:03:41,160 Oh, God. 71 00:03:41,580 --> 00:03:42,660 You're pushing it, man. 72 00:03:43,180 --> 00:03:45,580 Like five minutes ago, you'd be like, let me tell you about DNS. 73 00:03:45,980 --> 00:03:47,400 DNS is freaking awesome. 74 00:03:55,640 --> 00:03:56,500 Don't do that again. 75 00:03:56,640 --> 00:03:57,300 Wait until after. 76 00:03:58,920 --> 00:04:00,800 So, we don't do Telnet anymore. 77 00:04:00,960 --> 00:04:01,920 We do SSH. 78 00:04:02,000 --> 00:04:03,480 We don't do that much FTP anymore. 79 00:04:03,720 --> 00:04:04,860 A lot of people do HTTP. 80 00:04:06,160 --> 00:04:09,480 But really, you know, DNS solved this problem 20 years ago. 81 00:04:10,200 --> 00:04:12,900 And there's not even really anything else that comes close. 82 00:04:13,080 --> 00:04:15,780 I mean, SMTP is still being used. 83 00:04:15,900 --> 00:04:17,840 And we're really suffering for it. 84 00:04:17,840 --> 00:04:19,960 Hello, spammers. 85 00:04:20,140 --> 00:04:22,100 But DNS is really just it won. 86 00:04:22,360 --> 00:04:22,880 It's good. 87 00:04:22,960 --> 00:04:23,520 It's there. 88 00:04:24,500 --> 00:04:28,480 I got interested in DNS really especially when Blaster happened. 89 00:04:29,140 --> 00:04:32,220 Blaster is one of the three worms of the Summer of Worms last year. 90 00:04:32,320 --> 00:04:33,820 Blaster not changed so big. 91 00:04:34,160 --> 00:04:37,740 And Blaster went ahead and looked up WindowsUpdate.com. 92 00:04:37,940 --> 00:04:39,360 The wrong name. 93 00:04:42,200 --> 00:04:44,800 Guys, it's WindowsUpdate.Microsoft.com. 94 00:04:44,880 --> 00:04:46,000 How did you forget Microsoft? 95 00:04:46,000 --> 00:04:47,220 They're kind of a big company. 96 00:04:47,380 --> 00:04:47,820 Yeah. 97 00:04:49,060 --> 00:04:54,240 But it queried WindowsUpdate.com before going ahead to launch a flood against this site. 98 00:04:55,280 --> 00:04:56,380 Funny little thing. 99 00:04:57,000 --> 00:05:01,120 Everyone was running scanners to try to find their infected Blaster hosts. 100 00:05:01,540 --> 00:05:07,240 Meanwhile, the Blaster host, every last one of them, was making DNS queries for WindowsUpdate.com. 101 00:05:07,480 --> 00:05:14,220 I go ahead, put out a single one-liner Perl command over SSH that would parse out all the infected hosts. 102 00:05:14,440 --> 00:05:16,220 People are looking at me like, what? 103 00:05:16,220 --> 00:05:17,940 You can find worms? 104 00:05:18,320 --> 00:05:19,020 With DNS? 105 00:05:19,560 --> 00:05:20,200 What the? 106 00:05:20,880 --> 00:05:24,300 That's when I got the idea maybe we should really start experimenting with this. 107 00:05:24,700 --> 00:05:28,080 So, we have now a new toolkit for DNS experimentation. 108 00:05:28,740 --> 00:05:30,660 It's called AussieManDNS. 109 00:05:30,800 --> 00:05:33,700 It was released at the Black Hat briefings a few days ago. 110 00:05:34,140 --> 00:05:35,880 And it's pretty cool. 111 00:05:36,180 --> 00:05:37,340 We've got a couple tools. 112 00:05:38,000 --> 00:05:43,520 NOMD, as in NOMDEGEAR, is our experimental DNS test platform. 113 00:05:43,780 --> 00:05:46,200 It is a dynamic DNS server. 114 00:05:46,200 --> 00:05:47,380 Very sensible. 115 00:05:47,660 --> 00:05:48,780 Very easy to code for. 116 00:05:49,040 --> 00:05:54,180 If you can write maybe 10 lines of code in Perl, you can actually return arbitrary results 117 00:05:54,180 --> 00:05:55,120 on a DNS query. 118 00:05:55,460 --> 00:05:56,240 It's beautiful. 119 00:05:56,860 --> 00:06:00,700 And the joy goes to Perl for having an amazing net DNS library. 120 00:06:01,240 --> 00:06:02,140 Is the library good enough? 121 00:06:02,160 --> 00:06:03,300 I learned the freaking language. 122 00:06:03,680 --> 00:06:04,520 That doesn't happen. 123 00:06:06,220 --> 00:06:09,080 What some of you may have heard about, DROUTE. 124 00:06:09,160 --> 00:06:10,920 Yes, we have SSH over DNS. 125 00:06:11,220 --> 00:06:15,580 If you can DNS out of a network, you can get arbitrary network connectivity. 126 00:06:15,860 --> 00:06:16,180 All right. 127 00:06:16,180 --> 00:06:17,280 So we have SDNs. 128 00:06:17,980 --> 00:06:19,980 We have FFN, which is a source ofeker, which is a source ofeker. 129 00:06:19,980 --> 00:06:21,200 We have file and stream receivers and senders. 130 00:06:21,800 --> 00:06:22,980 ASCA and GETA. 131 00:06:23,020 --> 00:06:25,520 Ask a stupid question, get a stupid answer. 132 00:06:27,580 --> 00:06:30,820 And we have GLANCE, which is a freshness checker over DNS. 133 00:06:31,220 --> 00:06:33,020 I'll tell you more about that in a bit. 134 00:06:33,560 --> 00:06:39,160 So what are the useful traits of DNS that are interesting from a security perspective? 135 00:06:39,720 --> 00:06:43,200 Well, first of all, DNS is hierarchical. 136 00:06:43,440 --> 00:06:46,160 The example I use to explain this is to say, for instance, when you have a database, you 137 00:06:46,160 --> 00:06:51,460 let's say you could dial 411 and instead of just saying give me the number of 138 00:06:51,460 --> 00:06:55,380 this company, you could say give me the extension of this person at the company 139 00:06:55,380 --> 00:07:00,620 and they would go, 411 would go out and find this person's extension and tell you 140 00:07:00,620 --> 00:07:06,480 oh yeah Bob's extension 4391 would you like us to connect to you. The phone 141 00:07:06,480 --> 00:07:10,780 system is very centralized. We're really only a few Bells out 142 00:07:10,780 --> 00:07:16,000 there and they store all their data internally. DNS is a very distributed 143 00:07:16,000 --> 00:07:20,720 architecture. When you go to com, it tells you how to get to docspara.com. You go to 144 00:07:20,720 --> 00:07:26,080 docspara.com, it tells you how to find foodocspara.com and so on. It is a 145 00:07:26,080 --> 00:07:30,460 hierarchical process that gets you closer and closer. It routes you through 146 00:07:30,460 --> 00:07:34,940 hops much like the Internet routes you through hops. That's kind of interesting. 147 00:07:35,420 --> 00:07:39,880 It uses, there are two kinds of lookups. Recursive versus iterative lookup. 148 00:07:41,600 --> 00:07:46,260 And in a recursive lookup, you know, you basically go to some, oh hang on. So it's 149 00:07:46,260 --> 00:07:50,360 actually a complicated process to go through this entire hierarchy to follow 150 00:07:50,360 --> 00:07:55,240 the com to docspara.com to foodocspara.com and so on. This process has been 151 00:07:55,240 --> 00:08:00,340 offloaded to specialized servers, so-called nameservers. You go to them 152 00:08:00,340 --> 00:08:04,220 and you say here's the answer I'm looking for. It does a whole bunch of work in the 153 00:08:04,220 --> 00:08:08,580 background and then comes back to you with an answer. That means it's a proxy 154 00:08:08,580 --> 00:08:09,200 server. 155 00:08:09,200 --> 00:08:13,700 It is, you ask it something, it goes out on the internet and does a bunch of work for 156 00:08:13,700 --> 00:08:13,980 you. 157 00:08:14,760 --> 00:08:15,280 Interesting. 158 00:08:15,460 --> 00:08:18,180 So now we can tell other machines to do lookups for us. 159 00:08:18,520 --> 00:08:21,380 And also, these other machines, they cache. 160 00:08:21,860 --> 00:08:27,620 So in other words, I go to, you know, like the 411, let's say 411 did the whole extension 161 00:08:27,620 --> 00:08:30,420 finding out, said Bob was at extension 4931. 162 00:08:30,840 --> 00:08:36,080 The next time someone called 411 for 4931, say, oh, I remember that, I don't need to 163 00:08:36,080 --> 00:08:38,100 call the company again, he's at 4931. 164 00:08:38,100 --> 00:08:41,780 Same with the DNS, where there's a caching of results. 165 00:08:42,080 --> 00:08:47,200 It's much like HTTP proxy servers, like Squid will store results. 166 00:08:47,540 --> 00:08:51,680 So if you ask for it, instead of going out on the internet, it already knows the answer, 167 00:08:51,800 --> 00:08:52,600 it provides it. 168 00:08:53,020 --> 00:08:57,520 So these are some interesting traits for our globally deployed DNS system. 169 00:08:57,760 --> 00:08:58,900 Maybe we can use them. 170 00:08:59,600 --> 00:09:02,400 Now the primary research areas for... 171 00:09:02,680 --> 00:09:03,200 Fuck water. 172 00:09:05,300 --> 00:09:05,900 No. 173 00:09:06,600 --> 00:09:07,200 Okay. 174 00:09:07,200 --> 00:09:07,980 Sit down. 175 00:09:13,380 --> 00:09:14,800 So, check this out. 176 00:09:15,360 --> 00:09:21,060 The primary research areas for DNS, 99 in 2000 was basically not a good year for Bind. 177 00:09:22,960 --> 00:09:23,440 No. 178 00:09:24,640 --> 00:09:27,960 Paul Vixie has kind of removed that from his memories. 179 00:09:28,140 --> 00:09:32,000 Filled with exploits against the world's most common DNS server, it was a very bad 180 00:09:32,000 --> 00:09:32,320 time. 181 00:09:33,120 --> 00:09:35,180 Luckily, most of the bugs have been fixed. 182 00:09:35,320 --> 00:09:37,280 I'm sure some of you know of bugs that are... 183 00:09:37,280 --> 00:09:37,800 Have been... 184 00:09:37,800 --> 00:09:38,700 Have not been resolved. 185 00:09:38,980 --> 00:09:41,280 But for the most part, the DNS is okay. 186 00:09:42,760 --> 00:09:46,220 The second class of attack involves DNS spoofing. 187 00:09:46,260 --> 00:09:49,080 That's where false addresses are returned for addresses. 188 00:09:49,640 --> 00:09:55,680 A lot of work has gone into preventing the ability to spoof a DNS address. 189 00:09:55,900 --> 00:09:57,340 That's not so much of a problem anymore. 190 00:09:57,540 --> 00:09:58,300 It used to be a lot more. 191 00:09:58,480 --> 00:10:01,340 There are still some definite threats, but that's not what I'm looking in. 192 00:10:01,800 --> 00:10:03,700 I'm looking into DNS tunneling. 193 00:10:03,980 --> 00:10:07,260 Now, there's been some interesting work lately in terms of DNS spoofing. 194 00:10:08,440 --> 00:10:10,240 We have BitTorrent seeds. 195 00:10:10,480 --> 00:10:12,160 How many people in this room have used BitTorrent? 196 00:10:13,520 --> 00:10:14,320 Very cool. 197 00:10:14,720 --> 00:10:16,480 Good friend Bram wrote BitTorrent. 198 00:10:16,780 --> 00:10:17,580 Guy's awesome. 199 00:10:18,760 --> 00:10:23,780 So, BitTorrent depends on a little bit of data to seed you on your goal towards getting 200 00:10:23,780 --> 00:10:24,360 your files. 201 00:10:24,640 --> 00:10:27,040 People have been talking about putting those seeds in DNS. 202 00:10:27,740 --> 00:10:30,860 As a retarded little example, people have done math servers. 203 00:10:31,080 --> 00:10:34,500 You'd look up two plus two, fooaddress.com, receive an IP of four. 204 00:10:35,240 --> 00:10:35,720 . 205 00:10:36,720 --> 00:10:40,040 But this violates the RFC because you're not allowed to have a plus in DNS. 206 00:10:40,380 --> 00:10:43,760 So I'm not the first person to put odd things in DNS. 207 00:10:43,960 --> 00:10:45,800 I do not claim to be. 208 00:10:46,020 --> 00:10:48,200 But I'm doing some interesting stuff anyway. 209 00:10:49,540 --> 00:10:52,380 How is arbitrary data put in DNS? 210 00:10:53,040 --> 00:10:57,720 Now, most people think, well, you know, all DNS returns is a couple IP addresses. 211 00:10:57,840 --> 00:11:01,040 How much storage capacity can there be in IP addresses? 212 00:11:01,100 --> 00:11:01,980 They're four bytes long. 213 00:11:02,520 --> 00:11:05,700 Well, first of all, you don't just need to host DNS servers. 214 00:11:05,700 --> 00:11:08,300 You can host what are called text records. 215 00:11:08,620 --> 00:11:11,980 Text records are unstructured fields of data. 216 00:11:12,180 --> 00:11:17,380 You can get actually a decent amount of content into them and shove them into a packet. 217 00:11:17,640 --> 00:11:23,700 They're most commonly used in what are called SPF records, which are used to validate the 218 00:11:23,700 --> 00:11:24,900 source addresses for spam. 219 00:11:25,800 --> 00:11:32,020 Instead of that, I'm kind of putting arbitrary data in what's called base 64 format. 220 00:11:32,360 --> 00:11:35,440 And it looks like what you see up there, where it's just a large string. 221 00:11:39,560 --> 00:11:44,380 You can get about 220 bytes of arbitrary data per text record. 222 00:11:44,760 --> 00:11:48,400 Now, sometimes you may not want to move text records. 223 00:11:48,620 --> 00:11:50,520 Sometimes you just don't have those available. 224 00:11:50,980 --> 00:11:56,500 What you can actually do is in a query, in a lookup, in the name, in the address that 225 00:11:56,500 --> 00:11:58,040 you look up, you can throw data. 226 00:11:58,680 --> 00:12:05,420 So when you look foo.com or bar.com or so on, you can append a huge batch of data. 227 00:12:05,420 --> 00:12:11,040 A huge batch of arbitrary data in the lookup itself, up to 63 characters between each 228 00:12:11,040 --> 00:12:14,000 dot and up to 256 characters total. 229 00:12:14,480 --> 00:12:18,600 Through this method, and by the way, we can't use base 64, because there are 63, 230 00:12:19,180 --> 00:12:23,760 not 64, 63 legal characters in a DNS name. 231 00:12:24,080 --> 00:12:30,060 So there's actually something called base 32, which takes all arbitrary data and shoves 232 00:12:30,060 --> 00:12:32,160 it into 5-bit text. 233 00:12:32,440 --> 00:12:34,580 So you get A through Z in a couple of the numbers. 234 00:12:34,580 --> 00:12:37,660 And through there, you can get about 110 bytes per packet. 235 00:12:39,400 --> 00:12:41,280 Now, DNS tunneling. 236 00:12:41,280 --> 00:12:42,120 Who's doing it? 237 00:12:42,440 --> 00:12:47,640 Well, right now, NSTX is the most popular system for tunneling arbitrary data over DNS. 238 00:12:48,040 --> 00:12:53,360 It takes IP packets, standard things that you'd move over the Internet, and it encapsulates 239 00:12:53,360 --> 00:12:54,900 them in DNS queries. 240 00:12:55,300 --> 00:12:59,160 Now, the problem with NSTX is that it really only works under Linux. 241 00:12:59,740 --> 00:13:00,340 And... 242 00:13:01,160 --> 00:13:01,760 Hey. 243 00:13:03,000 --> 00:13:03,900 That's true. 244 00:13:03,960 --> 00:13:04,560 But you know what? 245 00:13:04,580 --> 00:13:07,800 You know, sometimes you run another operating system every once in a while. 246 00:13:08,380 --> 00:13:09,760 OSX, say, perhaps. 247 00:13:10,220 --> 00:13:12,360 See how I got that to be cool again? 248 00:13:15,620 --> 00:13:22,980 So, beyond that, there are serious rumors, it's true, that various botnets and malware 249 00:13:22,980 --> 00:13:30,180 are using DNS as a covert channel in order to get the control channel for their worms. 250 00:13:30,460 --> 00:13:32,000 So this is happening. 251 00:13:32,280 --> 00:13:34,560 And at the same time it's happening, it's not. 252 00:13:34,560 --> 00:13:36,180 Nobody's monitoring their DNS traffic. 253 00:13:36,500 --> 00:13:36,720 Nobody. 254 00:13:36,960 --> 00:13:40,160 People had no idea that even worms were going on over DNS. 255 00:13:40,580 --> 00:13:43,400 So, I mean, worms were doing lookups over DNS. 256 00:13:43,860 --> 00:13:50,140 So, this here is an attempt to try to raise the lights on a real problem. 257 00:13:50,960 --> 00:13:51,940 Well, let's start simple. 258 00:13:52,780 --> 00:13:55,920 NSTX requires kernel cooperation, and we don't want to have that. 259 00:13:56,120 --> 00:14:01,160 So, let's make something that doesn't require the kernel, but still allows remote networking. 260 00:14:01,440 --> 00:14:03,460 Now, what is remote networking like VPNs? 261 00:14:03,460 --> 00:14:04,540 I'm on this network, but I want to be on this network. 262 00:14:04,560 --> 00:14:05,380 I wanted to be over there. 263 00:14:05,560 --> 00:14:06,860 I'm at the Starbucks network. 264 00:14:07,040 --> 00:14:08,140 I want to be on the Internet. 265 00:14:08,400 --> 00:14:09,260 You know, stuff like that. 266 00:14:11,580 --> 00:14:13,840 So, there's a little project I was involved in. 267 00:14:13,940 --> 00:14:14,840 It's called SSH. 268 00:14:14,860 --> 00:14:15,580 You might have heard of it. 269 00:14:17,040 --> 00:14:20,200 And SSH has a function that I wrote called dynamic forwarding. 270 00:14:20,760 --> 00:14:23,620 Dynamic forwarding is basically a poor man's VPN. 271 00:14:24,780 --> 00:14:26,240 And where's my Ethernet jack? 272 00:14:26,500 --> 00:14:28,220 Could a goon come up and give me an Ethernet cable? 273 00:14:29,340 --> 00:14:30,680 I got a cable for you. 274 00:14:30,780 --> 00:14:31,740 Yeah, just come and set it up. 275 00:14:32,000 --> 00:14:32,360 Okay. 276 00:14:33,340 --> 00:14:33,700 So, let's see. 277 00:14:33,760 --> 00:14:34,120 Let's see. 278 00:14:34,740 --> 00:14:42,500 SSH dynamic forwarding is interesting because you can basically route arbitrary TCP applications 279 00:14:43,210 --> 00:14:45,200 over any host you can SSH into. 280 00:14:45,640 --> 00:14:49,000 So, you want to look up websites, you go over SSH. 281 00:14:49,040 --> 00:14:51,520 You want to use your instant messenger, you go over SSH. 282 00:14:51,780 --> 00:14:55,980 You're firewalled against websites and instant messenger, no problem because you're going 283 00:14:55,980 --> 00:14:57,300 out over SSH. 284 00:14:57,540 --> 00:15:02,060 And with the latest hack, you're now going out over SSH over DNS. 285 00:15:03,520 --> 00:15:04,100 Problem solved. 286 00:15:04,120 --> 00:15:04,200 Problem. 287 00:15:05,020 --> 00:15:08,300 DNS is not TCP and SSH depends on TCP. 288 00:15:09,560 --> 00:15:11,340 TCP moves byte streams. 289 00:15:12,120 --> 00:15:13,340 Here's some arbitrary data. 290 00:15:13,460 --> 00:15:13,900 Go send it. 291 00:15:14,600 --> 00:15:15,940 DNS moves records. 292 00:15:16,320 --> 00:15:19,160 And individual records are the blocks of data. 293 00:15:19,560 --> 00:15:21,560 TCP lets either side speak first. 294 00:15:21,700 --> 00:15:22,780 DNS is client server. 295 00:15:22,940 --> 00:15:27,720 The client has to look up and the server can respond. 296 00:15:28,120 --> 00:15:30,380 If the client doesn't look up, there's no response. 297 00:15:30,880 --> 00:15:32,440 And TCP is 8-bit clean. 298 00:15:32,520 --> 00:15:33,680 You can move any byte you want. 299 00:15:33,820 --> 00:15:34,100 What's the problem? 300 00:15:34,120 --> 00:15:34,600 There's DNS. 301 00:15:34,800 --> 00:15:36,400 You can only send this character. 302 00:15:36,480 --> 00:15:37,580 You can only send that character. 303 00:15:38,200 --> 00:15:41,960 You know, it's almost like I've heard this story before. 304 00:15:43,160 --> 00:15:46,080 I shall call him mini-HTTP. 305 00:15:49,560 --> 00:15:51,620 It's just HTTP all over again. 306 00:15:52,780 --> 00:15:57,840 You guys know like XML, RPC, and SOAP and all these other protocols that are taking 307 00:15:57,840 --> 00:16:02,800 really complex stuff and shoving it into the HTTP channel because, well, no one's firewalling 308 00:16:02,800 --> 00:16:02,980 that. 309 00:16:03,320 --> 00:16:04,520 Same junk. 310 00:16:06,340 --> 00:16:10,680 Just like HTTP tunnel, we're going to go ahead and we're going to move data over something 311 00:16:10,680 --> 00:16:12,300 that really it wasn't intended to. 312 00:16:12,680 --> 00:16:16,940 Now, I have to point out there's a significant difference between DNS and HTTP. 313 00:16:17,400 --> 00:16:21,020 In HTTP, you can have an arbitrarily sized response to a request. 314 00:16:21,380 --> 00:16:23,100 In DNS, you can't. 315 00:16:23,100 --> 00:16:28,120 There's really a 576-byte limit, unless you use the UDP size option, but I'm not supporting 316 00:16:28,120 --> 00:16:28,580 that yet. 317 00:16:28,880 --> 00:16:32,620 So, with that restriction, we can still do interesting things. 318 00:16:32,640 --> 00:16:32,780 We can still do interesting things. 319 00:16:32,780 --> 00:16:36,240 I'm going to start with a tool I've written called DRoute, which is a DNS stream router. 320 00:16:37,000 --> 00:16:41,780 Now, let me give you a little bit of an example of how it works, and then I'll see if I have 321 00:16:41,780 --> 00:16:45,420 enough net to show it to you because live demos are always fun. 322 00:16:47,060 --> 00:16:47,540 Upstream. 323 00:16:47,700 --> 00:16:51,040 First of all, upstream and downstream have completely different semantics. 324 00:16:51,540 --> 00:16:53,000 Upstream has limited bandwidth. 325 00:16:53,300 --> 00:16:58,020 You'll notice on your ADSL links at home, it's very slow up but very fast down. 326 00:16:58,140 --> 00:17:01,860 It's because most protocols in common use, you're downloading a lot more than you're 327 00:17:01,860 --> 00:17:02,200 uploading. 328 00:17:03,000 --> 00:17:06,940 Conveniently, DNS gives us a much slower upstream than downstream. 329 00:17:07,360 --> 00:17:10,900 We basically have the name that is available to look up. 330 00:17:11,040 --> 00:17:16,580 We put 110 bytes in, as I showed you earlier with the in-between every 63 dots. 331 00:17:18,620 --> 00:17:19,940 Downstream, we have more bandwidth. 332 00:17:20,080 --> 00:17:22,640 We can use that 220-byte method I talked about. 333 00:17:23,180 --> 00:17:25,300 But we have to pull for new content. 334 00:17:25,660 --> 00:17:28,580 There are text lookups, and they return base 64 data. 335 00:17:28,820 --> 00:17:32,760 We have a byte offset that describes how far into the download stream it's going to 336 00:17:32,760 --> 00:17:34,000 stream we want to be. 337 00:17:35,300 --> 00:17:42,900 Now, I don't want to continually be flooding a remote non-D server to grab my data, so 338 00:17:42,900 --> 00:17:43,740 this is how I do it. 339 00:17:43,900 --> 00:17:44,840 I'm always pulling. 340 00:17:45,220 --> 00:17:51,360 If I don't get any data back, I wait three times longer before I try again, up to some 341 00:17:51,360 --> 00:17:52,500 maximum sleep time. 342 00:17:52,740 --> 00:17:58,980 So as soon as I have data, I speed up because there's probably going to be more. 343 00:17:59,200 --> 00:18:01,940 But if there's no data for me to download, I back off. 344 00:18:01,940 --> 00:18:07,220 It's a simple protocol, but it actually works pretty well for not making too much 345 00:18:07,220 --> 00:18:08,880 noise when there's no data to download. 346 00:18:09,260 --> 00:18:14,220 Now, my present implementation is single-threaded, and only one packet can be outstanding at a 347 00:18:14,220 --> 00:18:15,900 given time, but this is temporary. 348 00:18:16,360 --> 00:18:18,800 And once it's fixed, this will be a lot faster. 349 00:18:19,200 --> 00:18:24,860 Now, let's do something really stupid and try to actually give you guys a demo. 350 00:18:26,900 --> 00:18:28,760 It's mildly readable, but not greatly. 351 00:18:29,020 --> 00:18:29,360 Sorry. 352 00:18:29,940 --> 00:18:30,460 Huh. 353 00:18:30,460 --> 00:18:32,340 We have no net. 354 00:18:35,460 --> 00:18:36,060 . 355 00:18:39,480 --> 00:18:40,760 Damn you, Humperdinck. 356 00:18:42,380 --> 00:18:42,980 . 357 00:18:45,340 --> 00:18:45,940 Really? 358 00:18:46,180 --> 00:18:46,940 Wrong one. 359 00:18:47,520 --> 00:18:47,740 . 360 00:18:48,820 --> 00:18:50,980 No, I mean, it's not live on my side. 361 00:18:52,500 --> 00:18:53,100 . 362 00:18:57,180 --> 00:18:57,780 Nice. 363 00:18:58,400 --> 00:18:58,860 . 364 00:18:59,840 --> 00:19:00,440 No, I mean, it's not live on my side. 365 00:19:00,460 --> 00:19:01,500 No, I don't have link on my side. 366 00:19:02,380 --> 00:19:03,040 All right. 367 00:19:03,100 --> 00:19:07,000 I'm going to continue my talk, and as soon as this thing maybe works, I'll give you 368 00:19:07,000 --> 00:19:07,700 guys a live demo. 369 00:19:09,560 --> 00:19:09,920 . 370 00:19:10,740 --> 00:19:11,100 . 371 00:19:11,100 --> 00:19:11,300 . 372 00:19:12,140 --> 00:19:12,500 . 373 00:19:12,500 --> 00:19:12,740 . 374 00:19:12,740 --> 00:19:12,840 . 375 00:19:13,340 --> 00:19:13,700 . 376 00:19:13,700 --> 00:19:14,400 . 377 00:19:14,400 --> 00:19:14,760 . 378 00:19:14,760 --> 00:19:14,780 . 379 00:19:14,780 --> 00:19:14,840 . 380 00:19:14,840 --> 00:19:15,200 . 381 00:19:15,200 --> 00:19:15,520 . 382 00:19:15,520 --> 00:19:15,700 . 383 00:19:15,700 --> 00:19:16,140 . 384 00:19:18,680 --> 00:19:19,040 . 385 00:19:19,040 --> 00:19:19,220 . 386 00:19:19,220 --> 00:19:19,360 . 387 00:19:20,760 --> 00:19:22,760 Can we do something a little bit more interesting. 388 00:19:22,880 --> 00:19:23,620 Something new. 389 00:19:23,720 --> 00:19:25,160 Something that's never been done before. 390 00:19:26,420 --> 00:19:26,860 Yes. 391 00:19:26,860 --> 00:19:27,400 Yes, we can. 392 00:19:27,840 --> 00:19:28,660 Check this out. 393 00:19:29,640 --> 00:19:34,840 So, you go to a DNS server, and you ask it to, like I 394 00:19:34,840 --> 00:19:37,660 said, it says if every web server was also web proxy. 395 00:19:37,880 --> 00:19:43,060 Every DNS server or most DNS servers out there, will do recursive lookups on your behalf. 396 00:19:43,440 --> 00:19:43,840 . 397 00:19:43,840 --> 00:19:45,320 Do you mind being on the public network? 398 00:19:45,640 --> 00:19:45,720 . 399 00:19:45,720 --> 00:19:46,080 I don't care. 400 00:19:46,220 --> 00:19:46,740 . . . . . . . . . . . . . You don't care. 401 00:19:49,880 --> 00:19:54,320 Now, the basic trick is to, obviously, you're at a hotel network that wants you to charge, 402 00:19:54,400 --> 00:19:59,340 you're at a Starbucks that wants you to charge, you just go out through the DNS requests, 403 00:19:59,660 --> 00:20:04,260 because they'll actually feed you DNS data before they actually hijack your outgoing 404 00:20:04,260 --> 00:20:04,660 HTTP. 405 00:20:05,160 --> 00:20:07,120 Instead, you just don't HTTP out. 406 00:20:07,560 --> 00:20:08,580 But check this out. 407 00:20:08,840 --> 00:20:09,860 Wait, maybe... 408 00:20:10,960 --> 00:20:11,540 Hang on. 409 00:20:14,940 --> 00:20:16,380 I might be able to give you this demo. 410 00:20:18,300 --> 00:20:22,420 One, two, three, four, bing. 411 00:20:23,600 --> 00:20:24,380 Okay, cool. 412 00:20:29,560 --> 00:20:30,980 Is there DNS on this? 413 00:20:33,060 --> 00:20:34,060 You don't say. 414 00:20:43,940 --> 00:20:45,660 Okay, this one fails. 415 00:20:45,800 --> 00:20:46,360 Okay. 416 00:20:47,740 --> 00:20:49,420 Do I have no DHCP on this thing? 417 00:20:53,760 --> 00:20:55,380 Yes, we may have net. 418 00:21:01,460 --> 00:21:03,580 No, I don't. 419 00:21:03,600 --> 00:21:04,340 Look at my top interface. 420 00:21:06,320 --> 00:21:07,760 I'm not getting any DNS out. 421 00:21:08,080 --> 00:21:09,500 That's all I actually need, too. 422 00:21:14,840 --> 00:21:15,380 All right. 423 00:21:15,400 --> 00:21:16,340 I have link, but no DHCP. 424 00:21:16,340 --> 00:21:16,440 DNS. 425 00:21:16,520 --> 00:21:17,240 What's this plugged into? 426 00:21:17,460 --> 00:21:18,000 The same thing? 427 00:21:22,940 --> 00:21:23,580 Well, hang on. 428 00:21:23,640 --> 00:21:24,720 I'm going to try this one last thing. 429 00:21:36,500 --> 00:21:38,120 Just come up here and look at what you need. 430 00:21:38,200 --> 00:21:39,060 I'm going to continue my talk. 431 00:21:40,060 --> 00:21:40,640 All right. 432 00:21:41,260 --> 00:21:42,540 Let's check this out, guys. 433 00:21:43,700 --> 00:21:47,260 DNS trusts the hierarchy to tell it where to route next. 434 00:21:47,800 --> 00:21:51,060 Now, like I told you, com takes you to docspare.com. 435 00:21:51,380 --> 00:21:53,340 Docspare.com says, no, no, no, I don't got the answer. 436 00:21:53,440 --> 00:21:53,840 Go here. 437 00:21:53,900 --> 00:21:57,340 It'll tell you where all the answers are for altdocspare.com and so on. 438 00:21:58,260 --> 00:22:01,920 You can do something very interesting with this, and it's called source routing. 439 00:22:02,860 --> 00:22:08,520 Because I go ahead and I communicate with a recursive server, a server that's doing lookups for me, 440 00:22:09,120 --> 00:22:11,980 and I tell it to look up an address that I control. 441 00:22:11,980 --> 00:22:17,740 And when it comes to me trying to resolve this address, I tell it, no, no, no, no, no, 442 00:22:17,740 --> 00:22:20,600 no, I don't have the address, but you know who does? 443 00:22:21,340 --> 00:22:22,540 10.0.1.11. 444 00:22:22,760 --> 00:22:24,220 It's an address in your network. 445 00:22:24,860 --> 00:22:27,880 And it goes out the other interface on the DNS server. 446 00:22:28,240 --> 00:22:30,700 So this is very new. 447 00:22:31,500 --> 00:22:37,520 DNS comes from an era where firewalls didn't exist, where you could globally route to any 448 00:22:37,520 --> 00:22:39,000 IP address possible. 449 00:22:39,240 --> 00:22:40,320 That's its design. 450 00:22:41,140 --> 00:22:46,560 When you have a DNS server that can go out of multiple interfaces, one to the public 451 00:22:46,560 --> 00:22:52,220 internet, one to the internal network, and you go to that public internet interface and 452 00:22:52,220 --> 00:22:53,560 you say, hey, give me this answer. 453 00:22:53,940 --> 00:22:57,880 And then you tell it, by the way, the answer you're looking for is on your internal interface. 454 00:22:58,040 --> 00:23:01,500 It goes into the internal interface. 455 00:23:05,880 --> 00:23:07,820 So what does this look like? 456 00:23:07,920 --> 00:23:09,620 Because I'm not just going to tell you this theoretically. 457 00:23:09,860 --> 00:23:10,300 No, no, no. 458 00:23:10,320 --> 00:23:12,260 I'm actually going to go ahead and implement it. 459 00:23:12,640 --> 00:23:15,320 Part of NAMD, NAMD has an echo service. 460 00:23:16,140 --> 00:23:26,200 If you look up 10-0-1.55 at echoalt.xperia.com, you get the name server for that is NS, whatever. 461 00:23:26,520 --> 00:23:31,420 When you look up the address for that, it dynamically returns a packet that says, oh, 462 00:23:31,440 --> 00:23:32,620 that address you're looking for? 463 00:23:32,920 --> 00:23:34,360 That's at 10.0.1.55. 464 00:23:35,540 --> 00:23:36,800 So guess what happens? 465 00:23:37,720 --> 00:23:39,440 You go ahead and you try to communicate. 466 00:23:39,440 --> 00:23:40,560 You go to recursive server. 467 00:23:40,780 --> 00:23:42,600 It goes ahead and says, where's my next hop? 468 00:23:42,780 --> 00:23:44,280 The next hop's at 10.0.1.55. 469 00:23:44,420 --> 00:23:45,540 It goes backwards. 470 00:23:46,200 --> 00:23:48,080 Now you say, fine. 471 00:23:48,260 --> 00:23:51,440 I'll just disable recursion on my external interfaces. 472 00:23:51,660 --> 00:23:53,600 I won't let you come back into my network. 473 00:23:54,020 --> 00:23:58,320 And the story could end there, but I'm an evil bastard. 474 00:24:01,720 --> 00:24:06,660 Some interesting things happen when you scan 16 million IP addresses. 475 00:24:06,660 --> 00:24:11,940 About 20,000 or 30,000 hosts are like, who the hell is this guy? 476 00:24:13,820 --> 00:24:20,000 And what they do is they actually look up your IP address to determine the name you're coming from. 477 00:24:20,120 --> 00:24:27,040 Lots of firewalls, you know, IDSs, a couple individual auditors. 478 00:24:27,260 --> 00:24:35,800 Guys, when you're investigating someone, realize your investigations might send a big flare back that says, hi, I'm looking into you. 479 00:24:36,900 --> 00:24:40,520 Of course, I would need to have control over my own reverse DNS. 480 00:24:41,800 --> 00:24:44,360 I do have control over my own reverse DNS. 481 00:24:44,540 --> 00:24:45,420 Thank you very much. 482 00:24:47,340 --> 00:24:50,260 And there's something very interesting that you can do. 483 00:24:51,180 --> 00:24:56,760 They come to you and say, hey, what's the name associated with your IP address? 484 00:24:57,340 --> 00:24:58,760 Now, you could tell them. 485 00:25:00,300 --> 00:25:03,840 Or you could tell them, no, no, no, no, I don't have the answer either. 486 00:25:04,780 --> 00:25:06,120 You know who does, though? 487 00:25:06,660 --> 00:25:08,980 It's this IP address inside your network. 488 00:25:17,500 --> 00:25:17,980 Ah. 489 00:25:18,440 --> 00:25:20,720 But it gets a little bit more complicated. 490 00:25:20,980 --> 00:25:26,340 Because we don't just want this original reverse request to come back to us. 491 00:25:26,420 --> 00:25:27,960 I mean, to get to go to the inside network. 492 00:25:28,240 --> 00:25:28,760 No, no, no. 493 00:25:28,760 --> 00:25:31,340 We want arbitrary data. 494 00:25:31,780 --> 00:25:35,400 So what we do is we say, no, no, no, I don't know the answer. 495 00:25:36,820 --> 00:25:41,300 You know, bigbatchadata.otherdomain.com has the answer. 496 00:25:41,700 --> 00:25:47,280 Now, this bigbatchadata will actually be the address that is eventually pointed back in the network. 497 00:25:47,700 --> 00:25:55,580 But the very interesting thing is it is put into a separate domain than the one they looked under for the reverse lookup. 498 00:25:55,740 --> 00:25:56,260 Why? 499 00:25:56,640 --> 00:25:59,340 I told you earlier about DNS spoofing. 500 00:25:59,440 --> 00:26:01,880 DNS spoofing used to work like this. 501 00:26:02,100 --> 00:26:06,520 They would reverse, you know, they would look up through one house, look up through another, look up through another. 502 00:26:06,520 --> 00:26:09,020 You'd say, no, no, no, no, I don't have the answer. 503 00:26:09,200 --> 00:26:11,360 But Yahoo has the answer. 504 00:26:11,560 --> 00:26:14,220 And Yahoo is at, oh, Yahoo is at my address. 505 00:26:14,720 --> 00:26:15,920 And then it would store it. 506 00:26:15,980 --> 00:26:20,020 And now every time that server tried to go to Yahoo, it would come to this address. 507 00:26:21,740 --> 00:26:23,240 So this was bad. 508 00:26:23,600 --> 00:26:35,900 So it was deemed the solution was to not trust the server if it told you the IP address of a given domain if that domain was some completely different place. 509 00:26:36,120 --> 00:26:36,500 Right? 510 00:26:36,520 --> 00:26:41,600 It would say, oh, you know what, you aren't qualified to answer requests about Yahoo. 511 00:26:42,220 --> 00:26:44,980 Or you're not qualified to answer requests about this other domain. 512 00:26:45,280 --> 00:26:48,900 So it would start a completely new recursion process. 513 00:26:49,320 --> 00:26:58,100 And this new recursion process would be for this new arbitrary name and would follow that path to its inevitable IP address. 514 00:26:58,400 --> 00:27:06,020 And it's that arbitrary name and arbitrary IP address lookup that gets leaked all the way back into the target network. 515 00:27:06,020 --> 00:27:08,300 That is our pipe in. 516 00:27:08,900 --> 00:27:10,200 Now what's our pipe out? 517 00:27:10,520 --> 00:27:11,580 Well, we just do the same thing. 518 00:27:11,800 --> 00:27:19,360 The guy on the inside, our Trojan horse on the inside, picks up this request, says, uh-oh, I've got a big request here. 519 00:27:19,480 --> 00:27:20,140 I've got data. 520 00:27:20,220 --> 00:27:21,160 I've got an incoming message. 521 00:27:22,000 --> 00:27:24,960 I don't know the answer, but this guy on the outside does. 522 00:27:25,200 --> 00:27:28,400 And thus you have a path that goes both directions. 523 00:27:28,620 --> 00:27:30,380 You communicate with the IDS. 524 00:27:30,520 --> 00:27:35,860 It sent a message to the DNS, causing the DNS to proxy traffic back and forth. 525 00:27:35,860 --> 00:27:38,260 Between an outside host and an inside host. 526 00:27:38,900 --> 00:27:41,460 And there's no recursion involved from a public thing. 527 00:27:41,740 --> 00:27:42,740 It's kind of nasty. 528 00:27:43,120 --> 00:27:48,580 And did I mention that actually a human auditor looking into your IP address can actually cause this? 529 00:27:49,140 --> 00:27:50,060 Social engineering. 530 00:27:53,360 --> 00:27:59,920 As an aside, by the way, I'm kind of embarrassed to have to talk about this, but I'm going to do it anyway. 531 00:28:02,080 --> 00:28:04,720 Please don't log when you're writing software. 532 00:28:04,720 --> 00:28:07,520 Just the name returned from a pointer value. 533 00:28:07,740 --> 00:28:12,540 Your pointer value, IP address, say, 1.2.3.4 equals this name. 534 00:28:13,280 --> 00:28:17,100 Lots and lots of places will just say, hey, if I got a name back, I'm not going to log the IP. 535 00:28:17,780 --> 00:28:20,240 Well, you know what I can return for my name? 536 00:28:21,900 --> 00:28:22,980 127001 is my name. 537 00:28:23,140 --> 00:28:24,980 Hey, do you know how much that messes up your logs? 538 00:28:26,620 --> 00:28:27,280 Yeah, guys. 539 00:28:27,760 --> 00:28:29,060 By the way, who does this? 540 00:28:29,200 --> 00:28:29,820 I don't know. 541 00:28:30,200 --> 00:28:33,320 Apache, SSHD, a bunch of IDSs. 542 00:28:33,840 --> 00:28:34,580 Don't do this. 543 00:28:34,720 --> 00:28:35,260 Thank you. 544 00:28:39,280 --> 00:28:40,420 Okay, this is cute. 545 00:28:44,180 --> 00:28:49,100 Some people came to me and they said, Dan, I would like to be able to communicate with my friend. 546 00:28:49,360 --> 00:28:56,180 And I'm behind in that, and he's behind in that, and we can't talk to each other, and we don't have any open bulletin boards that we can communicate through. 547 00:28:56,640 --> 00:28:59,480 We would like to communicate with one another. 548 00:28:59,700 --> 00:29:00,860 How can we do so? 549 00:29:01,200 --> 00:29:02,640 Can we do it through DNS servers? 550 00:29:02,640 --> 00:29:07,640 I'm like, well, DNS servers aren't going to, like, store, you know, list out all the results of their cache. 551 00:29:08,120 --> 00:29:10,400 They're like, please, Dan, there's got to be a way. 552 00:29:10,700 --> 00:29:12,780 So I'm like, um, okay. 553 00:29:14,380 --> 00:29:15,840 You go to a recursive server. 554 00:29:16,120 --> 00:29:22,520 You say, hey, you over there, 4221, what is datadocsparer.com? 555 00:29:23,300 --> 00:29:26,460 And it goes ahead and it finds out and it stores that value for a while. 556 00:29:26,780 --> 00:29:30,700 Now, a second guy comes along and he says, what is datadocsparer.com? 557 00:29:31,000 --> 00:29:32,160 Well, it's already cached. 558 00:29:32,160 --> 00:29:33,000 So the answer's there. 559 00:29:33,880 --> 00:29:39,700 When he does that second request, the second guy comes along, he can actually say, no, don't investigate. 560 00:29:39,940 --> 00:29:41,120 Don't recurse. 561 00:29:41,140 --> 00:29:44,020 If you have the answer already, that's great. 562 00:29:44,180 --> 00:29:45,320 Go ahead and give it to me. 563 00:29:45,460 --> 00:29:47,500 But if not, no, no, no, no, I don't want to know. 564 00:29:48,200 --> 00:29:49,900 That's just a recursion desired bit. 565 00:29:51,600 --> 00:29:53,820 Now, datadocsparer.com's already cached. 566 00:29:54,060 --> 00:29:56,060 So it still returns. 567 00:29:58,240 --> 00:29:58,940 That's information. 568 00:29:58,940 --> 00:30:04,900 I now know that this guy had already gone ahead and seen datadocsparer.com. 569 00:30:05,160 --> 00:30:15,540 And this is related to the whole class of information leakage where you can find out if a server has been looking up Yahoo, been looking up Hotmail, been looking up arbitrary name that you want. 570 00:30:15,720 --> 00:30:21,600 You can query its cache and not do it destructively by destroying your recursion desired bit. 571 00:30:21,860 --> 00:30:28,920 But you can also send information based on whether an individual record has already been looked up. 572 00:30:28,920 --> 00:30:29,540 Or not. 573 00:30:30,200 --> 00:30:35,660 Here is the method for single bit data transfer over DNS. 574 00:30:36,040 --> 00:30:38,840 And yes, this is even slower than it sounds. 575 00:30:41,020 --> 00:30:41,960 Step one. 576 00:30:42,180 --> 00:30:46,280 Split your message, and it better be short, into individual bits. 577 00:30:46,740 --> 00:30:54,620 For each byte that's going to be available for reading, do a recursive lookup against a value that says, you know, I'm starting another byte. 578 00:30:54,960 --> 00:30:58,900 For each bit that is one, do a recursive lookup against a value that says, you know, I'm starting another byte. 579 00:30:58,920 --> 00:31:06,500 For each bit that goes up against the wildcard hosted message, meaning it'll return a response no matter what the query is, that identifies that bit as active. 580 00:31:16,220 --> 00:31:19,920 How do you retrieve that data? 581 00:31:20,200 --> 00:31:27,100 You scan from you know, one, six to eight, and actually you scan all eight bits in a byte. 582 00:31:28,040 --> 00:31:28,900 First you try to see whathast depending on what they've already exploded in the symbol. 583 00:31:28,920 --> 00:31:30,700 Do a lookup for the first byte, start bit. 584 00:31:31,000 --> 00:31:37,080 If you get a reply, do a non-recursive lookup against all the names that map to the eight bits. 585 00:31:37,380 --> 00:31:40,660 The names that do return an answer, well, that's a one. 586 00:31:41,060 --> 00:31:43,760 The bits that don't return an answer are a zero. 587 00:31:44,400 --> 00:31:47,560 You integrate the bytes into a bit, the bits into a byte, and you save. 588 00:31:47,980 --> 00:31:49,640 Increment the byte counter, return step one. 589 00:31:50,640 --> 00:31:54,160 Long story short, you get about eight bits a second. 590 00:31:54,860 --> 00:31:59,340 But, two hosts can communicate over a tremendous amount of traffic. 591 00:32:01,220 --> 00:32:01,780 Implications. 592 00:32:02,020 --> 00:32:05,480 Well, first of all, we can do bidirectional communication really, really slowly. 593 00:32:06,620 --> 00:32:09,900 Secondly, this method can be extended to pretty much anything. 594 00:32:10,880 --> 00:32:13,300 Web counters can be used for communication. 595 00:32:13,660 --> 00:32:15,500 IPID counters and IP stacks. 596 00:32:15,940 --> 00:32:18,880 There's a story about Paul Revere's lamps in the tower. 597 00:32:19,000 --> 00:32:19,960 The British are coming. 598 00:32:21,440 --> 00:32:23,340 There's a quote in the intelligence community. 599 00:32:23,340 --> 00:32:25,700 You can always send a bit. 600 00:32:25,940 --> 00:32:27,820 And there's a question, you know, did it increment or not? 601 00:32:27,860 --> 00:32:30,240 Well, the start spikes between 601 and 602. 602 00:32:30,660 --> 00:32:33,140 So, I mean, there's always a way to send a bit. 603 00:32:33,740 --> 00:32:35,600 Who would possibly send more data? 604 00:32:37,820 --> 00:32:38,640 Last modified. 605 00:32:39,220 --> 00:32:43,920 Since last week, I'm writing all this code about DNS, and there's this last shot story. 606 00:32:44,120 --> 00:32:46,780 It says, RSS is overloading the internet. 607 00:32:47,140 --> 00:32:53,320 Well, lots and lots of news readers will do big, heavy HTTP queries every hour. 608 00:32:53,340 --> 00:32:59,820 And according to the admins, this looks a lot like a DDoS. 609 00:33:00,040 --> 00:33:02,560 You know, all these hosts coming at once is really inconvenient. 610 00:33:03,240 --> 00:33:08,080 Now, the only information they want to know is if there's any new data for them to download. 611 00:33:08,660 --> 00:33:09,500 So, I'm like, fine. 612 00:33:09,740 --> 00:33:13,900 We'll take this one tiny piece of information and we'll shove it in a DNS text record. 613 00:33:14,120 --> 00:33:15,400 And then you can just do a lookup. 614 00:33:15,840 --> 00:33:20,740 But, you know, it's a pain in the ass in a lot of languages to do text record lookups. 615 00:33:20,900 --> 00:33:21,760 And I'm like, huh. 616 00:33:23,340 --> 00:33:27,260 Last modified, the date that this RSS news file was updated. 617 00:33:27,540 --> 00:33:28,540 Well, that's a date. 618 00:33:29,320 --> 00:33:30,380 Dates are times. 619 00:33:30,500 --> 00:33:35,240 And times are represented as 32-bit integers in Unix. 620 00:33:35,580 --> 00:33:35,920 Huh. 621 00:33:36,760 --> 00:33:40,740 What does DNS move a lot of that's 32 bits wide? 622 00:33:42,140 --> 00:33:42,720 Oh, yeah. 623 00:33:42,760 --> 00:33:43,420 IP addresses. 624 00:33:44,680 --> 00:33:47,260 So, here's what I went ahead and wrote. 625 00:33:48,500 --> 00:33:50,920 I wrote last modified over DNS. 626 00:33:51,220 --> 00:33:53,240 It encodes a date. 627 00:33:53,340 --> 00:33:55,920 Date as the IP address for an arbitrary name. 628 00:33:56,560 --> 00:33:59,500 So, you go ahead and you run a simple command called glance. 629 00:33:59,980 --> 00:34:01,740 The critical source code is right above. 630 00:34:02,000 --> 00:34:04,260 It does a get host by name and then it casts it as a time. 631 00:34:04,760 --> 00:34:11,440 You glance at www.cnn.com, glance, alt.expero.com, did we kill someone again? 632 00:34:12,600 --> 00:34:13,120 Damn. 633 00:34:14,920 --> 00:34:16,360 And look at what it returns. 634 00:34:16,840 --> 00:34:18,600 Number of seconds since that time. 635 00:34:18,880 --> 00:34:22,700 Thursday, July 29th, 16-11-21, GMT. 636 00:34:22,800 --> 00:34:23,320 Yeah. 637 00:34:23,340 --> 00:34:24,920 One packet instead of ten. 638 00:34:25,120 --> 00:34:26,140 Very, very efficient. 639 00:34:26,420 --> 00:34:27,380 And it caches. 640 00:34:27,740 --> 00:34:31,280 Everyone at AOL can find out that CNN hasn't updated yet. 641 00:34:31,440 --> 00:34:31,860 Hallelujah. 642 00:34:33,080 --> 00:34:36,520 But let's say we wanted a little bit more storage. 643 00:34:36,600 --> 00:34:42,160 You know, what could we do that might possibly be interesting to move over DNS? 644 00:34:43,180 --> 00:34:45,680 Well, let's say we wanted to do really big files. 645 00:34:46,440 --> 00:34:47,860 I call this domain cast. 646 00:34:48,940 --> 00:34:53,240 Normally, normally in DNS, you talk to your own server and it retrieves, 647 00:34:53,240 --> 00:34:58,560 the canonical official data on demand for a particular request from just the official 648 00:34:58,560 --> 00:34:59,060 server. 649 00:34:59,360 --> 00:35:01,480 And the data is consistent for everyone. 650 00:35:02,200 --> 00:35:03,020 That's normally. 651 00:35:03,560 --> 00:35:05,020 Let's have a little bit more fun. 652 00:35:05,420 --> 00:35:09,520 I showed you that screen saver at the beginning and there were a lot of dots there, right? 653 00:35:09,960 --> 00:35:13,820 What if in each of those dots we stored 20 kilobytes of data? 654 00:35:14,200 --> 00:35:18,560 A different 20 kilobytes of data for each of those dots. 655 00:35:19,300 --> 00:35:19,820 Well? 656 00:35:20,420 --> 00:35:22,680 If you do the math, it would take. 657 00:35:22,680 --> 00:35:30,000 If we had 20 kilobytes of server and a 700 megabyte Noppix CD, it would only take about 658 00:35:30,000 --> 00:35:33,120 35,000 servers to host all 700 megs of data. 659 00:35:33,760 --> 00:35:34,600 And guess what? 660 00:35:34,720 --> 00:35:38,440 They're all storing data in their cache for up to a week. 661 00:35:38,620 --> 00:35:42,580 So for up to a week, we could store this big, huge file. 662 00:35:43,180 --> 00:35:44,320 Would it be fast? 663 00:35:44,660 --> 00:35:49,600 Well, out of the DNS server, you can only get about a kilobyte a second, more or less. 664 00:35:50,980 --> 00:35:51,520 Well? 665 00:35:51,520 --> 00:35:57,840 Well, time one kilobyte a second times 35,000 is 35 megabytes a second. 666 00:35:58,000 --> 00:36:00,340 I think that's faster than my net connection. 667 00:36:01,120 --> 00:36:07,460 Now, yes, there's going to be some overhead, say 50% overhead, that's still 17 megasecond. 668 00:36:07,520 --> 00:36:10,380 That's still a heck of a lot faster than my net connection. 669 00:36:11,880 --> 00:36:18,240 So by using a divide and conquer strategy, we can actually store a tremendous amount 670 00:36:18,240 --> 00:36:21,500 of data in effectively the internet itself. 671 00:36:21,500 --> 00:36:22,900 Kind of a neat toy. 672 00:36:24,700 --> 00:36:28,520 Now how do we distribute the list of sites to go to? 673 00:36:28,960 --> 00:36:34,400 I used to have this big, complex algorithm for encoding the next hop to go to in each 674 00:36:34,400 --> 00:36:34,820 packet. 675 00:36:35,040 --> 00:36:36,020 Then I'm like, you know what? 676 00:36:36,260 --> 00:36:39,660 35,000 times four bytes is 140 kilobytes. 677 00:36:39,840 --> 00:36:45,080 I'll just send that as my list of where to go for each individual byte. 678 00:36:46,080 --> 00:36:51,360 And if that's even too much to host, we'll just host that in DomainCast as well. 679 00:36:51,500 --> 00:36:52,940 Across seven key servers. 680 00:36:53,780 --> 00:36:54,200 BFD. 681 00:36:54,680 --> 00:37:00,260 So yeah, that's how you distribute a large file very fast over DNx. 682 00:37:00,700 --> 00:37:04,780 But as for a file, what if we wanted to do a stream? 683 00:37:05,340 --> 00:37:06,780 An audio stream. 684 00:37:07,340 --> 00:37:10,000 Say voice over DNx, anyone? 685 00:37:17,580 --> 00:37:19,560 So it turns out... 686 00:37:19,560 --> 00:37:20,020 Awesome. 687 00:37:20,240 --> 00:37:20,960 Awesome. 688 00:37:20,960 --> 00:37:30,640 So it turns out, voice compresses really freaking well, like two kilobits a second, like 276 689 00:37:30,640 --> 00:37:31,820 bytes in a second. 690 00:37:32,180 --> 00:37:32,420 Okay. 691 00:37:32,480 --> 00:37:32,880 You know what? 692 00:37:32,980 --> 00:37:34,100 DNx is slow. 693 00:37:34,480 --> 00:37:36,080 It ain't that slow. 694 00:37:36,300 --> 00:37:39,460 I can move 276 bytes even through a pretty slow server. 695 00:37:39,800 --> 00:37:42,640 So it turns out interesting. 696 00:37:42,980 --> 00:37:48,660 I didn't expect this to actually be useful, but DNx caches. 697 00:37:48,660 --> 00:37:53,580 So you can have, like, you know, one of the things you notice when you're serving audio 698 00:37:53,580 --> 00:37:58,100 data is as soon as you get a whole bunch of listeners, your bandwidth bill goes through 699 00:37:58,100 --> 00:37:58,620 the roof. 700 00:37:58,940 --> 00:38:05,000 Wouldn't it be nice if everyone cached your data and it distributed, it shared? 701 00:38:05,520 --> 00:38:11,100 Well, I looked into this for a second, and with HTTP, it's a stream, so it doesn't know 702 00:38:11,100 --> 00:38:13,120 how exactly to cache it. 703 00:38:13,280 --> 00:38:18,640 But if you divide your data into, say, 880 millisecond chunks, it's a stream. 704 00:38:18,640 --> 00:38:22,240 If you divide your data into 880 milliseconds chunks, these chunks get cached just fine. 705 00:38:23,340 --> 00:38:25,480 So yeah, that's what we do. 706 00:38:25,840 --> 00:38:33,400 We basically take data, put it into 880 millisecond chunks, we upload them using standard dynamic 707 00:38:33,400 --> 00:38:36,020 update to a bind server, and we pull them down. 708 00:38:36,960 --> 00:38:38,200 What does it sound like? 709 00:38:38,340 --> 00:38:39,400 I'm going to see if I have net. 710 00:38:41,360 --> 00:38:41,920 Maybe. 711 00:38:42,180 --> 00:38:42,960 I'm hoping. 712 00:38:46,740 --> 00:38:47,840 We have net. 713 00:38:48,060 --> 00:38:48,620 We have net. 714 00:38:52,020 --> 00:38:54,100 That's a big fat maybe. 715 00:38:57,340 --> 00:38:58,600 . 716 00:39:01,620 --> 00:39:02,880 . 717 00:39:02,880 --> 00:39:04,960 . 718 00:39:07,080 --> 00:39:08,340 . 719 00:39:08,340 --> 00:39:08,720 . 720 00:39:08,720 --> 00:39:08,900 . 721 00:39:08,900 --> 00:39:09,260 . 722 00:39:09,260 --> 00:39:09,760 . 723 00:39:09,760 --> 00:39:09,940 . 724 00:39:09,940 --> 00:39:11,140 . 725 00:39:11,140 --> 00:39:13,640 . 726 00:39:15,040 --> 00:39:16,300 . 727 00:39:16,300 --> 00:39:16,320 . 728 00:39:16,320 --> 00:39:16,950 . 729 00:39:18,620 --> 00:39:19,160 . 730 00:39:23,980 --> 00:39:24,380 . 731 00:39:24,380 --> 00:39:24,580 All right. 732 00:39:24,700 --> 00:39:27,280 I'm going to need to modify this real quick, and then we're going to win. 733 00:39:32,880 --> 00:39:33,580 All right. 734 00:39:33,780 --> 00:39:34,140 . 735 00:39:34,620 --> 00:39:35,020 . 736 00:39:35,020 --> 00:39:35,540 . 737 00:39:35,540 --> 00:39:35,640 . 738 00:39:35,640 --> 00:39:35,920 . 739 00:39:35,920 --> 00:39:36,360 . 740 00:39:36,360 --> 00:39:36,420 . 741 00:39:36,420 --> 00:39:36,500 . 742 00:39:36,500 --> 00:39:36,880 promises. 743 00:39:58,880 --> 00:40:01,880 KGO Radio, San Francisco, California. 744 00:40:03,030 --> 00:40:04,200 This isn't saved. 745 00:40:04,200 --> 00:40:06,560 This isn't a lame demo. 746 00:40:06,660 --> 00:40:07,660 That was live. 747 00:40:09,220 --> 00:40:11,700 And now that we have actual net, 748 00:40:11,920 --> 00:40:14,660 hang on, we've got to do that SSH over DNS. 749 00:40:14,940 --> 00:40:15,360 Come on. 750 00:40:15,560 --> 00:40:18,780 How long have we wanted this at our disposal? 751 00:40:19,780 --> 00:40:20,940 Actually, I don't even need to put this down. 752 00:40:24,920 --> 00:40:26,540 Since when could you afford a hooker? 753 00:40:29,580 --> 00:40:30,020 Maybe. 754 00:40:31,340 --> 00:40:32,000 Hang on. 755 00:40:32,320 --> 00:40:33,820 I have to modify one thing again. 756 00:40:37,760 --> 00:40:39,220 Actually, I can document this. 757 00:40:39,620 --> 00:40:42,360 So, I don't know how many of you can read this. 758 00:40:42,920 --> 00:40:46,440 SSH actually has support for something called a proxy command. 759 00:40:46,820 --> 00:40:48,500 A proxy command says, you know what? 760 00:40:48,580 --> 00:40:51,000 A straight up TCP connection isn't going to work. 761 00:40:51,180 --> 00:40:52,840 Instead, run this command, 762 00:40:53,120 --> 00:40:56,060 and it will go ahead and give you connectivity to where you want. 763 00:40:56,340 --> 00:41:00,540 Now, normally, it will just, you know, work. 764 00:41:00,760 --> 00:41:03,220 I mean, normally you use this for SOCKS or for HTTP. 765 00:41:05,880 --> 00:41:07,100 This isn't normal. 766 00:41:07,260 --> 00:41:08,160 I'm using it for DNS. 767 00:41:08,860 --> 00:41:14,000 Now, what I'm doing is I'm adding an option to my DROUTE command to tell it to go through 768 00:41:14,000 --> 00:41:15,700 the resolver at 4.2.2.1. 769 00:41:15,940 --> 00:41:21,380 I can actually tell it to go through multiple resolvers so that my data is actually bouncing 770 00:41:21,380 --> 00:41:24,460 off an arbitrary large list of name servers. 771 00:41:24,980 --> 00:41:30,460 So, if you, say, wanted to spread your communications across 30 or 50 hosts, no problem, boss. 772 00:41:33,240 --> 00:41:34,180 Let's see if this works. 773 00:41:38,320 --> 00:41:38,920 Maybe. 774 00:41:40,360 --> 00:41:41,340 Aw, yeah. 775 00:41:45,280 --> 00:41:48,420 This is going not straight up but over SSH. 776 00:41:51,100 --> 00:41:52,020 Receive disconnect. 777 00:41:52,320 --> 00:41:52,700 That sucks. 778 00:41:53,320 --> 00:41:54,280 I'll try it one more time. 779 00:41:56,700 --> 00:41:57,300 Shhh. 780 00:41:59,400 --> 00:42:00,740 Entering interactive session. 781 00:42:00,980 --> 00:42:02,040 Look at mail. 782 00:42:04,320 --> 00:42:05,420 And you know what? 783 00:42:05,520 --> 00:42:07,820 Just because I feel like doing it. 784 00:42:20,740 --> 00:42:22,940 I feel like talking to my friends. 785 00:42:24,720 --> 00:42:25,620 Cookie scent. 786 00:42:29,320 --> 00:42:31,100 And maybe, maybe. 787 00:42:32,200 --> 00:42:33,040 Hi, guys. 788 00:42:33,180 --> 00:42:33,860 How you doing? 789 00:42:39,180 --> 00:42:40,280 Now, that's a stunt. 790 00:42:42,400 --> 00:42:46,800 We can actually port that audio hack back to HTTP 791 00:42:46,800 --> 00:42:50,280 and return one to five second chunks of audio over HTTP. 792 00:42:50,680 --> 00:42:52,540 And now it will be compatible with proxy servers. 793 00:42:53,980 --> 00:42:55,880 So, people have come to me and they've said, 794 00:42:55,960 --> 00:42:57,760 Dan, you've talked about a whole bunch of stuff. 795 00:42:57,960 --> 00:43:00,900 I don't really understand what I'm supposed to take out of this talk. 796 00:43:01,760 --> 00:43:03,600 Fine, I'll give you a nice little summary. 797 00:43:04,240 --> 00:43:06,700 First, DNS is globally deployed. 798 00:43:06,960 --> 00:43:07,880 You use it. 799 00:43:08,000 --> 00:43:09,680 You probably serve it as well. 800 00:43:10,620 --> 00:43:14,500 Second, as the rest of IP networking has become more and more filtered, 801 00:43:14,740 --> 00:43:18,840 DNS has been left pretty much just the same for important reasons, 802 00:43:18,960 --> 00:43:20,340 but has been left the same. 803 00:43:20,660 --> 00:43:25,880 And its services actually outstrip what a normal IP network provides. 804 00:43:26,200 --> 00:43:28,960 Normal IP networks don't cache data. 805 00:43:29,180 --> 00:43:30,200 DNS does. 806 00:43:30,880 --> 00:43:33,980 Third, this connectivity can be used to, 807 00:43:34,180 --> 00:43:35,940 for example, offer an entire range of services. 808 00:43:36,120 --> 00:43:42,340 From an encrypted VPN-style link, to a completely silent but remotely accessible Trojan horse, 809 00:43:42,580 --> 00:43:46,120 to an unexpectedly useful distributed audio caching system. 810 00:43:47,600 --> 00:43:50,100 Fourth, don't shut off your DNS servers. 811 00:43:50,300 --> 00:43:51,520 Don't try to firewall it off. 812 00:43:51,540 --> 00:43:53,140 It'll just knock out your network connectivity. 813 00:43:53,660 --> 00:43:59,480 But please, watch your DNS traffic, see what's going on, pay attention, because people like 814 00:43:59,480 --> 00:44:00,140 me are out there. 815 00:44:05,080 --> 00:44:05,880 All right? 816 00:44:08,200 --> 00:44:09,000 Any questions? 817 00:44:10,500 --> 00:44:13,500 We've got three minutes for questions and seven beers to give out. 818 00:44:13,660 --> 00:44:14,920 So, who's got something good? 819 00:44:15,060 --> 00:44:15,280 Go. 820 00:44:19,800 --> 00:44:20,360 Hang on. 821 00:44:20,420 --> 00:44:21,140 Get the heck up here. 822 00:44:21,300 --> 00:44:22,580 If you've got questions, come up now. 823 00:44:22,820 --> 00:44:23,660 We've got three minutes. 824 00:44:28,840 --> 00:44:29,540 Run, run, run. 825 00:44:30,120 --> 00:44:30,780 Coming, coming. 826 00:44:32,720 --> 00:44:33,120 Lean. 827 00:44:33,580 --> 00:44:34,160 How do you do? 828 00:44:34,180 --> 00:44:37,900 How do you deal with a blind Anycast system like the .org system that's been implemented 829 00:44:37,900 --> 00:44:38,940 over the past six months? 830 00:44:42,300 --> 00:44:43,540 Why should it be a problem? 831 00:44:43,680 --> 00:44:46,420 If I register a name in the .org domain, it still comes to me. 832 00:44:48,080 --> 00:44:50,180 It still comes to you, but over multiple hops. 833 00:44:50,500 --> 00:44:53,200 You're not dealing with the same cache on every system anymore. 834 00:44:55,740 --> 00:44:56,600 No, no, no, no, no. 835 00:44:56,640 --> 00:44:58,400 I'm not hosting stuff in the root servers. 836 00:44:58,620 --> 00:45:01,440 It's being hosted in my particular endpoint. 837 00:45:01,440 --> 00:45:07,500 Unless .org hosts all the names under .org itself, which it may vary. 838 00:45:07,880 --> 00:45:09,380 In other words, we're talking about third-level domains. 839 00:45:09,640 --> 00:45:10,840 Are these hosted in .org? 840 00:45:12,340 --> 00:45:17,060 No, but I was looking more at the attack vector, not at the hosting part of this. 841 00:45:17,200 --> 00:45:19,040 Tell me more about this attack later. 842 00:45:19,400 --> 00:45:20,040 Go ahead. 843 00:45:20,920 --> 00:45:23,420 Is it customizable, the size of packets? 844 00:45:23,640 --> 00:45:29,060 Because I know it specifically picks, at least, by default, will limit the return size of 845 00:45:29,060 --> 00:45:29,720 DNS queries. 846 00:45:30,180 --> 00:45:31,420 I am saying, I don't know. 847 00:45:31,440 --> 00:45:33,200 I have been overly conservative. 848 00:45:33,380 --> 00:45:35,060 I am 100% RFC compliant. 849 00:45:35,420 --> 00:45:41,400 My DNS packets do not exceed the 512-byte limit. 850 00:45:41,780 --> 00:45:45,520 Now, it turns out a lot of sites don't require such paranoia. 851 00:45:45,580 --> 00:45:49,760 Just by default, I coded against the system as good as I would write. 852 00:45:51,660 --> 00:45:55,980 What would you recommend to protect against this sort of DNS routing into your private network? 853 00:45:56,400 --> 00:46:01,040 Do not allow recursive DNS on any server that's dual-hosted. 854 00:46:01,440 --> 00:46:01,940 No. 855 00:46:03,460 --> 00:46:04,480 You've got to drink. 856 00:46:06,660 --> 00:46:09,140 HumbleDick was wondering if you're doing SSH over DNS. 857 00:46:09,460 --> 00:46:10,720 Is it caching the data? 858 00:46:11,160 --> 00:46:11,540 No. 859 00:46:11,580 --> 00:46:15,300 I set TTL equal to zero on all my traffic so that it's not cached. 860 00:46:16,720 --> 00:46:22,880 And actually, for the last modified stuff, there's an optional header for HTTP called 861 00:46:22,880 --> 00:46:23,400 expired. 862 00:46:23,780 --> 00:46:28,600 If you take expired minus server date, you get a number of seconds that server wants 863 00:46:28,600 --> 00:46:29,760 you to cache the value. 864 00:46:29,980 --> 00:46:31,420 Use that as your TTL. 865 00:46:31,420 --> 00:46:33,020 That's what you get for your last modified data. 866 00:46:34,460 --> 00:46:40,100 What if you got, say, 50 or 60 servers to cache a single packet of data in their servers 867 00:46:40,100 --> 00:46:45,900 and then forced another host to, or, I'm sorry, sent a spoofed DNS request to all of those 868 00:46:45,900 --> 00:46:49,160 servers and the return address were something like Microsoft.com? 869 00:46:51,540 --> 00:46:53,020 That is a very good attack. 870 00:46:54,100 --> 00:46:54,980 Just checking. 871 00:46:56,380 --> 00:47:00,360 Do you think you're 140,000 in the 64 range? 872 00:47:00,360 --> 00:47:03,140 Is that reasonable, or is that because you chose 64? 873 00:47:03,380 --> 00:47:04,700 Is it probably an average selection? 874 00:47:05,280 --> 00:47:07,160 65 does not have as much. 875 00:47:07,380 --> 00:47:08,320 64 does. 876 00:47:08,720 --> 00:47:15,900 My guess is that 64 was moderately heavily populated because 64 happens to be one of 877 00:47:15,900 --> 00:47:18,460 those that was distributed to lots and lots of different endpoints. 878 00:47:18,720 --> 00:47:22,180 There are a lot of companies that have whole class Bs or even class As. 879 00:47:22,340 --> 00:47:25,080 These companies do not host as many public DNS servers. 880 00:47:25,460 --> 00:47:26,100 Two more questions. 881 00:47:26,220 --> 00:47:27,020 Two more questions. 882 00:47:27,100 --> 00:47:27,220 Go. 883 00:47:27,580 --> 00:47:30,340 What do you foresee is a problem with, say, AWS? 884 00:47:30,360 --> 00:47:35,600 Let's say everyone started using the system to do SSH caching or caching of their video 885 00:47:35,600 --> 00:47:35,920 streams. 886 00:47:36,240 --> 00:47:40,440 This is going to create a large load on everyone's DNS server as far as bandwidth and CPU consumption. 887 00:47:40,820 --> 00:47:43,080 What sort of problems and solutions do you foresee? 888 00:47:43,420 --> 00:47:47,940 Well, for audio, the interesting thing is that it actually reduces overall bandwidth 889 00:47:47,940 --> 00:47:52,280 because it's caching locally and you're not using your external link as much. 890 00:47:52,520 --> 00:48:00,340 For SSH over DNS, it could get problematic if everybody was using this just because your 891 00:48:00,340 --> 00:48:00,780 . 892 00:48:01,360 --> 00:48:02,400 Well, you know what it is. 893 00:48:02,700 --> 00:48:08,040 Because SSH over DNS is going to be slower, your aggregate data sent is going to possibly 894 00:48:08,040 --> 00:48:08,800 be less. 895 00:48:10,020 --> 00:48:10,900 So, you know what? 896 00:48:11,780 --> 00:48:12,500 Bug me later. 897 00:48:12,580 --> 00:48:14,200 We'll think about how this could actually cause problems. 898 00:48:15,900 --> 00:48:18,300 Oh, apparently I can do as many questions as I want. 899 00:48:18,480 --> 00:48:20,020 So, come on up if you got. 900 00:48:20,100 --> 00:48:20,300 Oh, wait. 901 00:48:20,320 --> 00:48:20,620 Hang on. 902 00:48:20,700 --> 00:48:20,900 Hang on. 903 00:48:20,960 --> 00:48:23,660 If you've asked me a question, grab a beer. 904 00:48:28,400 --> 00:48:30,040 Where can I get a copy of your code? 905 00:48:30,240 --> 00:48:30,320 I don't know. 906 00:48:30,320 --> 00:48:31,220 Oh, yeah. 907 00:48:31,300 --> 00:48:33,140 Did I mention I actually released this junk? 908 00:48:35,040 --> 00:48:35,540 Yeah. 909 00:48:36,020 --> 00:48:43,760 www.d-o-x-p-a-r-a.com. 910 00:48:44,340 --> 00:48:45,120 Docs para. 911 00:48:45,360 --> 00:48:46,640 It's a backwards paradox. 912 00:48:48,160 --> 00:48:48,820 Go ahead. 913 00:48:50,100 --> 00:48:55,940 With the high failure rate of name lookups, what I'm trying to get at is in UDP streams, 914 00:48:56,220 --> 00:48:57,880 because that's how DNS communicates mostly. 915 00:48:58,080 --> 00:48:59,520 How much more overhead will this take? 916 00:49:00,340 --> 00:49:06,600 Well, the thing is, remember, I control the endpoint, and so the classic bind model of 917 00:49:06,600 --> 00:49:09,440 just failing randomly is greatly reduced. 918 00:49:09,760 --> 00:49:16,200 However, I have a lot of reliability code in my client to go ahead and retry, potentially 919 00:49:16,200 --> 00:49:17,340 in other servers. 920 00:49:17,600 --> 00:49:21,920 So, I've actually done a lot of work to make sure that reliability is managed. 921 00:49:23,220 --> 00:49:25,560 A lot of them are shifting from server to client. 922 00:49:25,860 --> 00:49:26,720 What do you mean? 923 00:49:27,220 --> 00:49:29,920 Like code DNS and some of the others that are coming out. 924 00:49:30,320 --> 00:49:30,780 To support? 925 00:49:31,080 --> 00:49:31,760 Oh, go ahead. 926 00:49:31,880 --> 00:49:33,180 To work with DNS better. 927 00:49:33,620 --> 00:49:34,100 Hmm. 928 00:49:34,420 --> 00:49:39,360 Well, I mean, the idea, code DNS will go ahead and deal with DNS caches. 929 00:49:39,540 --> 00:49:43,700 All the SSH over DNS stuff is uncached because it's part of a live stream. 930 00:49:44,400 --> 00:49:44,880 Thanks. 931 00:49:45,420 --> 00:49:50,940 When you're storing large files across multiple DNS servers, what kind of redundancy do you 932 00:49:50,940 --> 00:49:52,460 have built in in case one of them goes down? 933 00:49:52,840 --> 00:49:54,360 Ah, that's a very good question. 934 00:49:54,480 --> 00:49:55,340 You get the last beer. 935 00:49:57,580 --> 00:50:00,300 The mechanism I'm using ends up using, I don't know. 936 00:50:02,140 --> 00:50:02,820 What's it called? 937 00:50:02,900 --> 00:50:04,980 There's a whole secret splitting mechanism you can use. 938 00:50:05,580 --> 00:50:10,300 There's lots of algorithms for, like PAR on Usenet. 939 00:50:10,360 --> 00:50:14,640 There's actually a more advanced version of that that's tuned towards larger files. 940 00:50:15,200 --> 00:50:21,120 And if you have an arbitrary 90% of the data, you're able to reconstruct the entire file. 941 00:50:22,300 --> 00:50:26,100 What sort of passive attacks do you see people are using against somebody who uses this as 942 00:50:26,100 --> 00:50:27,000 a communication method? 943 00:50:27,360 --> 00:50:28,300 Can you repeat that? 944 00:50:28,500 --> 00:50:29,800 What sort of passive attacks? 945 00:50:29,800 --> 00:50:34,240 Do you see against people using this as a communication method? 946 00:50:34,560 --> 00:50:37,480 You mean how would you hurt people who were doing this? 947 00:50:37,720 --> 00:50:37,780 Yeah. 948 00:50:37,880 --> 00:50:39,900 How would you eavesdrop on somebody using this as a connection? 949 00:50:40,360 --> 00:50:41,520 Well, I'm moving a... 950 00:50:41,520 --> 00:50:42,860 Ideally, I'm moving a... 951 00:50:44,720 --> 00:50:45,320 Excuse me. 952 00:50:49,440 --> 00:50:50,960 Man, I'm allergic to your question. 953 00:50:52,640 --> 00:50:53,120 No. 954 00:50:54,180 --> 00:50:58,160 This is actually the big reason why I chose to use SSH over DNS. 955 00:50:58,460 --> 00:50:59,780 Because the SSH... 956 00:50:59,800 --> 00:51:02,500 SSH is a huge layer, and it's a huge layer that will prevent any kind of attacks from 957 00:51:02,500 --> 00:51:03,760 being particularly effective. 958 00:51:04,300 --> 00:51:08,700 I mean, yeah, you can corrupt the link without a problem, but you're not even going to be 959 00:51:08,700 --> 00:51:11,340 able to spoof traffic at me. 960 00:51:11,600 --> 00:51:16,460 And this is as opposed to what I was using as I was developing this, which was just 961 00:51:16,460 --> 00:51:19,080 INETD into a shell. 962 00:51:20,200 --> 00:51:25,440 Now, SSH has a cost, it has a lot of back and forth, and that increases the setup time 963 00:51:25,920 --> 00:51:26,400 substantially. 964 00:51:26,400 --> 00:51:30,460 But in return, you get immunity from the kind of attacks that you were thinking of. 965 00:51:30,580 --> 00:51:31,240 I think so. 966 00:51:31,560 --> 00:51:32,260 Go ahead. 967 00:51:34,240 --> 00:51:43,680 Just wondering if you've dealt with or care about how AOL doesn't seem to pay attention to all of the DNS RFCs. 968 00:51:44,980 --> 00:51:45,920 Tell me more. 969 00:51:45,920 --> 00:51:55,680 I know that a person expects a certain behavior for caching from a DNS server. 970 00:51:55,980 --> 00:51:58,340 And you're expected to be able to tell a DNS server. 971 00:51:58,620 --> 00:51:59,400 Oh, nonsense. 972 00:51:59,680 --> 00:52:02,980 I throw a nonsense to every request in SSH over DNS. 973 00:52:03,400 --> 00:52:06,060 So I know exactly what you're referring to. 974 00:52:06,400 --> 00:52:11,000 Bind can be configured to have a minimum TTL value that it will respect. 975 00:52:11,280 --> 00:52:15,900 It will refuse to accept that data isn't going to be... 976 00:52:15,920 --> 00:52:16,240 It will be cached. 977 00:52:16,340 --> 00:52:17,000 It will cache it anyway. 978 00:52:17,340 --> 00:52:21,120 So what you do is in your query, you throw a little random nonsense, a random value. 979 00:52:21,360 --> 00:52:27,700 So it can't pretend that it has a cache because it doesn't actually know that these two requests correspond to the same value. 980 00:52:27,940 --> 00:52:29,020 That's how I handle that. 981 00:52:29,360 --> 00:52:29,740 Okay. 982 00:52:30,740 --> 00:52:31,360 All right. 983 00:52:31,500 --> 00:52:32,620 No, but great question. 984 00:52:32,740 --> 00:52:33,880 I'd give you a beer if I had one. 985 00:52:35,680 --> 00:52:41,280 Is there any way to arbitrarily float extremely large files for longer than a week at a time through DNS? 986 00:52:46,660 --> 00:52:48,520 You could repopulate the data. 987 00:52:52,580 --> 00:52:56,240 So if you don't actually want to make another connection and repost anything, 988 00:52:56,660 --> 00:53:01,420 so let's say you put a payload up and you wanted to have that float around arbitrarily. 989 00:53:02,040 --> 00:53:08,080 You know what you could do is assuming in your first week you had a whole bunch of people downloading your data, 990 00:53:08,240 --> 00:53:14,620 you could actually have some code on the clients distribute the updating of the data. 991 00:53:14,780 --> 00:53:15,760 So you would distribute. 992 00:53:15,920 --> 00:53:20,200 You'd get to 35,000 servers and then you'd get 100,000 clients 993 00:53:20,200 --> 00:53:24,260 and every week the code on the clients knows, oh, I better go ahead and update that data. 994 00:53:24,540 --> 00:53:27,300 That being said, this is extraordinarily evil. 995 00:53:27,380 --> 00:53:28,520 Please don't write this client. 996 00:53:31,400 --> 00:53:32,200 Two questions. 997 00:53:32,420 --> 00:53:34,360 Are you going to release your list of IP addresses? 998 00:53:37,020 --> 00:53:37,900 Not publicly. 999 00:53:39,820 --> 00:53:40,960 Three questions then. 1000 00:53:41,040 --> 00:53:42,200 Can I have a copy of it? 1001 00:53:43,100 --> 00:53:44,140 I can't publicly. 1002 00:53:44,400 --> 00:53:45,540 I can neither confirm. 1003 00:53:45,920 --> 00:53:46,120 Or deny? 1004 00:53:46,980 --> 00:53:52,120 So the third question, it seems pretty easy to see that someone's doing this the way that you make the requests. 1005 00:53:52,680 --> 00:53:56,580 Are you going to make so that it will be hidden? 1006 00:53:56,700 --> 00:53:59,720 Because right now it would be really easy to write a snort signature and say, 1007 00:53:59,840 --> 00:54:01,200 this is someone tunneling over DNS. 1008 00:54:01,840 --> 00:54:02,280 Important. 1009 00:54:02,400 --> 00:54:03,680 Actually, there's something very important. 1010 00:54:03,960 --> 00:54:06,620 How would you write a snort signature to find this? 1011 00:54:06,660 --> 00:54:08,960 Because these packets are entirely RFC compliant. 1012 00:54:09,380 --> 00:54:13,660 Now, you could just say there's a lot of DNS traffic coming from this particular host. 1013 00:54:13,940 --> 00:54:15,700 But a better method is to notice. 1014 00:54:15,920 --> 00:54:20,080 These requests actually have very high levels of entropy. 1015 00:54:20,380 --> 00:54:26,480 In other words, English language follows a certain distribution of consonants and vowels and lead numbers and so on. 1016 00:54:26,720 --> 00:54:29,900 And DNS names very much follow that as well. 1017 00:54:30,120 --> 00:54:33,900 If you were to write a snort signature to detect this kind of traffic, 1018 00:54:34,100 --> 00:54:36,760 you would simply need to have an algorithm that detected, 1019 00:54:36,880 --> 00:54:40,360 hey, look at all this very large, highly entropic data. 1020 00:54:40,560 --> 00:54:43,420 I bet this is encapsulating SSH traffic. 1021 00:54:46,260 --> 00:54:47,980 Do you want me to stop or take more? 1022 00:54:48,780 --> 00:54:49,700 One more question. 1023 00:54:52,180 --> 00:54:56,680 Have you done any work to try to transfer 4-byte chunks over multiple A records? 1024 00:54:58,200 --> 00:55:04,780 The problem with that is that you end up with inefficiencies because of all the data in between each A record. 1025 00:55:05,480 --> 00:55:07,260 The A record stuff came originally. 1026 00:55:07,860 --> 00:55:11,100 Now, what people say, well, why don't I just shut off text record lookups? 1027 00:55:11,240 --> 00:55:13,060 First answer, because it kills SPF. 1028 00:55:13,160 --> 00:55:14,420 Second answer, fine. 1029 00:55:14,700 --> 00:55:15,620 I'll put them in. 1030 00:55:15,920 --> 00:55:16,240 I'll put them in. 1031 00:55:16,240 --> 00:55:16,580 And they say, well, why MX records? 1032 00:55:16,820 --> 00:55:18,460 And they say, well, why MX records? 1033 00:55:18,560 --> 00:55:22,240 Individual records get desorted, get randomly sorted. 1034 00:55:22,520 --> 00:55:24,900 Well, MX records have a precedence value, 1035 00:55:25,140 --> 00:55:29,940 and this precedence value can be used to sort your requests into the original order. 1036 00:55:30,220 --> 00:55:38,160 So that's why the bottom line is you're not going to stop this by trying to limit what types of records you serve. 1037 00:55:38,600 --> 00:55:41,260 So from your standpoint, it's an efficiency question. 1038 00:55:41,910 --> 00:55:42,220 Yes. 1039 00:55:42,440 --> 00:55:45,480 And I know efficiency and arbitrary data, 1040 00:55:45,920 --> 00:55:47,740 DNS are not concepts that go together, 1041 00:55:49,100 --> 00:55:50,600 but it works anyway. 1042 00:55:50,880 --> 00:55:51,560 Great. Thanks. 1043 00:55:52,060 --> 00:55:52,620 All right. 1044 00:55:52,660 --> 00:55:53,960 I think that's all we've got time for. 1045 00:55:54,120 --> 00:55:54,820 Find me later. 1046 00:55:54,940 --> 00:55:57,100 Oh, and I am going to the dunk tank. 1047 00:55:57,200 --> 00:55:59,200 If you want to dunk me, come get some.