[00:00.000 --> 00:06.580] This talk was originally going to be at one, but I'm happy, we were happy to bump this talk up [00:06.580 --> 00:14.040] because this is still one of the quintessential topics in security. And without much ado, [00:14.040 --> 00:18.640] my pleasure to introduce you to Travis Palmer and Brian Somers. [00:23.770 --> 00:28.770] Thank you, folks. So, as you said, this is a quintessential topic in security. [00:28.770 --> 00:32.890] We are actually not trying to win any awards for the length of the name of our talk, [00:32.890 --> 00:37.930] but we're pretty sure we might have actually won. And we're going to give you guys not just an update [00:37.930 --> 00:44.330] on kind of the current state of what DNS is, but also go a bit further and actually give you guys [00:44.670 --> 00:49.110] a presentation on an attack that is doable very plausibly against some major resolvers. [00:49.110 --> 00:53.470] From my understanding, Google and some other folks have not really gotten back to us with a firm word [00:53.470 --> 00:56.910] of, yeah, totally, we got this yet. So very plausibly, you could turn around and actually [00:57.370 --> 01:02.470] use this if you were very quick about it. This is a nice stick to poke people to get actually moving. [01:02.470 --> 01:08.770] So without further ado, this is how you become the one in 34 million. So I'm going to go through [01:08.770 --> 01:11.950] basically introduce ourselves. Then we're going to go right into, we have to give some [01:11.950 --> 01:16.230] background on DNS. A lot of people here are new to DEF CON and relatively new to the security [01:16.230 --> 01:19.610] industry. I can't talk about the things that are different if I can't talk about the stuff [01:19.610 --> 01:22.610] that's originally. We're going to talk about fragmentation attacks. There's a bit of a history [01:22.610 --> 01:28.210] for that. And I'm going to talk, trust me, it's not, it's a very important tangent into IPAD [01:28.210 --> 01:31.930] inference and some of the more recent stuff that has come out of University of New Mexico. [01:32.470 --> 01:36.450] And then we'll go right into the attack. I'm not actually affiliated with the folks in University [01:36.450 --> 01:40.750] of New Mexico, but they are very helpful and their white paper was more than enough to get this [01:40.750 --> 01:45.910] attack rolled together. And then Brian, who is actually a proper expert, will be talking about [01:45.910 --> 01:51.670] mitigations. So hello, I'm Travis Trafico Palmer. I'm a security research engineer for Cisco [01:51.670 --> 01:56.670] Systems. I am an OSCP and OSCE if that means anything to you. And as I kind of implied, yeah, [01:56.670 --> 02:02.070] I'm not actually an expert on DNS or DNSSEC. I don't do this on a day-to-day basis. [02:02.070 --> 02:07.110] Brian, I don't think would want to call himself an expert, but he's close enough. And he is a [02:07.110 --> 02:15.930] principal engineer for Cisco System and has had a lot of free time to work on FreeSB and OpenBSD. [02:15.930 --> 02:20.150] So what did we actually do? This is, what we found was a more consistent way to poison the [02:20.150 --> 02:24.270] cache of DNS resolvers without using a man in the middle and using an existing attack [02:24.270 --> 02:28.970] that existed using fragmentation on DNS. We took that attack, reduced it from hundreds of [02:28.970 --> 02:36.550] iterations to very plausibly one on IPv4. And for IPv6, reduced it from millions of iterations [02:36.550 --> 02:43.090] to very plausibly only one. And also because of that, we're basically bypassing all the current [02:43.090 --> 02:47.270] recommendations. So even if you're doing everything right as people are telling you, [02:47.270 --> 02:53.070] yeah, we can probably still screw your domain. So yes, we did disclose responsibly. I'm, [02:53.070 --> 02:56.850] my particular team was discovered this attack during a focus pen test engagement. It was a [02:56.850 --> 03:00.850] couple of weeks, but it's a little bit of an unusual pen test engagement to say the least. [03:01.150 --> 03:05.550] And our team disclosed off to Cisco Umbrella and Umbrella has been disclosing this to other [03:05.550 --> 03:10.090] DNS operators ongoing both before DEF CON and will likely continue to do so after DEF CON as [03:10.090 --> 03:16.690] I'm sure some e-mails might come rolling in. So to start, as I said before, we need to talk [03:16.690 --> 03:20.390] about DNS and what a better place to start than talking about the attacks because we can't really [03:20.390 --> 03:25.170] talk about all of DNS. So in the early DNS, in the way back when, DNS was really only [03:25.170 --> 03:29.670] exploitable in a man in the middle scenario, which it has no protections against. Still [03:29.670 --> 03:36.030] really doesn't have a ton of protections against, but it's getting closer. In any case, [03:36.030 --> 03:39.710] back then, ignoring other protocols, the only thing that was actually keeping a normal DNS [03:39.710 --> 03:47.370] reply from being spoofed, doing things off path, not man in the middle, was the DNS ID [03:47.370 --> 03:53.770] and the styling and the structure of the response itself. It has to answer the query. [03:54.590 --> 04:00.270] DNS queries and responses are very consistent. So really, we're back to only talking about [04:00.270 --> 04:06.270] DNS ID. And again, I said before, ignoring other protocols, there's of course the issue [04:06.270 --> 04:10.390] that this is being sent across the internet and there is this extra level thing called UDP, [04:10.390 --> 04:12.970] which is going to have port numbers and some other things that are going to be very difficult [04:12.970 --> 04:18.090] to guess if you're trying to spoof a DNS reply. And Kaminsky is for original attack basically [04:18.090 --> 04:21.530] determined that a number of implementations of resolvers that were being used were programmed [04:21.530 --> 04:27.890] to query over sequential, very predictable sets of ports. And this took out basically [04:27.890 --> 04:31.130] all of their sources of entropy that were to exist to make it difficult for the attacker. [04:31.130 --> 04:35.730] So again, we're back to the 16 bits of DNS ID. And that's really not enough to stop an attack [04:35.730 --> 04:41.170] once poison records get saved. If you can try over and over and over again and if you succeed, [04:41.170 --> 04:45.390] it gets saved, well, then you're good. You're good to do this off path. You don't need to be [04:45.390 --> 04:51.130] in the middle. What do I mean by off path? Have a diagram. So dotted blue line here is the network [04:51.130 --> 04:56.010] path from DNS request from the target is taking. And we're off path because our attacker boxes, [04:56.010 --> 05:00.690] the red boxes, we're just not on the network path. We can't see anything that's going on there. [05:00.690 --> 05:06.190] We might have some idea of what's going on over there. But we can't see or modify the traffic. [05:06.870 --> 05:11.130] Now, for this particular case, and I'm going to keep this going, this diagram is going to [05:11.130 --> 05:14.430] change a little bit, but it's going to be largely the same. We have our attacker box [05:14.430 --> 05:18.870] off somewhere in the Internet. And then inside of the trust boundary, some corporate network, [05:18.870 --> 05:24.170] something that the resolver is servicing. We have both our target and a puppet. The puppet, [05:24.170 --> 05:27.390] we don't really have to fully control. It could be as simple as just some JavaScript in a web [05:27.390 --> 05:33.770] browser. But what follows is a little less simple. So first the attacker is going to basically [05:33.770 --> 05:38.550] figure out where the external facing IP is for the resolver. This can be as simple as basically [05:38.550 --> 05:42.750] talking to ourselves, making a request for a domain that we control. And as long as our box [05:42.750 --> 05:47.550] is also serving as a name server for our own domain, we get the IP address of the resolver. [05:47.550 --> 05:52.810] The attacker then can just tell their puppet, hey, send a request on my behalf. And since we [05:52.810 --> 05:57.730] know what it's requesting and when it's requesting, we can immediately start sending responses to the [05:57.730 --> 06:02.370] resolver. And since everything else is largely predictable, in the case of the Kominsky attack, [06:02.370 --> 06:06.670] even the, even the destination port on UDP is predictable, we can just start guessing DNS IDs. [06:06.770 --> 06:11.710] Because the resolver is going to make another request on behalf of our puppet. We don't know [06:11.710 --> 06:17.210] what the ID is, but we can sure start guessing. And this might take a little while. It's not [06:17.210 --> 06:19.870] always going to get cached. Sometimes the legitimate response is going to go straight [06:19.870 --> 06:25.810] through the resolver. And so really we do have to find certain types of requests that aren't going [06:25.810 --> 06:33.110] to get cached. At least when not modified. This can, you can do this in a couple of different [06:33.110 --> 06:39.970] cases. You can do this for zero time to live domains or near zero. A lot of it is content [06:39.970 --> 06:44.790] delivery networks, Akamai, CDN, YouTube. A lot of those requests aren't going to live very long [06:44.790 --> 06:49.350] in the cache. Or we can start asking for things like domains that don't exist. Which won't get [06:49.350 --> 06:54.050] cached. Unless, of course, you then proceed to give a response for them where you say that it [06:54.050 --> 06:58.010] is existent. And then you start changing some other things. Like the records for where the [06:58.010 --> 07:01.470] name servers are at and other things. Which will, of course, all end up in the cache as well. [07:02.070 --> 07:06.090] Once it's in the cache, it also comes down to our puppet. But that doesn't really matter. [07:06.110 --> 07:10.530] The important part is that it's saved. So when our poor target machine goes out and asks for it, [07:10.530 --> 07:15.410] it gets a response back that it probably shouldn't have gotten. And starts reaching [07:15.410 --> 07:19.810] out immediately to the internet for whatever it was trying to reach initially. DNS is a protocol [07:19.810 --> 07:25.110] to find other things, ultimately. And reach out to our malicious server. Malicious server goes [07:25.110 --> 07:30.250] ahead and gives them, yeah, totally, those binaries that you wanted, yeah, got them. There you go. [07:30.310 --> 07:33.390] And that person, if that person wasn't paying attention, they get farmed. The program is [07:33.390 --> 07:37.230] reaching out and not checking the TLS certificates. And frankly anything that there's not good [07:37.230 --> 07:41.410] verification in place, they get pwned. The end. Just as disturbing as it was a little bit more [07:41.410 --> 07:46.710] than a decade ago. Of course, the Kominsky attack doesn't work anymore. I'm glad we've made [07:46.710 --> 07:51.430] progress in the past decade. Shortly before that attack was presented, even, various DNS [07:51.430 --> 07:55.390] resolver applications were patched to make the UDP ports unpredictable. Dan Kominsky is a white [07:55.390 --> 07:59.970] hat after all. So he did tell everybody kind of ahead of time. Needless to say, this puts up a [07:59.970 --> 08:05.030] heck of a damper on trying to do this kind of exploit. Because now you have a destination port [08:05.650 --> 08:12.250] to guess as well. That's another 16 bits. That's 30.2 bits total. And although you could exclude [08:12.250 --> 08:19.670] some of the ports, this is about 65,000 times harder. Though the attack is still high profile [08:19.670 --> 08:25.630] and scary, you're not going to be doing this in any kind of feasible scenario. And I'm not [08:25.630 --> 08:30.370] going to pretend Kominsky alone made DNSSEC happen, but this did help along. [08:33.270 --> 08:40.170] So people scared of DNS being spoofed basically are now using DNSSEC. Without going too far [08:40.170 --> 08:45.310] into it, DNSSEC is basically public key infrastructure for domain names. And ICANN, [08:45.310 --> 08:51.470] the highest level of authority, signs for various top level domains like .org, who then in turn [08:51.470 --> 08:56.630] sign the keys used by domains. So for example, DEFCON.org, which then used to sign those keys [08:56.630 --> 09:02.810] for records. Individual records say where WW.DEFCON.org is. Of course it's a little more [09:02.810 --> 09:08.410] complicated than that, but we really can't for sake of time dig into it. A couple of things [09:08.410 --> 09:13.790] that DNSSEC adds that are really important is data origin authentication. Basically the ability [09:13.790 --> 09:18.390] to verify the data that you're receiving is coming from where it's saying it's coming from. [09:18.450 --> 09:22.870] And also trying to make sure that data cannot be modified in transit. Since the records are [09:22.870 --> 09:26.770] signed by the zone owner and the zone's private key, it would be really hard to mess with that [09:26.770 --> 09:31.690] because if it actually gets verified, well, the signatures are not going to line up. That's how [09:31.690 --> 09:38.530] cryptography works. Of course, not everybody is actually deploying DNSSEC. And even if you were [09:38.530 --> 09:42.690] to deploy DNSSEC on your domains, it's not particularly helpful if the resolvers aren't [09:42.690 --> 09:48.570] doing it either. This part, this is really not going too well. And the last report this was [09:48.570 --> 09:53.610] made was in 2016. Unless you're in central Africa and your ISP is using Google DNS for [09:53.610 --> 10:00.230] everything, you might be in a bad bit of luck. In any case, we need to bring up some more bad [10:00.230 --> 10:06.410] news and talk about what DNSSEC doesn't actually do either. Delegation and glue records. Name [10:06.410 --> 10:11.590] server, A records for IP addresses located in the authority and additional sections in DNS are [10:11.590 --> 10:16.550] not signed. Delegations are records that basically relay authority to another server. So [10:17.090 --> 10:21.990] realistically, .com isn't going to know what servers example.com is running. So you have to [10:21.990 --> 10:26.590] delegate that authority down. And I had mentioned glue records. Glue records are largely [10:26.590 --> 10:31.670] fixed to solve an issue of if you have your name server in your domain or there's some concern [10:31.670 --> 10:35.710] about somebody not knowing where your name server is for your domain, you include that at [10:35.710 --> 10:39.830] the absolute end of the request or, pardon me, include that at the absolute very end of the [10:39.830 --> 10:46.290] response. Because otherwise, someone who is looking for some resources in example.com are [10:46.290 --> 10:50.890] going to ask the .com domain, okay, where's example.com? It's going to tell, hey, you need [10:50.890 --> 10:55.070] to look over here for example.com. And okay, where's the name service for that? We don't [10:55.070 --> 11:00.930] know? Okay. Ask .com again. This continues in an infinite loop. So that's why they need to [11:00.930 --> 11:06.090] be this. But somebody, of course, in here hopefully is thinking, why aren't these signed? [11:06.170 --> 11:11.090] Why can't we just figure out a way to sign this? Well, the RFC says so. It's with actually [11:11.090 --> 11:15.590] good reason. It's delegation of duty. Child zones have a private key for authority records [11:15.590 --> 11:20.030] and the parent zone really can't be signing it for them. But there's, again, there's data [11:20.570 --> 11:24.050] origin authentication. If you can trust that parent, you can probably trust the children [11:24.050 --> 11:28.850] as well. And there's, you know, large committees that are rather trustworthy running most of [11:28.850 --> 11:35.070] the system. Of course, there's also the deal with all the signatures. All these signatures [11:35.070 --> 11:39.050] can make responses quite long, especially if there's lots of records. And as a bonus, [11:39.050 --> 11:44.070] name servers can even sign the gaps between valid subdomains and sign nearby names to [11:44.070 --> 11:49.230] prove there's no subdomain in between using NSEC or NSEC 3. But how bad could it be? Someone [11:49.230 --> 11:55.410] might ask. Well, if today you go ahead and ask DefCon.org for a non-existent domain, [11:55.830 --> 12:03.210] they're using NSEC, and so they will respond very verbosely with 1,922 bytes to tell you [12:03.210 --> 12:10.170] something doesn't exist. Seriously? This is our best solution. You can't even send this [12:10.170 --> 12:14.950] across the internet in one piece without expecting it to be fragmented, which is something [12:14.950 --> 12:23.010] we need to talk about. So Hertzberg and Shulman realized that this was kind of a problem. [12:23.010 --> 12:27.490] If the response is getting split up, UDP has no means of dealing with fragmentation. Only [12:27.490 --> 12:30.970] really that's TCP. And everything in DNS is running by UDP by default. So it has to be [12:30.970 --> 12:38.630] fragmented to the IP layer. And that means it gets an IP identifier. And mind you, these [12:38.630 --> 12:43.970] are rather inexact diagrams, but I'm trying to keep it simple. It is IP around UDP around [12:43.970 --> 12:50.150] DNS. And in red is basically all the things that an attacker can't really spoof. And that [12:50.150 --> 12:54.890] IP identifier is an IP layer 3 thing. It's used on both IPv4 and IPv6. In any case, it's [12:54.890 --> 12:59.130] an additional factor source of entropy. We have to guess that it's an attacker. But if [12:59.130 --> 13:03.610] you're noticing, that second fragment's looking a little lonely because all of those QDC signing [13:03.610 --> 13:07.430] bits and the other protocols end up in that first fragment. And the second fragment, the [13:07.430 --> 13:14.010] only thing we have is that IP layer identifier. Now, DNS actually adds even more stuff. But [13:14.010 --> 13:19.990] again, it ends up in the headers or the first couple of things in DNS. Nothing in the second [13:19.990 --> 13:27.430] fragment. And as it turns out, the IP ID for IPv4 is 16 bits. This familiar to anybody? [13:27.910 --> 13:33.070] As a further bonus, many resolvers when this paper was published were using global counters [13:33.070 --> 13:37.610] for IP ID. And it was the default in Windows, default in FreeBSD according to them when [13:37.610 --> 13:43.930] they published in 2012. And there was a lot of resolvers they were able to find right [13:43.930 --> 13:47.630] before they published it that were doing global IP ID. So what does this attack end up looking [13:47.630 --> 13:51.850] like in that particular case? Well, I have to add something to the diagram real quick. [13:52.210 --> 13:56.770] We now have an IP fragment cache on this diagram. It holds up to 64 fragments. That's relatively [13:56.770 --> 14:01.670] the default. It holds them up so they can be reassembled when and if they all get received. [14:01.670 --> 14:06.070] And if nothing else, it drops them after a couple of minutes. In any case, the first thing [14:06.070 --> 14:11.810] we do when performing this attack is ask. Sometimes you only need to ask. As an attacker, [14:11.810 --> 14:15.930] we basically just ask the name server if the response is fragmented or it's IPv4, we get an [14:15.930 --> 14:19.970] IP ID back. So we already know what IP ID the name server is using if it's using global IP [14:19.970 --> 14:25.010] ID. And then we proceed doing what we were doing before. Puppet goes ahead and asks [14:25.010 --> 14:29.710] something on our behalf. And while the name server is still thinking about responding to [14:29.710 --> 14:34.810] that, we start guessing IP IDs. And DNS is relatively well structured, very consistent. If [14:34.810 --> 14:37.630] you ask for something, you're always going to get roughly the same reply, short of maybe [14:37.630 --> 14:40.510] some garbling up in the headers. But again, we don't care about the headers. We're sending [14:40.510 --> 14:43.370] the second fragment over and over and over and over again. And we actually have a good [14:43.370 --> 14:48.390] starting point. We know what the IP ID was before. And so we can go ahead and just send [14:48.390 --> 14:52.850] that sucker along and start guessing everything in front of it. Mind you, it is global, so we [14:52.850 --> 14:55.790] have to do this kind of quickly. Other people could be talking into this name server, and [14:55.790 --> 15:01.090] they probably are, which is going to increase the IP ID. But we can guess 64 times. So at [15:01.090 --> 15:06.670] some point, we're not just going to go through, but we're actually going to be combined with [15:06.670 --> 15:11.070] the first fragment of the original legitimate request, which contains all of the lovely [15:11.070 --> 15:15.690] headers that are signing this thing. And then that's going to go right on up into the cache [15:15.690 --> 15:19.010] and then down to our puppet. But again, the thing we care about most is the cache because [15:19.010 --> 15:25.290] when at a later point, when that poor target machine goes ahead and asks, hey, where's [15:25.290 --> 15:30.250] Defcon.org? They're going to get that assembled, but tampered response. And just like a [15:30.250 --> 15:35.090] Kominsky's detect before, target makes a query for what was, it gets told it lives with the [15:35.090 --> 15:41.710] attacker. It pulls some data from the attacker. It all downhill from there. And pardon me, [15:41.710 --> 15:50.230] my mouth is getting really dry. So there's a lot of stuff you can actually do with this. [15:50.230 --> 15:54.290] Even with DNSSEC, DNSSEC does limit what you can do with these kind of poisoning attacks. [15:54.290 --> 15:59.010] And there's only so much you can really mess with in the cache that isn't directly signed. [15:59.030 --> 16:02.490] But of the four sections, question, answer, authority, and additional, the ones we care [16:02.490 --> 16:05.350] about most with DNSSEC are those last two, the ones that are going to contain the stuff [16:05.350 --> 16:09.730] that's likely to be unsigned. And they're almost always going to make it in that second [16:09.730 --> 16:16.530] fragment. And we get some options. I would love to verbally explain to you all the limitations, [16:16.530 --> 16:21.870] but they made a diagram for me, so I'm going to use the diagram from their paper. So the [16:21.870 --> 16:27.050] main ones you want to look at here, because there's a couple, and that third from bottom [16:27.050 --> 16:30.450] line there is permissive or island. Basically the resolver is not actually doing some good [16:30.450 --> 16:34.150] resolving, not checking anything. Yeah, there's a lot of stuff in this you can do immediately [16:34.150 --> 16:38.830] if the resolver is not checking DNSSEC. But for the other cases when everything is in [16:38.830 --> 16:42.730] line doing what it's supposed to do, there's other stuff you can still do. So if you're [16:42.730 --> 16:47.250] using NSEC 3, and you're using it with an opt-out, that means you're not signing delegations [16:47.250 --> 16:51.790] with NSEC 3. And that means that if someone were to say, I don't know, replace one of [16:51.790 --> 16:56.750] your NSEC 3 records with an NS record for a subdomain, yeah, that subdomain exists now [16:56.750 --> 17:01.830] as far as your resolver is concerned. The other thing you can do is basically something [17:01.830 --> 17:08.690] in two phases. You can do NS hijacking, which if you've noticed, doesn't have a lot of requirements, [17:08.690 --> 17:13.310] and name server blocking, which again doesn't have a lot of requirements, at the same time. [17:13.310 --> 17:18.210] Basically what you do is you poison an NS record that makes it in the cache, and then [17:18.210 --> 17:22.970] you start performing server blocking on all the other name servers. And it's actually [17:22.970 --> 17:26.650] really easy to do name server blocking, because the only thing you have to do is ruin the [17:26.650 --> 17:31.570] responses from all those other name servers. And if you can just ask what their IP ID is, [17:31.570 --> 17:34.890] all you have to do is just mess it up. You don't have to poison anything, you don't have [17:34.890 --> 17:38.750] to have it even be correctly structured. If it gets reassembled and it's the wrong way, [17:38.750 --> 17:44.450] it's not going to be accepted. And for most DNS software, and unbound particularly, two [17:44.450 --> 17:48.870] failed queries at a 15 minute interval, that name, that resolver marks that name server [17:48.870 --> 17:54.110] as not responsive. All bad news. And if that last slide wasn't concerning enough, there's [17:54.110 --> 17:57.190] also the possibility the attacker could cause fragmentation by tricking the name server [17:57.190 --> 18:02.130] into believing that it needs to further fragment traffic, which of course helps get a complete [18:02.130 --> 18:06.770] record into that second fragment, or as many records as you want into that second fragment. [18:06.870 --> 18:10.070] And this does work on IPv6 as well, and there's been a couple of studies done that you can [18:10.070 --> 18:15.410] get this stuff well below what should be the minimum transmission unit. Any case, there [18:15.410 --> 18:19.370] are some more limitations to this. This, you folks probably would have heard about this [18:19.370 --> 18:23.890] if it had not been for some additional limitations. There's a lot of name servers that aren't [18:23.890 --> 18:28.150] deploying with global counters anymore. No real surprise there, that's something we generally [18:28.150 --> 18:33.030] expect from the network stack of a printer. Windows is still, as far as we know, using [18:33.210 --> 18:37.010] a global counter, but FreeBSD is now using a mostly random searchable queue system and [18:37.010 --> 18:41.950] Linux still isn't using global counters. Even back in 2012, Linux was using mostly [18:41.950 --> 18:47.070] per destination. And we can't query something that gets cached, just kind of like before. [18:47.070 --> 18:50.730] A significant portion of the difficulty here is finding the query that returns a predictable [18:50.730 --> 18:54.510] fragmented response, and sometimes the options for a given target are pretty slim, and maybe [18:54.510 --> 19:02.710] just the response to the any query is enough, but it can be dicey. And there's also the [19:02.710 --> 19:10.010] future. IPv6 throws a complete wrench in this. 32 bits in trying to guess with IPv6, that [19:10.010 --> 19:19.130] puts you in the territory of 34 million iterations, and that's doing it on average. The actual [19:19.130 --> 19:23.450] case for exhausting the entire key space, and this is assuming stuff isn't moving or [19:23.450 --> 19:29.070] other people are talking to this name server, is around 67 million. You're not going to [19:29.070 --> 19:33.290] do this. This is literal terabytes of traffic you'd have to send. You're not doing this [19:33.290 --> 19:39.850] on IPv6. There's no way. But there has been some notice. This is kind of a bit of a thing [19:39.850 --> 19:46.010] for IPv4, and prior to our engagement with Umbrella, their implementation was using IPv6 [19:46.010 --> 19:50.730] whenever possible. Why wouldn't you? And they detect IPv4 fragments and re-query them over [19:50.730 --> 19:58.770] TCP or IPv6 if it's, or, ah, pardon me. Read, re-query it over IPv6 where possible and [19:58.770 --> 20:04.150] basically re-query over TCP if that still fails or you can't just query over IPv6. There [20:04.150 --> 20:11.870] was also a presentation this May at ORC, which wasn't us, actually. Now, please excuse the [20:11.870 --> 20:20.110] crayon colors. I am taking directly from their slides. But this is a rather pertinent [20:20.110 --> 20:24.730] presentation. I had said before this was what we found had bypassed all recommendations. [20:24.730 --> 20:28.190] Yeah, this is kind of the weird case because in an earlier slide in this presentation, [20:28.190 --> 20:32.470] they had said drop all fragments, but then here they say, well, the attack's only effective [20:32.470 --> 20:38.010] on IPv4 and kind of directly implied IPv6 is safe. I digress. In any case, this is good [20:38.010 --> 20:43.850] news. There's interested parties and the people who are the major operators of DNS are generally [20:43.850 --> 20:48.930] trying to loose, tie up all the loose ends without any major performance impact. So now [20:48.930 --> 20:52.790] we have to have that little tangent I was talking about before, which might make a little [20:52.790 --> 20:58.510] more sense now. So the sequential nature of IPID is largely why idle scanning exists. [20:58.510 --> 21:02.570] It's what Nmap uses, but as a lot of people here may know, the kind of scan has some requirements [21:02.570 --> 21:09.070] for zombies, namely global counters, and also they have to kind of be idle machines. They [21:09.070 --> 21:14.470] need to act like a 1990s printer, basically. I won't explain what this particular team [21:14.470 --> 21:19.090] found in depth because we really don't have the time, but in a somewhat similar manner [21:19.090 --> 21:23.290] to idle scanning, a university of New Mexico research team developed a way to abuse the [21:23.290 --> 21:29.210] IP fragment cache in Linux machines to basically determine if something had been sent and much [21:29.210 --> 21:34.810] like idle scanning, you could do this to figure out whether or not traffic was being sent [21:34.810 --> 21:40.310] on a link that you can neither see nor control. And it works on fully per destination IPID [21:40.310 --> 21:44.290] counters, which is what Linux had. And you can measure how many ‑‑ and you can really [21:44.290 --> 21:48.090] just do any kind of measurement across the Internet. Needless to say, the Linux folks [21:48.090 --> 21:53.390] didn't appreciate this. And they didn't really want every Linux machine on the Internet [21:53.390 --> 21:57.970] being used as a zombie for an idle scan. So around the same time as this paper being published, [21:58.370 --> 22:03.910] they created some patches. The first that we care about was to directly prevent measuring [22:03.910 --> 22:10.090] communication between two machines. And the second was an optimization to IPID, how IPIDs [22:10.090 --> 22:15.190] were handled. So the first one, I did say was a direct mitigation. Well, it doesn't [22:15.190 --> 22:21.070] actually completely fix it. Because what it's doing is just making it harder. It's [22:21.070 --> 22:28.170] basically incrementing the IPID by a random, but normal, between one and the number of [22:28.170 --> 22:32.290] kernel ticks since the last sent packet. This kind of requires keeping track of the last [22:32.290 --> 22:35.750] kernel tick values as part of per destination counter. And this makes this operation rather [22:35.750 --> 22:40.930] extensive, especially if you have a lot of things to talk to. But it does work. And if [22:40.930 --> 22:46.170] your interest was trying to do a long-term idle scan or a long-term query as to what was [22:46.170 --> 22:49.390] going on between two machines, yeah, this is going to make it real hard for you to do [22:49.390 --> 22:53.010] that. Because if you spend more than one kernel tick in between your polling, you have no [22:53.010 --> 22:57.450] idea what's actually coming back. It's properly random. The second one was an [22:57.450 --> 23:02.910] optimization. Before the network stack was keeping track of all the IPID counters for all [23:02.910 --> 23:06.190] destinations individually and storing them in a binary tree. This caused a lot of [23:06.190 --> 23:11.470] performance issues for servers that talk to a lot of clients, like name servers. And since [23:11.470 --> 23:16.070] every comp sci graduate knows that O of a constant is much better than O of long N, they [23:16.070 --> 23:20.590] made a new way based on hashing and binning. So destination addresses, both IPV4 and IPV6 [23:20.590 --> 23:25.450] are hashed to match it with a bin, which will contain the current IPID counter, which will [23:25.450 --> 23:29.970] then be used on the next thing that gets sent out the port. Now, this does mean that some [23:29.970 --> 23:34.610] destination addresses are going to have to share an IPID counter. So to prevent an outsider [23:34.610 --> 23:38.990] knowing which addresses are sharing a bin, the seed for this hash function, which is doing all [23:38.990 --> 23:43.510] the determination, is secret and determined at boot. Perfect. Especially if you have [23:43.510 --> 23:51.470] enough bins and hash collisions are rare. That's a low number. Now, if you think this is kind [23:51.470 --> 23:56.810] of low, like I think this is kind of low, the researchers at University of New Mexico would [23:56.810 --> 24:00.810] agree with you. And so they, of course, immediately then proceeded to make another idle [24:00.810 --> 24:06.490] scanning using the Linux network stack. So basically the way they do this is they use [24:06.490 --> 24:11.570] IPV6 to legitimately get very large source address spaces. You could use IPV4, but as we [24:11.570 --> 24:15.330] know, that address space is a little bit sparse nowadays. And all these sources, they [24:15.330 --> 24:21.970] query the IPID counter for their IPID address with a fragmented ICMP6 echo request, which [24:21.970 --> 24:28.070] then returns a fragmented response. And they increment the IPID counter for the target by [24:28.070 --> 24:32.950] spoofing a SYNAC to the target and then query again. Basically figuring out the hard way [24:32.950 --> 24:37.810] whether or not the talking and the spoofing they're doing is in the same bin as what [24:37.810 --> 24:42.550] they're able to query on. Their address. And then they just change addresses if it doesn't [24:42.550 --> 24:47.630] appear to line up. Now, why fragmented IPV6 echoes? Well, IPV6 is a little weird because [24:47.630 --> 24:51.710] it doesn't fragment the IPID counter unless the traffic is sent fragmented. And, well, [24:51.710 --> 24:55.900] all of the above requests as an extra stipulation have to arrive within one system tick, one [24:55.900 --> 25:00.040] kernel tick of another to force that random perturbation of one to the number of kernel [25:00.040 --> 25:03.740] ticks to always be one. It's funny, you know, the difference, random number between one [25:03.740 --> 25:09.000] and one is always one. Not the best mitigation. Thankfully for most systems, this timing is [25:09.000 --> 25:15.360] actually pretty low. Ever since Jiffy's were invented, that counter is about 10 milliseconds, [25:15.360 --> 25:22.460] 100 hertz. It could be as low as .66 milliseconds on specialty systems that are running clocks [25:22.460 --> 25:31.300] all the way up to 1,500 hertz. But that has to be a very specifically configured OS. Once [25:31.300 --> 25:39.440] the collision is found, you can basically just flip this triangle. It's nice. And start [25:39.440 --> 25:43.900] doing your idle scan. Basically instead of trying to figure out whether or not you have [25:44.040 --> 25:47.660] a collision with a target, you can start sending stuff off to another machine and see whether [25:47.660 --> 25:52.360] it responds back to this machine that you're doing the querying for. And they called this [25:52.360 --> 26:02.160] not an idle scan. Oh, well. So, there is something that you folks probably have noticed [26:02.160 --> 26:06.620] at this point. This is a lot of knowledge that you can get about the IPIDs and the state [26:06.620 --> 26:13.040] of IPIDs and the IPIDs for communications to other machines. And, well, hold on now. [26:13.040 --> 26:15.740] Why didn't the folks at the University of New Mexico realize that this might have some [26:15.740 --> 26:18.880] other implications? Why didn't they realize that this was going to have a huge implication [26:18.880 --> 26:23.060] on DNS and fragmentation attacks? Well, they were thinking about idle scanning. I don't [26:23.060 --> 26:27.500] blame them. And show of hands, who knew about Hertzberg and Shulman's research before today? [26:29.120 --> 26:36.880] No hands. Yeah, you can't blame them. So we get to talk about something new today. So [26:36.880 --> 26:46.190] basically this attack, which, mind you, that's what I get for pressing the down arrow. So [26:47.350 --> 26:53.470] we start this attack basically the same way as ONUS. And no, for those of you who are [26:53.470 --> 26:58.670] about to ask, I am not going to call this ANIS or actually not an idle scan for various [26:58.670 --> 27:02.870] reasons. But we're going to start by finding collisions just like with ONUS. And instead [27:02.870 --> 27:06.930] of a zombie and a target, we basically have a name server and resolver now. The text is [27:07.030 --> 27:11.650] a little bit small, but if you noticed, we're using IPV4 in there. Well, what if they're [27:11.650 --> 27:15.450] talking over IPV6? What if we need to find collisions on IPV6 addresses like Umbrella [27:15.450 --> 27:22.610] was planning on doing? Well, no problem. We'll make them IPV6 echo frags as well. And [27:22.610 --> 27:27.430] what about getting our address space? The entire point of using IPV6 to do this particular [27:27.430 --> 27:37.670] attack is it's got to be convenient. How convenient is it, Travco? Well, AWS to the rescue. So [27:37.670 --> 27:42.370] even the free tier of AWS VPC, virtual private cloud, you can get some IPV6 address space. [27:42.370 --> 27:47.350] But the real question is, of course, you know, is it big enough? I haven't done extensive [27:47.350 --> 27:52.550] testing, albeit. But I'm going to say that this is probably enough for those folks that [27:52.550 --> 27:58.130] can't count commas as fast as the slide is going to be up. That is 18 and a half quintillion, [27:58.130 --> 28:02.510] give or take a couple dozen quadrillion. Mind you, statistically, it only takes about 10,000 [28:02.510 --> 28:09.090] addresses to get a 99.2% chance of a collision because there's only 2,048 bins. And this is [28:09.090 --> 28:14.350] outright better than trying to do global IP name servers, global IP ID for name servers because [28:14.350 --> 28:20.710] in this scenario, we get protection. We get that added improvement of all the other bits of [28:20.710 --> 28:27.210] binning and if there's a couple of random hosts on the internet, 2,047 of them aren't going to [28:27.210 --> 28:34.190] mess with our IP ID. And also, once we find this collision, we can kind of sit on it. And the [28:34.190 --> 28:39.990] server selection is like literally any remotely recent Linux kernel. If your Linux kernel is [28:39.990 --> 28:43.290] older than 2014, by the way, you should probably patch. There's some stuff that you need to [28:43.290 --> 28:49.150] deal with. And as far as like what our target space looks like now, well, there's something [28:49.150 --> 28:55.170] that exists a lot more than existed in 2008 or 2012 when some of the other attacks were [28:55.170 --> 29:01.210] coming out. And that's these lovely, lovely public resolvers. And they're really trusted. In [29:01.210 --> 29:04.990] fact, as I mentioned before, there's entire Central African nations where all the ISPs are [29:04.990 --> 29:08.710] going through Google DNS. Sure would be a shame if somebody did something to Google DNS. [29:08.830 --> 29:17.010] Yeah. And frankly, don't get me wrong, there's some presuppositions. There's some [29:17.010 --> 29:21.590] difficulty in doing this attack. You need to find the right set of targets. But if you [29:21.590 --> 29:27.710] poison a resolver, you're attacking everybody who's using these. And as far as getting a puppet [29:27.710 --> 29:32.270] downstream, well, you can be the puppet too. You can be both the attack server and the puppet [29:32.270 --> 29:38.770] because they're public resolvers. You just enroll yourself. It's free. And as I kind of [29:38.770 --> 29:44.410] mentioned before, this whole collision finding bit is completely detached from the attack. [29:44.990 --> 29:49.410] Time is on our side as an attacker. And now it's actually really on our side as an [29:49.410 --> 29:56.130] attacker. The hardest part and the most legwork to find this is in the collisions. And [29:56.130 --> 29:59.870] although they could be found in minutes, we're really in no rush. We can probably stay [29:59.870 --> 30:04.270] around for weeks, months or years because that key that is determining the hash doesn't [30:04.270 --> 30:08.510] change until the system reboots. And I don't know if any of you know a lot about name [30:08.510 --> 30:17.170] servers. They're not going to reboot a lot. That's bad for the internet. And we've got [30:17.170 --> 30:22.430] some interesting options as well because we can do a lot of really short duration cache [30:22.430 --> 30:26.230] attacks because we have a very good idea of what the IP ID is and we can very plausibly [30:26.230 --> 30:30.710] do this in the first hit. And we can also accumulate a ton of matches for multiple name [30:30.710 --> 30:36.250] servers, multiple resolvers. Even if Google is running 101 resolvers and we want to poison [30:36.250 --> 30:41.210] 101 name servers, we can just get the collisions all hooked up for that and then just start [30:41.210 --> 30:45.570] poisoning away. And eventually we're going to get poisoned records into every last one [30:45.570 --> 30:51.470] of them if we know what the IP IDs are that we need to send. It's kind of a strange work [30:51.470 --> 30:58.870] around for load balancing. And because we're doing this in one shot, we may not even need [30:59.310 --> 31:03.290] a puppet in the case of non-public resolvers. If you're trying to do this on a corporate [31:03.290 --> 31:08.490] network, maybe you don't even need to have something make a request because there's a [31:08.490 --> 31:13.290] lot of stuff that happens at midnight and patch Tuesday. If there's a cron job or some [31:13.290 --> 31:16.710] automated client that's going to reach up, I don't know if your blue teams are working [31:16.710 --> 31:22.590] midnights, but we can. And maybe the puppet can be completely passive. If we see common [31:22.590 --> 31:27.330] requests when they're being requested, we know what the time to live is on those records [31:27.330 --> 31:33.170] and we can just wait until they go out of cache and have to be requested again by the [31:33.170 --> 31:38.050] resolver. And so we can start actually consider poisoning things that are getting cached every [31:38.050 --> 31:42.790] single time because we can very plausibly do it the first time. And maybe poison isn't [31:42.790 --> 31:46.170] even our purpose. Maybe what we want to do is just DOS the entire world or prevent patch [31:46.170 --> 31:49.310] Tuesday from happening. Which would be very bad if we're an attacker in the middle of [31:49.390 --> 31:54.690] a corporate network and the Windows updates aren't coming down anymore. If we can do poisoning [31:54.690 --> 32:03.370] in one shot, we can really mess up a response in one shot too. So I've said a lot of words [32:03.370 --> 32:10.370] up to this point. What does the actual final attack look like? So basically we have to [32:10.370 --> 32:14.530] pick our targets. And this is a little difficult to do. We can at least figure out what the [32:14.530 --> 32:20.010] resolver is if we're a downstream puppet or we have some kind of way or it's a public [32:20.010 --> 32:24.030] resolver. And we also find some domains. Some domains that are likely to send some large [32:24.030 --> 32:28.450] responses. And we have to find some servers that are actually running Linux. That shouldn't [32:28.450 --> 32:33.870] actually be terribly difficult, but it is an important point. Once we determine the [32:33.870 --> 32:37.130] resolver's public IP address for the request, we can just basically evaluate the domain [32:37.130 --> 32:40.890] responses to see whether or not we can actually poison anything. And then we do our collision [32:40.890 --> 32:44.970] finding, which should be good again until the name server actually finally restarts. And then [32:44.970 --> 32:53.140] we wait. Punctual water drinking. Now, right before we do an attack, we can optionally [32:53.140 --> 32:57.120] trick the name server into lowering the PMTU and forcing fragmentation to exactly the number [32:57.120 --> 33:04.620] we want it to be. Or we could also just not and just request for a non-existent domain on [33:04.620 --> 33:08.880] DefCon.org. There's a lot of domains that are using NSEC and NSEC 3. The responses get [33:08.880 --> 33:12.700] quite large. And then we just query the name server to get the IP ID because we've already [33:12.700 --> 33:19.120] found the collision. And then we do that, yeah, I should say, we do that directly before a [33:19.120 --> 33:24.660] known request is about to be sent. We do the query. And then we basically send 64 smooth [33:24.660 --> 33:29.380] fragments. We could send only one if we're very confident in ourselves. But, I mean, if we're [33:29.380 --> 33:34.380] doing this, we might as well send the full payload that we could possibly send. And we do [33:34.380 --> 33:38.000] that based on the known IP ID as described in fragmentation considered poisonous. And I will [33:38.000 --> 33:41.440] point you to Hertzberg and Shulman's paper as to what you can do from here because it is all [33:41.440 --> 33:48.040] laid out and that paper is nice and old. So, now's a good time to start talking about how do [33:48.040 --> 33:53.980] you actually get around this? What's the fix, Trafco? Well, as I said before, I'm not the [33:53.980 --> 33:58.420] expert. So I'm going to hand it over to Brian who is closer to an expert and he can talk about [33:58.420 --> 33:59.340] some mitigations. [34:00.440 --> 34:10.120] Thanks, Travis. I'm Brian Summers. I work on the resolvers at Cisco. So this is a really [34:10.120 --> 34:16.460] interesting problem. There are lots of parties involved. There's the zone owner, the person who [34:16.460 --> 34:22.520] owns the data. There's the name server. So that's the person that, or that's where the data [34:22.520 --> 34:27.460] lives. Sometimes it's the same as the owner. Sometimes it's a registrar. Sometimes it's a [34:27.460 --> 34:34.140] third party. And then there's the resolver that almost never lives with the data. So the [34:34.140 --> 34:38.540] resolver normally lives closer to the client. And of course, it's the client, the person who [34:38.540 --> 34:42.360] actually wants to look up the address. It's usually an address. It's not always an address [34:42.360 --> 34:50.760] with DNS, but addresses are the most interesting parts. So really what we're actually trying to [34:50.760 --> 34:56.600] avoid here, or what the problem is, is that the attacker is attacking the resolver due to a [34:56.600 --> 35:03.500] bug in the name server. And the name server is holding the data on behalf of the zone owner, [35:03.500 --> 35:08.940] and the lie is getting propagated to the client. So there's a whole ton of people involved here. [35:09.440 --> 35:18.700] And really the attack target is the resolver. So that makes it my problem. IP fragmentation [35:18.700 --> 35:25.400] has been an issue for years, like since Kaminsky first observed these issues. So [35:25.400 --> 35:32.980] our approach has always been, well, that's easy. We drop fragments. DNS has a mechanism built in [35:34.480 --> 35:39.740] where when you actually ask a question of the name server, you can say, and by the way, my [35:39.740 --> 35:46.540] maximum payload size is X. So if you set X to something like 1410 and drop all fragments at [35:46.540 --> 35:52.580] the resolver, well then the name server is going to respond. If they respond with something that's [35:52.580 --> 35:57.960] less than 1410 bytes and it gets fragmented, then we lose it. We don't get the response. [35:59.960 --> 36:05.820] And that's never been a problem because really modern day hardware really does have [36:05.820 --> 36:10.640] packet sizes of at least 1492 or whatever these numbers are. [36:12.320 --> 36:19.400] So that's how we always played it. And then we came to try to support DNSSEC. And DNSSEC RFCs [36:19.400 --> 36:26.600] have lots of requirements and those requirements say that we should deal with packet sizes of [36:26.600 --> 36:31.440] 4K. And that's because DNSSEC payloads are much larger and we don't really want to send [36:31.440 --> 36:35.540] everything over TCP. So that seemed like a kind of sensible requirement. So we had to come up [36:35.540 --> 36:40.220] with a solution to this fragment problem. We wanted to be able to turn on fragments, but not [36:40.220 --> 36:47.640] fall victim to these sorts of attacks. So our first scheme came up with a, as it turns out, [36:47.660 --> 36:57.700] a naïve approach. So our naïve approach was to assume that IP IDs were random because, well, [36:57.700 --> 37:02.760] that's what the RFCs say they are. They're random, right? And of course, IPv4 has a 16-bit [37:02.760 --> 37:08.460] random number. Well, that's easy to attack. And IPv6 has a 32-bit random number. Way, way [37:08.460 --> 37:16.460] harder to attack. IPv6 also uses PMTU to discover what the fragment sizes are. So that's much [37:16.460 --> 37:23.640] more difficult to attack for the attacker as well. So we naïvely assumed that IPv4 was bad, [37:23.640 --> 37:30.940] IPv6 was good, and we implemented something that cleverly marked packets at the firewall. Marked [37:30.940 --> 37:34.780] whether or not they used to be fragments and marked whether or not that first fragment was of [37:34.920 --> 37:42.000] a reasonable size, 1280 in our case. And if stuff arrived at the resolver and it was marked as a [37:42.000 --> 37:49.160] fragment at 1280, then we'd cache all of the data in the first 1280 bytes, say that that's [37:49.160 --> 37:54.120] absolutely good, and we'd cache all of the remaining data as, kind of, I'm not too sure about [37:54.120 --> 37:58.060] this stuff. And if we ever need to use that data, then we'd actually look it up again. And we'd [37:58.060 --> 38:04.460] look it up over either v6 or TCP. That seemed like a great idea until Travis came along and [38:04.460 --> 38:12.810] pointed out that that didn't actually work because these IDs aren't actually random. So what do [38:12.810 --> 38:18.610] we do? We could try to do the same thing for IPv6, but that's actually really, really difficult [38:18.610 --> 38:25.390] because IPv6 fragments are harder to deal with at the firewall there. And in fact, well, actually [38:25.390 --> 38:31.150] DNS already has this ability built in. It's the ability that we used to use of limiting the [38:31.150 --> 38:38.210] payload size and just expecting things to go over TCP. So we did some experiments and really when [38:38.210 --> 38:46.010] you run a, kind of, public facing resolver, we've observed that more or less, slightly less than [38:46.010 --> 38:53.150] .1% of our traffic is TCP traffic. So if you look at all the queries, for every thousand queries, [38:53.150 --> 39:00.990] there's one TCP query and the other 999 are UDP. And in fact, when you turn on DNSSEC and you [39:00.990 --> 39:09.630] start querying all of those big, juicy DNSSEC payloads and you do all of this over UDP, either IPv6 [39:09.630 --> 39:21.190] or IPv4, actually that .1% goes all the way up to almost .5%. So, in fact, the RFCs that say that [39:21.190 --> 39:30.370] this is a requirement to be able to handle large packets in UDP is just not true. So how many [39:30.370 --> 39:39.410] people here have heard of DNS Flag Day? So a handful of people, four or five people. So DNS Flag Day [39:39.410 --> 39:47.310] is a really big deal. It was a really big deal for me anyway, where the DNS community are basically [39:47.310 --> 39:55.090] trying to take some of the awkwardness in DNS, the kind of rule breaking that has been going on for [39:55.090 --> 40:03.970] years in the industry and make it not OK anymore. So there was a DNS Flag Day last year and it was [40:03.970 --> 40:11.050] all about whether or not name servers versus resolvers supported eDNS. So the way resolvers [40:11.050 --> 40:15.750] talk to name servers, they'd say, hey, name server, can you talk eDNS? And it would do this by [40:15.750 --> 40:21.370] supplying some eDNS options. And if it got no response from the name server, it would send another [40:21.370 --> 40:26.570] packet. And if it still didn't get a response, it would try it without eDNS. And if it got a response, [40:26.570 --> 40:30.210] then it would kind of say, OK, this guy doesn't support eDNS and I'm going to continue on. [40:30.310 --> 40:35.410] And there was an awful lot of kind of behavior like that going on. And Flag Day is all about kind of [40:35.410 --> 40:40.830] saying, OK, well, that behavior is not OK anymore. If you don't behave properly, then things just aren't [40:40.830 --> 40:46.010] going to work. So there's going to be another Flag Day in 2020. And this Flag Day is all about [40:46.010 --> 40:54.650] fragmentation. I'm not sure the entire DNS community is convinced, but one of my kind of pushes for this [40:54.650 --> 41:00.710] Flag Day is going to be fragmentation is not OK. All resolvers and all name servers don't do [41:00.710 --> 41:07.310] fragmentation. So resolvers will block fragmentation coming inbound from the name servers and the name [41:07.310 --> 41:13.850] servers will just configure their UDP payloads to be a maximum of something smaller than their MTU. [41:18.240 --> 41:23.320] Measuring this on a resolver, how do you tell whether you're getting poisoned? Well, you can look for lots of echo [41:23.320 --> 41:29.740] responses. You could look for IPv6 echo responses. You could look for IPv4 echo responses. You could graph [41:29.740 --> 41:37.300] them. If you think you're getting poisoned, what do you do about it? Like there's limited use in doing any of [41:37.300 --> 41:42.360] this sort of stuff, because if somebody attacks you, well, you just have bumps in your graph. If you can't do [41:42.360 --> 41:46.720] anything about it, there's no point in worrying about it. You need to worry about it and make it not happen in the [41:46.720 --> 41:58.140] first place. So on the name server side, I mean, the name server guys really have almost the same problem, but in [41:58.140 --> 42:11.160] reverse. I guess, yeah, I mean, from a name server point of view, really what you want to do is limit your [42:11.760 --> 42:21.420] EDNS buffer sizes or your EDNS payload sizes and avoid fragments altogether. You can do some clever things, which [42:21.420 --> 42:33.440] aren't, as it turns out, too clever. So with the DNS IP ID 2048 bucket setup, that's all actually hashed using [42:33.440 --> 42:39.580] SIP hash. If you reboot your server, you can receive that SIP hash and you can basically give everybody new slots in [42:39.580 --> 42:45.060] the array. But, well, how long does it take to reboot your server? And even if you did introduce a way of kind of [42:45.060 --> 42:51.340] saying, OK, we seed now, really, what are you going to do? Run that every second? Well, why don't you just choose [42:51.340 --> 42:59.320] random numbers in the first place? So again, yeah, the answer for name servers is to do the same. Don't send [42:59.320 --> 43:08.840] fragments. And again, you can you can try to avoid them guessing things at the name server. You could tar pit [43:08.840 --> 43:16.180] ICOMPS, but really they could do exactly the same attack over DNS. And you'll never be able to notice that because [43:16.180 --> 43:21.200] it'll be a drop in the ocean in terms of the number of queries that you're actually getting. So like even if you [43:21.200 --> 43:28.920] graph that, you're not even going to see it. And of course, you can go a little bit more hardcore and you can [43:28.920 --> 43:35.220] rebuild your kernel. You can make this IBI dense size, which is set to 2048. You can make that a bigger number or [43:35.220 --> 43:43.320] you could just change the code and actually make a bigger random number. And for domains, for the domain owner, [43:43.320 --> 43:48.520] like if you're a domain owner and you don't really know what your name server is going to do and you don't really [43:48.520 --> 43:55.500] know what the resolvers in between are going to do, well, really your only hope is to use DNSSEC. And the big [43:55.500 --> 44:02.880] flaw in DNSSEC, as Travis said, is delegations. Delegations are fine if you're delegating to another signed [44:02.880 --> 44:08.180] zone. If you're delegating to an unsigned zone, then actually the unsigned zone is very vulnerable because your [44:08.180 --> 44:16.400] delegations aren't secured. And remember that DNSSEC, all that tells you is whether or not something is good or [44:16.400 --> 44:23.160] not. It doesn't stop denial of services. So it's not the answer to everything, but it's the answer to most things [44:23.160 --> 44:35.080] these days. And yeah, of course, if you're using DNSSEC, make sure that you've got reasonable sized keys. Don't go [44:35.080 --> 44:36.760] for the lower size keys. [44:36.760 --> 44:40.900] Yeah, don't go for the lower size keys. And if VeriSign tells you that a key that's going to be up on the internet [44:40.900 --> 44:48.320] for 120 days, a 30-day pre-period, then an active period of 90 days, know that RSAs do get broken. And if your key [44:48.320 --> 44:53.600] gets broken, maybe choose a bigger key pair. Just an idea. [44:54.640 --> 45:03.100] And I guess one of the more exciting things about DNSSEC that's coming out recently, lately, is that it's moving [45:03.100 --> 45:09.980] towards elliptic curve technology. And elliptic curve uses way smaller hash sizes. So the signatures are, well, [45:09.980 --> 45:16.380] not hash sizes, but signature sizes. So as a result, the signatures are smaller, and you're less likely to actually [45:16.380 --> 45:22.720] bump into fragmentation problems anyway. And yeah, panic. [45:25.800 --> 45:30.780] Maybe panic a little. All of the resources are up here if you need to screenshot this. Obviously, the files are [45:30.780 --> 45:36.440] probably going to be uploaded somewhere on the DEF CON Media Server at a later point. And I've been Travis, [45:36.440 --> 45:39.000] this has been Brian, and this has been the talk. [45:46.600 --> 45:48.300] I don't know if there are any questions. [46:18.950 --> 46:24.650] So the question was regarding IPID and whether or not we should have released a CVE for it and whether or not [46:24.650 --> 46:28.950] this has other implications. Oh, yeah, this totally has other implications. This is actually rather [46:28.950 --> 46:34.830] terrifying for certain things like online gaming, which are using a lot of UDP. If you can get in the [46:34.830 --> 46:40.230] second fragment of these things, and they're doing all their off in the front, it's bad news. We could [46:40.230 --> 46:45.870] release a CVE, but what's the target for the CVE? The Internet? I would have loved to send that to [46:45.870 --> 46:50.610] Mitch, but I have a sneaking suspicion it's probably not going to be accepted. But I do appreciate the [46:50.610 --> 46:53.770] question. It seems like a bit of a target, yeah. [46:56.570 --> 47:04.630] I guess it's worth mentioning as well for IPID that the original RFCs for IP talked about caching [47:04.630 --> 47:12.010] fragments for 30 seconds against being able to marry them up with the original and deliver the packet. [47:12.010 --> 47:18.750] That's clearly just not a good idea in this day and age. In this day and age, caching them for, say, at [47:18.750 --> 47:25.790] most 50 milliseconds would probably be way more appropriate. But I haven't seen any RFCs that [47:25.790 --> 47:31.210] suggest that sort of behavior. I mean, this sort of thing could be mitigated a lot more, certainly raw [47:31.210 --> 47:38.570] IPID attacks. Sorry, say again? [47:43.770 --> 47:50.090] Yes, absolutely. So you cache it for a smaller amount of time and just fling them away way more eagerly [47:50.090 --> 47:55.790] and it will stop lots of second fragment attacks where people are dropping multiple second [47:55.790 --> 48:09.050] fragments, hoping that they'll marry up on the IPID. OK, thank you very much.