1 00:00:00,580 --> 00:00:02,920 Good afternoon, and thank you for joining us. 2 00:00:03,180 --> 00:00:07,320 We are excited to be here taking part in DEF CON China 1.0. 3 00:00:07,940 --> 00:00:11,480 This talk is IPv666, Address of the Beast. 4 00:00:11,820 --> 00:00:13,300 I am Mark, and this is Chris. 5 00:00:13,840 --> 00:00:15,160 Hey, what's going on, everybody? 6 00:00:15,380 --> 00:00:16,980 My name is Chris Grayson. 7 00:00:17,120 --> 00:00:19,020 I'm originally from Atlanta, Georgia. 8 00:00:19,320 --> 00:00:22,000 I went to Georgia Tech a few times. 9 00:00:22,100 --> 00:00:23,860 I used to be the head of the Georgia Tech Hacking Club. 10 00:00:24,060 --> 00:00:25,840 I've been the head of the red team at Snapchat, 11 00:00:26,000 --> 00:00:26,780 a research scientist, 12 00:00:26,880 --> 00:00:29,720 and presently I'm a security engineer at Bird Rides. 13 00:00:30,260 --> 00:00:31,720 And my name is Mark Newlin. 14 00:00:31,840 --> 00:00:33,000 I am a self-taught hacker. 15 00:00:33,180 --> 00:00:36,060 My security background is largely in the wireless space. 16 00:00:36,280 --> 00:00:37,900 I've done a lot of work doing reverse engineering 17 00:00:37,900 --> 00:00:39,400 using software-defined radios, 18 00:00:39,500 --> 00:00:42,600 and at this point I've discovered and published 19 00:00:42,600 --> 00:00:44,840 wirelessly exploitable vulnerabilities in devices 20 00:00:44,840 --> 00:00:47,300 from somewhere north of 25 vendors. 21 00:00:48,020 --> 00:00:50,700 In my free time, I like to compete in DARPA challenges. 22 00:00:50,860 --> 00:00:52,840 I've placed top three in multiple of them. 23 00:00:53,200 --> 00:00:56,720 I am a prior member of the red team at Snapchat, 24 00:00:56,820 --> 00:00:59,860 and I currently work as a security engineer at Bird Rides. 25 00:01:00,340 --> 00:01:02,420 And so what are we going to be talking about today? 26 00:01:02,940 --> 00:01:05,220 And the answer, in short, is the future. 27 00:01:05,420 --> 00:01:06,520 And if you didn't know this, 28 00:01:06,660 --> 00:01:08,200 Chris and I recently took a trip to the future, 29 00:01:08,340 --> 00:01:11,040 and what we found there is IPv6-connected devices 30 00:01:11,040 --> 00:01:12,900 as far as the eye can see. 31 00:01:13,300 --> 00:01:13,740 Everywhere. 32 00:01:14,340 --> 00:01:17,340 And so we decided to build out an open-source tool set 33 00:01:17,340 --> 00:01:19,780 for discovering these IPv6-connected devices 34 00:01:19,780 --> 00:01:20,920 on the open Internet. 35 00:01:21,260 --> 00:01:22,860 And we've been working on this project 36 00:01:22,860 --> 00:01:24,680 for about a year and a half now, 37 00:01:24,840 --> 00:01:28,060 and it's been quite the learning curve for us. 38 00:01:28,120 --> 00:01:28,920 We've made a lot of mistakes. 39 00:01:28,920 --> 00:01:30,560 We've learned a lot of lessons 40 00:01:30,560 --> 00:01:33,640 and really grown our skill set and knowledge in the space. 41 00:01:33,820 --> 00:01:36,020 And so this talk is a story of how we got 42 00:01:36,020 --> 00:01:37,700 from where we started a year and a half ago 43 00:01:37,700 --> 00:01:39,860 to where we are now with this pretty neat open-source tool. 44 00:01:40,200 --> 00:01:42,040 And this is a fairly technical talk, 45 00:01:42,220 --> 00:01:45,120 and so in the interest of translation clarity and time, 46 00:01:45,320 --> 00:01:47,920 we are glossing over some of the deep technical specifics. 47 00:01:48,160 --> 00:01:49,600 All this data is still in the slides, 48 00:01:49,760 --> 00:01:52,500 and if there are any questions you have about our talk afterward, 49 00:01:52,680 --> 00:01:54,100 we are happy to answer any questions 50 00:01:54,100 --> 00:01:55,440 and fill in any details. 51 00:01:55,780 --> 00:01:58,000 And I also want to point out that neither Chris or I 52 00:01:58,000 --> 00:01:58,800 are network engineers, 53 00:01:58,920 --> 00:02:00,700 and we've been learning about IPv6 54 00:02:00,700 --> 00:02:01,920 through the course of this research. 55 00:02:02,140 --> 00:02:03,640 And we probably got stuff wrong. 56 00:02:03,860 --> 00:02:05,180 When we did, please let us know. 57 00:02:05,260 --> 00:02:07,100 We are here to learn just as much as we are 58 00:02:07,100 --> 00:02:08,060 to share our experiences. 59 00:02:08,700 --> 00:02:11,260 So we're going to start with some background on IPv6 60 00:02:11,260 --> 00:02:13,100 and our motivations for doing this research. 61 00:02:13,300 --> 00:02:15,040 We're then going to look at the difficulties 62 00:02:15,040 --> 00:02:17,160 of scanning the IPv6 address space. 63 00:02:17,480 --> 00:02:19,380 We're going to look at some techniques we've used 64 00:02:19,380 --> 00:02:20,640 with varying degrees of success 65 00:02:20,640 --> 00:02:23,820 for discovering and predicting new IPv6-connected addresses. 66 00:02:24,160 --> 00:02:26,480 We are going to look at the latest iterations 67 00:02:26,480 --> 00:02:27,780 for our prediction algorithm. 68 00:02:28,120 --> 00:02:28,900 We're then going to look at the latest iterations 69 00:02:28,920 --> 00:02:32,600 of our software where we've implemented functionality 70 00:02:32,600 --> 00:02:36,460 to actually crowdsource a public global data set 71 00:02:36,460 --> 00:02:37,340 of IPv6 addresses. 72 00:02:37,660 --> 00:02:39,980 We'll take a look at the results of our scanning 73 00:02:39,980 --> 00:02:41,060 and some port scan results. 74 00:02:41,360 --> 00:02:43,040 We'll then look at the tool we built, 75 00:02:43,140 --> 00:02:45,880 which is IPv666, and then we'll have our conclusion 76 00:02:45,880 --> 00:02:47,840 and hopefully a few minutes for Q&A. 77 00:02:48,640 --> 00:02:51,560 So for a bit of background, this here is a chart 78 00:02:51,560 --> 00:02:54,180 of the percentage of users who have connected 79 00:02:54,180 --> 00:02:56,360 to Google using IPv6. 80 00:02:56,560 --> 00:02:58,620 And this is over a time span of 10 years, 81 00:02:58,920 --> 00:03:00,460 so on the far left, we have 2009. 82 00:03:00,760 --> 00:03:02,300 On the far right, we have 2019. 83 00:03:02,740 --> 00:03:04,140 And we can see that a decade ago, 84 00:03:04,360 --> 00:03:07,020 nearly nobody was connected to Google over IPv6. 85 00:03:07,260 --> 00:03:09,540 This has grown over time, and now we're approaching 86 00:03:09,540 --> 00:03:12,500 one third of Google traffic is happening over IPv6. 87 00:03:12,740 --> 00:03:14,360 And this is just a single internet company, 88 00:03:14,580 --> 00:03:16,200 but it's representative of the fact 89 00:03:16,200 --> 00:03:18,400 that IPv6 is growing in adoption, 90 00:03:18,740 --> 00:03:21,340 and as security practitioners, we are really needing 91 00:03:21,340 --> 00:03:24,000 to spend more time learning about the security of IPv6. 92 00:03:24,780 --> 00:03:26,500 So we got interested in this research 93 00:03:26,500 --> 00:03:28,820 as an offshoot of some other work we did 94 00:03:28,920 --> 00:03:29,460 a couple of years ago. 95 00:03:29,740 --> 00:03:33,380 We discovered a number, in fact, 26 distinct vulnerabilities 96 00:03:33,760 --> 00:03:36,000 in Comcast set-top boxes and cable modems 97 00:03:36,360 --> 00:03:38,700 with our friend Logan Lam, and we presented this research 98 00:03:38,700 --> 00:03:39,640 at DEF CON 25. 99 00:03:40,140 --> 00:03:42,560 And one of the big takeaways is the most severe 100 00:03:42,560 --> 00:03:45,340 vulnerabilities we found could only be exploited 101 00:03:45,340 --> 00:03:48,720 over IPv6, and to exploit them, we had to have knowledge 102 00:03:48,720 --> 00:03:50,560 of the target device's IPv6 address. 103 00:03:50,820 --> 00:03:52,680 And this was the first time that we had this hint 104 00:03:52,680 --> 00:03:54,880 that, hey, there's something interesting about IPv6 105 00:03:54,880 --> 00:03:57,160 and security value of being able to discover 106 00:03:57,160 --> 00:03:58,320 these IPv6 addresses. 107 00:03:58,920 --> 00:04:00,900 And I'll illustrate this with one of our favorite 108 00:04:00,900 --> 00:04:02,920 vulnerabilities, which is a Send2TV exploit. 109 00:04:03,220 --> 00:04:04,920 So if you are a customer of Comcast, 110 00:04:05,140 --> 00:04:08,280 you have a web admin portal on your modem, 111 00:04:08,280 --> 00:04:09,960 which you can access on your local network. 112 00:04:10,220 --> 00:04:12,180 There is a separate web admin portal, 113 00:04:12,320 --> 00:04:14,940 which Comcast can access over the internet, 114 00:04:15,080 --> 00:04:18,040 but through a specific IPv6 address on the modem, 115 00:04:18,060 --> 00:04:20,520 and only if the request is coming from a protected 116 00:04:20,520 --> 00:04:21,680 Comcast network segment. 117 00:04:22,020 --> 00:04:23,560 And in addition to looking at modems, 118 00:04:23,600 --> 00:04:25,120 we looked at the Comcast set-top boxes, 119 00:04:25,340 --> 00:04:28,000 and there is a service called Xfinity Send2TV. 120 00:04:28,000 --> 00:04:30,980 And this service allows you to sign into the Comcast website, 121 00:04:31,300 --> 00:04:33,700 put in a URL, and have this URL loaded 122 00:04:33,700 --> 00:04:35,160 in a web browser on your TV. 123 00:04:35,560 --> 00:04:38,660 What we discovered is that these set-top boxes actually 124 00:04:38,660 --> 00:04:41,140 exist in the same protected Comcast network segment. 125 00:04:41,380 --> 00:04:43,980 So this meant that we could take the IPv6 address 126 00:04:43,980 --> 00:04:46,680 of any customer's modem, put it into the service, 127 00:04:46,900 --> 00:04:50,640 and load up their web admin panel for their modem on our TV 128 00:04:50,930 --> 00:04:52,380 and sign in with hard-coded credentials. 129 00:04:52,720 --> 00:04:55,540 So we could actually remotely administer and configure 130 00:04:55,540 --> 00:04:57,960 any customer's modem, provided that we 131 00:04:58,000 --> 00:05:00,160 knew the IPv6 address of their modem. 132 00:05:00,340 --> 00:05:02,260 And this got us really intrigued with this problem 133 00:05:02,260 --> 00:05:05,140 of doing IPv6 address discovery and just learning more 134 00:05:05,140 --> 00:05:06,820 about IPv6 security in general. 135 00:05:08,640 --> 00:05:10,540 And so we do this initial research. 136 00:05:10,740 --> 00:05:11,540 It's a lot of fun. 137 00:05:11,660 --> 00:05:13,300 Our research is up on GitHub, if anybody 138 00:05:13,300 --> 00:05:14,480 would like to take a look. 139 00:05:14,840 --> 00:05:17,520 But we start thinking, like, huh, IPv6 addresses, 140 00:05:17,740 --> 00:05:20,280 they seem to be pretty integral to these vulnerabilities 141 00:05:20,280 --> 00:05:21,000 that we're finding. 142 00:05:21,300 --> 00:05:22,960 Let's dig in a little bit more. 143 00:05:23,160 --> 00:05:27,640 So we did some cursory research around IPv6. 144 00:05:28,000 --> 00:05:30,040 And a number of things kind of caught our eye 145 00:05:30,410 --> 00:05:33,620 as things that could impact security posture over IPv6 146 00:05:33,620 --> 00:05:34,460 versus IPv4. 147 00:05:34,760 --> 00:05:36,900 The first of this is something called 148 00:05:36,900 --> 00:05:39,860 Slack, which is the stateless address automatic configuration 149 00:05:39,860 --> 00:05:40,480 protocol. 150 00:05:40,980 --> 00:05:45,560 In IPv4, typically you need a DHCP server or a dynamic host 151 00:05:45,560 --> 00:05:48,000 configuration protocol server to give you 152 00:05:48,000 --> 00:05:50,700 an IP address that then enables you to talk over layer 3. 153 00:05:51,580 --> 00:05:54,140 This is a bit of a problem, a bit of an architectural mishap 154 00:05:54,630 --> 00:05:55,740 from the beginning of the internet. 155 00:05:55,900 --> 00:05:57,760 And so we kind of got to this point 156 00:05:58,000 --> 00:05:59,560 that we shouldn't really have something like that. 157 00:05:59,740 --> 00:06:04,040 So in IPv6, you are able to actually provision an IP 158 00:06:04,040 --> 00:06:04,940 address for yourself. 159 00:06:05,240 --> 00:06:07,940 So in order for you to have an IP address 160 00:06:07,940 --> 00:06:09,280 that you can start communicating with, 161 00:06:09,560 --> 00:06:12,480 you no longer have a dependency on a DHCP server, 162 00:06:12,700 --> 00:06:15,080 just that your networking equipment and host operating 163 00:06:15,080 --> 00:06:16,420 system can support it. 164 00:06:16,640 --> 00:06:18,740 And so that's kind of further complicated 165 00:06:18,740 --> 00:06:21,300 by the fact that all modern operating systems 166 00:06:21,300 --> 00:06:26,420 and modern networking equipment both support and prefer IPv6. 167 00:06:26,620 --> 00:06:27,540 So we're talking. 168 00:06:27,540 --> 00:06:30,660 Linux, OSX, Windows, and then pretty much 169 00:06:30,660 --> 00:06:33,920 any modern consumer gateway or consumer premise equipment 170 00:06:34,220 --> 00:06:36,480 is going to support IPv6 out of the box. 171 00:06:37,260 --> 00:06:39,800 And you'll find in a few slides when 172 00:06:39,800 --> 00:06:42,480 we're talking more about it that, really, if your device 173 00:06:42,480 --> 00:06:45,220 has the ability to establish an IPv6 connection 174 00:06:45,220 --> 00:06:49,000 to a remote host, it's going to prefer that over IPv4. 175 00:06:50,480 --> 00:06:53,380 Another big change is that there's no such thing 176 00:06:53,380 --> 00:06:56,060 as NAT by default in IPv6. 177 00:06:56,300 --> 00:06:57,100 So you know. 178 00:06:57,100 --> 00:06:57,680 You go home. 179 00:06:57,720 --> 00:06:59,580 You connect to your home Wi-Fi. 180 00:06:59,740 --> 00:07:01,620 And the main reason that nobody is 181 00:07:01,620 --> 00:07:04,200 able to route traffic to your device at that point 182 00:07:04,200 --> 00:07:06,280 is because you're behind NAT. 183 00:07:06,460 --> 00:07:10,000 You have a 10 dot star address or a 192.168 star address. 184 00:07:10,500 --> 00:07:12,220 You're in this private network space. 185 00:07:12,600 --> 00:07:15,580 So in IPv6, this is no longer the default. 186 00:07:15,820 --> 00:07:18,560 There's still NAT by definition, but it's 187 00:07:18,560 --> 00:07:20,320 no longer what you're going to get out of the box. 188 00:07:20,480 --> 00:07:22,540 And it's really kind of discouraged to be used. 189 00:07:23,020 --> 00:07:26,400 And so when we were first starting this research, 190 00:07:27,100 --> 00:07:29,080 Mark was sitting at home at his apartment. 191 00:07:29,240 --> 00:07:30,520 I was sitting at home at mine. 192 00:07:30,680 --> 00:07:34,440 And he was able to ping the Chromecast on my home network 193 00:07:34,860 --> 00:07:35,540 from his apartment. 194 00:07:35,760 --> 00:07:37,360 And that was kind of surprising to me. 195 00:07:39,000 --> 00:07:41,920 So another thing, let's say that you have thought 196 00:07:41,920 --> 00:07:43,080 about IPv6 before. 197 00:07:43,480 --> 00:07:45,600 And you have a host that you want to make sure 198 00:07:45,600 --> 00:07:47,200 is sufficiently protected. 199 00:07:47,620 --> 00:07:49,020 And so you're like, I want to make sure 200 00:07:49,020 --> 00:07:51,540 that everybody trying to talk to me is firewalled off. 201 00:07:51,940 --> 00:07:54,240 And you say, OK, let me look at my iptables rules, 202 00:07:54,400 --> 00:07:56,900 iptables dash L. Sure enough, your input 203 00:07:57,100 --> 00:07:58,140 chain is dash J reject. 204 00:07:58,320 --> 00:07:59,440 Everything is just getting dropped. 205 00:07:59,880 --> 00:08:02,360 Well, it turns out that iptables has nothing 206 00:08:02,360 --> 00:08:03,680 to do with IPv6. 207 00:08:04,320 --> 00:08:08,740 iptables is just IPv4, whereas iptables is the utility 208 00:08:08,740 --> 00:08:11,500 that you would want to configure your IPv6 firewall rules. 209 00:08:11,820 --> 00:08:14,480 So it kind of leaves us scratching our heads thinking, 210 00:08:14,520 --> 00:08:17,360 like, how many people think that they have sufficiently 211 00:08:17,360 --> 00:08:20,280 protected their hosts when, in fact, they don't actually 212 00:08:20,280 --> 00:08:21,980 have any IPv6 firewall rules? 213 00:08:23,940 --> 00:08:27,080 So as somebody that has a very, very 214 00:08:27,100 --> 00:08:28,460 fairly significant red teaming background, 215 00:08:28,720 --> 00:08:31,740 my experience with ICMP, the Internet Control Message 216 00:08:31,740 --> 00:08:34,620 Protocol, is like, it's used for ping scanning. 217 00:08:34,800 --> 00:08:36,100 That's the main thing I'm using it for. 218 00:08:36,200 --> 00:08:37,220 We got tracer out, whatever. 219 00:08:37,740 --> 00:08:40,340 But for something that's called the Internet Control Message 220 00:08:40,340 --> 00:08:43,560 Protocol, it seems like it's not all that important. 221 00:08:44,100 --> 00:08:46,220 In IPv6, that's no longer the case. 222 00:08:46,480 --> 00:08:49,780 So in IPv4, you have ARP, the address resolution protocol. 223 00:08:50,080 --> 00:08:51,960 It's how you map layer two addresses 224 00:08:51,960 --> 00:08:53,040 to layer three addresses. 225 00:08:53,300 --> 00:08:55,740 It enables you to go up the stack in the OSI model 226 00:08:55,740 --> 00:08:56,900 and actually start speaking over 227 00:08:56,900 --> 00:08:57,360 your network. 228 00:08:57,500 --> 00:09:00,980 In IPv6, that is replaced with the neighbor discovery 229 00:09:00,980 --> 00:09:03,160 protocol that does the exact same thing. 230 00:09:03,340 --> 00:09:05,740 But the neighbor discovery protocol is actually a subset 231 00:09:06,080 --> 00:09:07,280 of ICMPv6. 232 00:09:07,620 --> 00:09:09,640 So whereas your networks might work fine 233 00:09:09,640 --> 00:09:13,500 if you block ICMP everywhere, or you just shut off ICMP, 234 00:09:13,720 --> 00:09:17,200 with ICMPv6, that's not going to be the case, 235 00:09:17,320 --> 00:09:20,300 because you're required to allow it in order for you 236 00:09:20,300 --> 00:09:21,740 to actually go up the OSI model. 237 00:09:22,940 --> 00:09:26,560 And then lastly, broadcast is no longer 238 00:09:26,560 --> 00:09:28,220 a thing in IPv6. 239 00:09:28,480 --> 00:09:32,260 So in IPv4, it's used for a number of different protocols. 240 00:09:32,500 --> 00:09:35,260 And in IPv4, there's this thing known as multicast, 241 00:09:35,480 --> 00:09:37,880 which you can basically send packets 242 00:09:37,880 --> 00:09:42,140 to an address that defines the distance 243 00:09:42,140 --> 00:09:43,920 that you want the message to be propagated 244 00:09:43,920 --> 00:09:45,740 and the hosts that you would like to receive it. 245 00:09:46,180 --> 00:09:49,800 But in IPv4, this wasn't largely supported or used 246 00:09:50,080 --> 00:09:50,740 or implemented. 247 00:09:51,480 --> 00:09:53,780 So it really wasn't something that you saw anywhere. 248 00:09:54,040 --> 00:09:56,540 Well, IPv6, out of the box, it's not. 249 00:09:56,540 --> 00:09:58,060 It requires this to be to spec. 250 00:09:58,380 --> 00:10:01,120 So your networking equipment and your host operating system 251 00:10:01,440 --> 00:10:03,960 is going to allow you to use multicast 252 00:10:03,960 --> 00:10:06,720 and take a single packet and route it to, potentially, 253 00:10:06,920 --> 00:10:08,260 a large number of hosts. 254 00:10:08,640 --> 00:10:11,700 And so we read up on all of these things, 255 00:10:11,780 --> 00:10:14,600 and we're like, OK, this sounds like it might be problematic. 256 00:10:15,240 --> 00:10:17,020 We should probably look into it. 257 00:10:17,160 --> 00:10:20,100 And then we immediately run into the problem 258 00:10:20,100 --> 00:10:22,660 of address discovery, which is the substance 259 00:10:22,660 --> 00:10:23,560 of the rest of this talk. 260 00:10:24,280 --> 00:10:26,240 And so as Chris explained, in order 261 00:10:26,240 --> 00:10:29,560 to test our hypotheses that the security posture of IPv6 262 00:10:29,560 --> 00:10:32,140 is potentially worse than the security posture of IPv4, 263 00:10:32,320 --> 00:10:35,540 we need to discover a corpus of addresses to test this against. 264 00:10:35,880 --> 00:10:38,340 And we quickly run into this problem of scale. 265 00:10:39,340 --> 00:10:41,880 With IPv4, we have a 32-bit address base, 266 00:10:42,060 --> 00:10:44,580 which gives us just shy of 4.3 billion addresses. 267 00:10:44,920 --> 00:10:47,540 And this is a lot of addresses, but it's perfectly conceivable 268 00:10:47,540 --> 00:10:51,380 for a single host to do a port scan across one TCP port 269 00:10:51,380 --> 00:10:54,160 on the entire IPv4 address base in a matter of hours. 270 00:10:54,360 --> 00:10:55,820 So while it's a large number of addresses, 271 00:10:55,820 --> 00:10:57,960 we can just brute force the space and do our research 272 00:10:57,960 --> 00:10:58,360 that way. 273 00:10:58,520 --> 00:11:02,840 With IPv6, we grow to a 128-bit address base. 274 00:11:03,100 --> 00:11:04,620 And this number on the bottom of the slide 275 00:11:04,620 --> 00:11:06,900 is the total number of possible IPv6 addresses. 276 00:11:07,220 --> 00:11:09,060 And I have no idea how to actually pronounce 277 00:11:09,060 --> 00:11:09,500 this number. 278 00:11:09,620 --> 00:11:12,900 It has 13 commas, and it is far too many addresses for us 279 00:11:12,900 --> 00:11:14,060 to ever actually brute force. 280 00:11:14,420 --> 00:11:16,500 And so to try and address this, we 281 00:11:16,500 --> 00:11:18,780 have to look at this problem with PSLAC. 282 00:11:18,940 --> 00:11:22,360 So PSLAC is an extension of the stateless address 283 00:11:22,360 --> 00:11:23,720 auto-configuration protocol. 284 00:11:24,160 --> 00:11:25,800 So with SLAC, this is an extension 285 00:11:25,820 --> 00:11:28,880 And this is an algorithm which takes in your MAC address 286 00:11:28,880 --> 00:11:32,600 of your network interface, as well as the network bits 287 00:11:32,600 --> 00:11:34,860 of the network you're connected to from your IPv6 address, 288 00:11:35,040 --> 00:11:36,480 and generates an address for you. 289 00:11:36,620 --> 00:11:38,540 So with an IPv6 address, we can think of it 290 00:11:38,540 --> 00:11:39,780 as structured in two parts. 291 00:11:39,900 --> 00:11:43,320 We have the network bits, which are commonly the lower 64 bits 292 00:11:43,320 --> 00:11:43,880 of the address. 293 00:11:44,080 --> 00:11:46,000 And this represents the network that your device 294 00:11:46,000 --> 00:11:47,060 is connected through. 295 00:11:47,300 --> 00:11:48,620 Then we have the host bits, which 296 00:11:48,620 --> 00:11:51,300 are commonly the upper 64 bits of the address, which 297 00:11:51,300 --> 00:11:54,540 represent the device identifier of the device that you're 298 00:11:55,820 --> 00:11:55,860 connected to. 299 00:11:55,860 --> 00:11:56,980 So with PSLAC, this is functionally 300 00:11:56,980 --> 00:11:59,980 a transform between the MAC address of your network 301 00:11:59,980 --> 00:12:01,600 interface and these host bits. 302 00:12:01,780 --> 00:12:03,820 And this represents a potential privacy concern, 303 00:12:04,000 --> 00:12:05,200 because even if you are connected 304 00:12:05,200 --> 00:12:08,040 to multiple networks, such as first at home, then at work, 305 00:12:08,100 --> 00:12:10,780 then a coffee shop, the network bits are going to change. 306 00:12:10,940 --> 00:12:13,040 But the host bits, because they're based on your MAC 307 00:12:13,040 --> 00:12:14,660 address, are going to remain the same. 308 00:12:14,900 --> 00:12:17,340 So if you visit a website from multiple different locations 309 00:12:17,340 --> 00:12:19,840 with a SLAC-generated IPv6 address, 310 00:12:20,000 --> 00:12:21,740 that website can determine that it 311 00:12:21,740 --> 00:12:23,640 was the same device that connected from these multiple 312 00:12:23,640 --> 00:12:23,900 locations. 313 00:12:24,400 --> 00:12:26,860 So PSLAC introduces pseudo-random entropy 314 00:12:26,860 --> 00:12:29,340 into the SLAC algorithm and allows 315 00:12:29,340 --> 00:12:32,960 you to have a distinct set of host bits for each connection 316 00:12:32,960 --> 00:12:33,440 that you make. 317 00:12:33,600 --> 00:12:35,120 And this is great from a privacy standpoint, 318 00:12:35,260 --> 00:12:37,560 because you can no longer track a device in the same way. 319 00:12:37,760 --> 00:12:41,000 But it's bad from the address discovery and modeling 320 00:12:41,000 --> 00:12:43,140 standpoint, because with this high amount of entropy, 321 00:12:43,380 --> 00:12:46,320 we don't have any clear ways to model the address generation. 322 00:12:47,400 --> 00:12:49,920 And so we can actually break this problem down into two parts. 323 00:12:50,080 --> 00:12:52,940 We have first the problem of identifying the high entropy 324 00:12:52,940 --> 00:12:55,380 PSLAC hosts, and then the other problem 325 00:12:55,380 --> 00:12:58,540 of identifying the low entropy non-PSLAC hosts. 326 00:12:59,480 --> 00:13:01,580 And so to address this, we are trying 327 00:13:01,580 --> 00:13:04,440 to do some honeypotting to identify these PSLAC hosts. 328 00:13:04,700 --> 00:13:06,640 And the concept is that instead of trying 329 00:13:06,640 --> 00:13:09,160 to predict these addresses and make outgoing connections 330 00:13:09,160 --> 00:13:12,600 to them, we set up web services and network services 331 00:13:12,990 --> 00:13:15,640 and use some tricks to get these devices to connect to us. 332 00:13:15,960 --> 00:13:18,020 So because the search space is too big, again, 333 00:13:18,100 --> 00:13:19,640 we need to have these devices connect to us. 334 00:13:19,780 --> 00:13:22,920 We set up a server with a DNS server, SMTP server, and a IPv6 server. 335 00:13:22,920 --> 00:13:24,900 And we use some different techniques 336 00:13:24,900 --> 00:13:26,740 to drive traffic to these network services. 337 00:13:27,020 --> 00:13:29,300 So first, we set up a honeypot DNS bind server. 338 00:13:29,540 --> 00:13:32,360 And when we first did this, we didn't really 339 00:13:32,360 --> 00:13:34,660 understand IPv6 and all its minutiae. 340 00:13:34,760 --> 00:13:37,700 And we thought that we would need to funnel traffic that 341 00:13:37,700 --> 00:13:40,240 was connecting over IPv4 to IPv6. 342 00:13:40,440 --> 00:13:42,600 So we did some fancy stuff with the DNS records. 343 00:13:42,860 --> 00:13:44,980 And in hindsight, this actually was not necessary at all, 344 00:13:45,060 --> 00:13:47,680 because what we learned is that on modern operating systems, 345 00:13:48,100 --> 00:13:51,080 they will actually prefer IPv6 when it's available. 346 00:13:51,360 --> 00:13:52,900 So in the end, we just had to do 347 00:13:52,920 --> 00:13:54,600 the same thing with everybody who could connect over IPv6, 348 00:13:54,640 --> 00:13:56,300 connecting directly over IPv6. 349 00:13:56,540 --> 00:13:59,580 So here we have a plot of the number of DNS requests 350 00:13:59,580 --> 00:14:02,340 we've received over time on this honeypot DNS server. 351 00:14:02,520 --> 00:14:04,460 And we can see we have a number of spikes here. 352 00:14:04,560 --> 00:14:07,340 And these spikes are where we paid for traffic from ad 353 00:14:07,340 --> 00:14:09,280 campaigns from an ad network called Pop Ads. 354 00:14:09,440 --> 00:14:11,800 And Pop Ads is a service where you give them money, 355 00:14:11,840 --> 00:14:13,440 and then they drive traffic to your website. 356 00:14:13,680 --> 00:14:15,520 And we selected Pop Ads because they 357 00:14:15,520 --> 00:14:17,840 were the cheapest possible way to get this amount of traffic. 358 00:14:18,160 --> 00:14:21,620 And this is a graph of a two-minute plot of traffic 359 00:14:21,620 --> 00:14:22,380 from Pop Ads. 360 00:14:23,460 --> 00:14:26,740 And we gave Pop Ads $10 or $15 in this case, 361 00:14:26,760 --> 00:14:28,960 and received between 40,000 and 50,000 requests 362 00:14:28,960 --> 00:14:30,040 in a matter of two minutes. 363 00:14:30,380 --> 00:14:32,320 And a kind of interesting note about this, 364 00:14:32,380 --> 00:14:34,400 we don't know exactly where this traffic comes from, 365 00:14:34,520 --> 00:14:36,700 but one of the common referring pages we saw 366 00:14:36,700 --> 00:14:39,440 was just a blank page with an anchor tag to our website 367 00:14:39,440 --> 00:14:41,100 and a crypto miner JavaScript payload. 368 00:14:42,040 --> 00:14:42,760 Perfectly legitimate. 369 00:14:43,080 --> 00:14:43,860 That's totally legit. 370 00:14:44,080 --> 00:14:46,260 You know, how many websites do you commonly visit 371 00:14:46,260 --> 00:14:48,200 where it's just a link on a page 372 00:14:48,200 --> 00:14:49,380 and then a cryptocurrency miner? 373 00:14:49,520 --> 00:14:50,700 That's most of the sites that I visit. 374 00:14:50,700 --> 00:14:52,080 Yeah, I mean, pretty much every site I ever go to. 375 00:14:52,080 --> 00:14:52,340 Yeah, yeah. 376 00:14:52,340 --> 00:14:52,360 Yeah. 377 00:14:53,180 --> 00:14:55,240 And so we also set up a Honeypot web server. 378 00:14:55,440 --> 00:14:58,040 And this was initially running at IPv6.exposed. 379 00:14:58,260 --> 00:15:02,120 This URL is now where we have our IPv6 search portal, 380 00:15:02,240 --> 00:15:03,200 which you can then check out. 381 00:15:03,460 --> 00:15:05,560 So for the Honeypot web server, we have this serving 382 00:15:05,560 --> 00:15:07,400 over both IPv4 and IPv6. 383 00:15:07,640 --> 00:15:10,680 The idea was that we would have images on the site serving 384 00:15:10,680 --> 00:15:13,520 over IPv6 so that if users connected over IPv4, 385 00:15:14,100 --> 00:15:16,380 we could still potentially get IPv6 requests 386 00:15:16,960 --> 00:15:17,900 from these images. 387 00:15:18,160 --> 00:15:20,640 And we also set up a WebRTC JavaScript payload, 388 00:15:20,640 --> 00:15:24,120 which would enumerate the private IPv4 addresses 389 00:15:24,120 --> 00:15:26,380 of the client, as well as our IPv6 addresses, 390 00:15:26,480 --> 00:15:28,380 and then post those back to a data store we controlled. 391 00:15:28,780 --> 00:15:31,320 And to try and generate traffic for this, we used pop ads. 392 00:15:31,520 --> 00:15:33,840 And we also posted links all over social media. 393 00:15:34,000 --> 00:15:35,220 We thought, hey, we're cool people. 394 00:15:35,320 --> 00:15:36,380 People will click on these links, 395 00:15:36,440 --> 00:15:38,040 but we're not popular at all, it turns out. 396 00:15:38,100 --> 00:15:39,500 And so we got almost no traffic 397 00:15:39,500 --> 00:15:40,840 from the organic social media efforts. 398 00:15:42,260 --> 00:15:45,460 And here we have a plot of the number of requests over time 399 00:15:45,460 --> 00:15:47,700 on the top for the HTTP requests 400 00:15:47,700 --> 00:15:49,780 and on the bottom for the WebRTC postbacks. 401 00:15:49,780 --> 00:15:51,840 And what we can see is on the top, 402 00:15:51,920 --> 00:15:53,560 this is on the scale of tens of thousands, 403 00:15:53,760 --> 00:15:55,200 but on the bottom, the postbacks, 404 00:15:55,380 --> 00:15:56,600 this is on the scale of thousands. 405 00:15:56,840 --> 00:15:58,920 And this tells us that most of the users, 406 00:15:59,060 --> 00:16:01,080 or rather most of the clients, 407 00:16:01,260 --> 00:16:03,580 who requested this website did not actually execute 408 00:16:03,580 --> 00:16:04,500 this JavaScript payload. 409 00:16:04,780 --> 00:16:07,200 So while we had some apparent actual browsers, 410 00:16:07,460 --> 00:16:09,400 a lot of these may have been automated scripts 411 00:16:09,400 --> 00:16:10,480 from the pop ads network. 412 00:16:10,760 --> 00:16:13,040 And this is over the course of a 10-month period. 413 00:16:13,280 --> 00:16:15,260 And we can see we have these spikes 414 00:16:15,260 --> 00:16:16,760 where we paid for the pop ads campaigns, 415 00:16:17,040 --> 00:16:19,400 but very, very little residual organic traffic 416 00:16:19,400 --> 00:16:20,580 from the social media efforts. 417 00:16:21,520 --> 00:16:24,340 So after setting up the DNS server and the web server, 418 00:16:24,520 --> 00:16:26,500 we set up a Honeypot SMTP server. 419 00:16:26,800 --> 00:16:28,300 And we thought we were being clever here. 420 00:16:28,420 --> 00:16:30,200 We thought we could post email addresses 421 00:16:30,200 --> 00:16:33,160 all over the Internet, get DNS and SMTP requests that way, 422 00:16:33,280 --> 00:16:34,760 sign up for spam email lists, 423 00:16:35,000 --> 00:16:37,060 get DNS and SMTP requests that way. 424 00:16:37,260 --> 00:16:40,140 And in the end, we only got a small number of requests 425 00:16:40,140 --> 00:16:41,300 from a small number of posts. 426 00:16:41,500 --> 00:16:43,740 They were primarily infrastructure email servers 427 00:16:43,740 --> 00:16:45,520 from places like Hotmail and Yahoo. 428 00:16:45,820 --> 00:16:49,020 So the SMTP Honeypot was not very good 429 00:16:49,020 --> 00:16:49,660 in terms of results. 430 00:16:50,160 --> 00:16:52,600 So after the 10-month Honeypotting experiment, 431 00:16:52,920 --> 00:16:54,800 we collected 92,000 addresses. 432 00:16:55,160 --> 00:16:57,800 We ended up spending closer to $1,000 in costs. 433 00:16:58,080 --> 00:17:01,020 And this was good in that we had non-zero addresses, 434 00:17:01,220 --> 00:17:03,660 but it was expensive, took a long time, 435 00:17:03,740 --> 00:17:05,480 and we weren't super thrilled with the results. 436 00:17:05,720 --> 00:17:07,800 So we have this set, and we decided to do 437 00:17:07,800 --> 00:17:10,540 an ICMP ping scan across these 92,000 addresses 438 00:17:10,540 --> 00:17:13,180 to see after 10 months how many of them are still alive. 439 00:17:13,640 --> 00:17:16,180 And it turns out that almost none of them were. 440 00:17:16,540 --> 00:17:18,900 And this was another one of our good learning experiences 441 00:17:19,020 --> 00:17:20,860 when we discovered this thing called 442 00:17:20,860 --> 00:17:22,280 ephemeral IPv6 addresses. 443 00:17:22,640 --> 00:17:25,720 And just how we have ephemeral UDP and TCP ports 444 00:17:25,720 --> 00:17:26,520 for outgoing connections, 445 00:17:26,760 --> 00:17:29,660 we have ephemeral IPv6 addresses for outgoing connections. 446 00:17:29,960 --> 00:17:32,880 And it turns out that most of these 92,000 addresses 447 00:17:32,880 --> 00:17:35,320 were actually ephemeral connection-specific 448 00:17:35,320 --> 00:17:38,160 ephemeral addresses, which means they were used 449 00:17:38,160 --> 00:17:39,920 this one time and not persistent, 450 00:17:40,060 --> 00:17:41,500 so we couldn't actually connect back to them. 451 00:17:41,680 --> 00:17:44,020 And this means we ended up spending 10 months 452 00:17:44,020 --> 00:17:46,460 and $1,000 and had basically nothing 453 00:17:46,460 --> 00:17:48,860 but a painful learning experience to show for it. 454 00:17:52,400 --> 00:17:55,080 And so you know that your research project 455 00:17:55,080 --> 00:17:57,340 is going really well when you spend $1,000 456 00:17:57,340 --> 00:18:00,420 and 10 months of effort and have nothing to show for it. 457 00:18:00,460 --> 00:18:01,980 I highly recommend it. You should try it. 458 00:18:03,040 --> 00:18:06,400 So we do all of this attempting to find addresses 459 00:18:06,400 --> 00:18:08,380 that have all of this entropy in them. 460 00:18:08,660 --> 00:18:10,360 We fail miserably at it. 461 00:18:10,480 --> 00:18:12,280 So then we turn our attention to, 462 00:18:12,480 --> 00:18:13,900 okay, what about those addresses 463 00:18:13,900 --> 00:18:15,540 that seem to have more structure in them? 464 00:18:17,580 --> 00:18:18,960 And we kind of came to that conclusion 465 00:18:19,020 --> 00:18:21,040 by looking at these IP addresses. 466 00:18:21,280 --> 00:18:22,700 And I mean, if you take a big list, 467 00:18:22,780 --> 00:18:24,780 there's plenty of public data sets 468 00:18:24,780 --> 00:18:26,980 that have lots and lots of IPv6 addresses in them. 469 00:18:27,200 --> 00:18:29,160 And so we pulled a bunch of them down, 470 00:18:29,280 --> 00:18:30,620 put all the addresses together, 471 00:18:30,800 --> 00:18:32,260 and we were looking through these files. 472 00:18:32,380 --> 00:18:34,860 It looks like there's a lot of structure in these addresses. 473 00:18:35,400 --> 00:18:36,980 It's as if, you know, you have, like, 474 00:18:36,980 --> 00:18:38,820 iterating on the host bits, 475 00:18:38,980 --> 00:18:40,820 so maybe that's like DHCP leases. 476 00:18:41,260 --> 00:18:42,640 There's various byte boundaries 477 00:18:42,640 --> 00:18:44,980 that tend to have, like, common iterations for networks. 478 00:18:45,460 --> 00:18:46,700 But it feels like 479 00:18:46,700 --> 00:18:48,680 there's a lot of structure in these addresses. 480 00:18:50,020 --> 00:18:51,260 So, of course, 481 00:18:51,340 --> 00:18:53,360 as folks that like computers 482 00:18:53,360 --> 00:18:55,240 and like data analysis, 483 00:18:55,560 --> 00:18:57,260 how are we going to solve this problem 484 00:18:57,260 --> 00:18:58,800 of figuring out how to predict 485 00:18:58,800 --> 00:18:59,940 new IPv6 addresses? 486 00:19:00,340 --> 00:19:03,080 Well, obviously, machine learning is the answer. 487 00:19:03,200 --> 00:19:04,540 Machine learning is the answer to everything. 488 00:19:06,020 --> 00:19:07,580 So, as Mark said before, 489 00:19:07,800 --> 00:19:09,140 we are not network engineers. 490 00:19:09,900 --> 00:19:11,280 We're barely engineers at all. 491 00:19:11,500 --> 00:19:11,920 Yeah. 492 00:19:12,320 --> 00:19:13,500 We're not even engineers. 493 00:19:14,600 --> 00:19:15,940 We're not network engineers, 494 00:19:16,000 --> 00:19:18,420 and we're definitely not machine learning experts. 495 00:19:19,140 --> 00:19:21,560 But we have a friend who is a machine learning expert, 496 00:19:21,740 --> 00:19:22,980 and we got him involved, 497 00:19:23,200 --> 00:19:23,840 and he was like, 498 00:19:23,940 --> 00:19:25,420 oh, I think I know what you should use. 499 00:19:25,600 --> 00:19:26,740 It's an autoencoder. 500 00:19:27,800 --> 00:19:29,500 And so I'm going to describe that in the way 501 00:19:29,500 --> 00:19:30,480 that it was described to me. 502 00:19:31,380 --> 00:19:34,100 So, if you think about the way the human eye works, 503 00:19:34,280 --> 00:19:35,660 where light bounces around, 504 00:19:35,820 --> 00:19:36,940 it bounces off of objects, 505 00:19:36,980 --> 00:19:38,520 and then it enters your lens, 506 00:19:38,840 --> 00:19:40,960 and then hits the back of your eye and your retina, 507 00:19:41,060 --> 00:19:43,800 and then your brain is able to interpret that as sight, 508 00:19:45,200 --> 00:19:46,360 well, what happens 509 00:19:46,360 --> 00:19:48,080 when the lens is partly damaged? 510 00:19:49,020 --> 00:19:49,740 You don't have perfect vision, 511 00:19:49,840 --> 00:19:50,760 maybe things get blurry, 512 00:19:50,960 --> 00:19:53,080 but the point being that the input data, 513 00:19:53,220 --> 00:19:54,020 the light waves, 514 00:19:54,320 --> 00:19:55,760 once they pass through the lens, 515 00:19:55,960 --> 00:19:56,940 become distorted, 516 00:19:57,100 --> 00:19:59,860 and it kind of alters the data that you're actually receiving. 517 00:20:01,040 --> 00:20:04,180 So an autoencoder is like an imperfect lens. 518 00:20:04,660 --> 00:20:06,960 Basically, you're going to create a lens 519 00:20:06,960 --> 00:20:08,380 that has a bit of error in it 520 00:20:08,380 --> 00:20:10,520 so that when you pass data through this lens, 521 00:20:10,760 --> 00:20:12,340 it messes that data up. 522 00:20:12,460 --> 00:20:14,640 It transforms that data into new data. 523 00:20:14,900 --> 00:20:17,360 But the interesting thing about this is 524 00:20:17,360 --> 00:20:19,000 that the way in which 525 00:20:19,020 --> 00:20:20,240 it manipulates the data 526 00:20:20,240 --> 00:20:22,800 is representative of the structure 527 00:20:22,800 --> 00:20:26,240 of the data that the lens was trained on. 528 00:20:26,420 --> 00:20:27,820 So the idea would be 529 00:20:27,820 --> 00:20:29,160 that we create a lens, 530 00:20:29,440 --> 00:20:30,620 and we create this lens 531 00:20:30,620 --> 00:20:32,680 from the IPv6 addresses that we have, 532 00:20:32,860 --> 00:20:34,920 we make sure that there's an error threshold 533 00:20:34,920 --> 00:20:36,140 in this lens, 534 00:20:36,320 --> 00:20:38,520 and then we take IPv6 addresses 535 00:20:38,520 --> 00:20:39,920 and pass them through the lens, 536 00:20:40,100 --> 00:20:41,760 the data that we get out the other side 537 00:20:41,760 --> 00:20:44,680 is a transformation of our input data 538 00:20:44,680 --> 00:20:46,780 that is transformed in a way 539 00:20:46,780 --> 00:20:48,120 that is hopefully going to guess 540 00:20:49,020 --> 00:20:49,460 our IP addresses. 541 00:20:51,460 --> 00:20:52,280 And so, 542 00:20:52,920 --> 00:20:54,840 because we're so good at machine learning, 543 00:20:55,000 --> 00:20:56,880 this worked completely perfectly 544 00:20:57,740 --> 00:20:58,700 in that 545 00:20:58,700 --> 00:20:59,920 it didn't work at all. 546 00:21:00,660 --> 00:21:02,940 And so we could not 547 00:21:02,940 --> 00:21:04,740 make anything but a perfect lens. 548 00:21:05,060 --> 00:21:06,640 So basically all of the data 549 00:21:06,640 --> 00:21:08,020 that we put into the autoencoder 550 00:21:08,020 --> 00:21:10,180 was just spit right back out at us. 551 00:21:10,320 --> 00:21:12,980 So our input data was our output data 552 00:21:12,980 --> 00:21:15,180 and it really didn't do much for us. 553 00:21:15,660 --> 00:21:16,560 So, you know, 554 00:21:16,620 --> 00:21:17,940 a thousand dollars down, 555 00:21:19,080 --> 00:21:20,540 machine learning is not working, 556 00:21:20,760 --> 00:21:22,180 we're doing great so far. 557 00:21:24,240 --> 00:21:25,500 So then we found this paper 558 00:21:25,500 --> 00:21:26,540 which gave us a little bit of hope, 559 00:21:26,640 --> 00:21:27,900 which is the Entropy IP paper, 560 00:21:28,060 --> 00:21:29,680 which is these folks from Akamai 561 00:21:29,680 --> 00:21:32,120 that looked at an absolutely massive 562 00:21:32,560 --> 00:21:34,260 data set of IPv6 addresses 563 00:21:34,880 --> 00:21:37,360 and did an analysis 564 00:21:37,360 --> 00:21:38,840 of the structure of these addresses. 565 00:21:39,040 --> 00:21:40,460 And their conclusion was that 566 00:21:40,460 --> 00:21:42,800 yes indeed, there is a lot of structure 567 00:21:42,800 --> 00:21:43,380 in these addresses. 568 00:21:43,720 --> 00:21:45,780 So if you look in the top left hand corner, 569 00:21:45,900 --> 00:21:47,500 kind of that blue wavy line, 570 00:21:49,020 --> 00:21:50,720 is the entropy of addresses 571 00:21:50,720 --> 00:21:52,100 on a per bit basis. 572 00:21:52,440 --> 00:21:54,940 So you'll see kind of on the right of that line 573 00:21:54,940 --> 00:21:55,960 you have very high entropy, 574 00:21:56,140 --> 00:21:57,620 so that would be at the end of the address. 575 00:21:57,860 --> 00:21:59,120 So it's going to be your host bits. 576 00:21:59,300 --> 00:22:01,440 You have another spike of really high entropy 577 00:22:01,440 --> 00:22:02,180 right in the middle. 578 00:22:02,280 --> 00:22:04,640 That's probably going to be your slash 64 network boundary 579 00:22:04,640 --> 00:22:06,420 because that's where so many networks are allocated. 580 00:22:06,760 --> 00:22:09,140 But the rest of this seems to have 581 00:22:09,140 --> 00:22:10,620 a fairly low amount of entropy. 582 00:22:11,480 --> 00:22:14,080 So, you know, this was kind of a consolation prize 583 00:22:14,080 --> 00:22:15,960 considering how much we had already done 584 00:22:15,960 --> 00:22:18,420 and not gotten any progress with. 585 00:22:19,020 --> 00:22:19,640 But at least we thought, 586 00:22:19,720 --> 00:22:20,700 okay, we're on the right track. 587 00:22:22,480 --> 00:22:24,280 So we did what we do best, 588 00:22:24,320 --> 00:22:25,680 which is we got really dumb about it. 589 00:22:27,020 --> 00:22:28,900 So we made our own model 590 00:22:28,900 --> 00:22:30,420 for generating IPv6 addresses. 591 00:22:30,720 --> 00:22:32,420 We just needed something that would work, 592 00:22:32,480 --> 00:22:33,660 really anything that would work, 593 00:22:33,760 --> 00:22:35,460 so that we could create this sort of thing 594 00:22:35,460 --> 00:22:37,120 that would generate addresses, scan for them, 595 00:22:37,240 --> 00:22:39,840 and then find live addresses and feedback into the loop. 596 00:22:40,500 --> 00:22:41,580 So this is what we would do. 597 00:22:41,660 --> 00:22:42,920 We would take an IPv6 address 598 00:22:43,540 --> 00:22:44,800 and we would break it down 599 00:22:44,800 --> 00:22:47,840 into the 32 nibbles that it was made up of 600 00:22:49,280 --> 00:22:50,560 and then we would count 601 00:22:50,560 --> 00:22:52,120 the number of occurrences 602 00:22:52,120 --> 00:22:53,600 of every nibble 603 00:22:53,600 --> 00:22:55,740 based on the preceding nibble. 604 00:22:55,800 --> 00:22:57,240 So in this case, we would say, 605 00:22:57,320 --> 00:22:58,640 okay, in position 0, 606 00:22:59,120 --> 00:23:01,000 we have a current value of 0x2 607 00:23:01,000 --> 00:23:04,360 and we'd see the next value is 0x8 one more time. 608 00:23:04,840 --> 00:23:06,080 And then in position 1, 609 00:23:06,220 --> 00:23:07,800 we have a current value of 0x8 610 00:23:07,800 --> 00:23:10,460 and a next value of 0x0 one more time. 611 00:23:11,000 --> 00:23:12,800 And the next one in the second position, 612 00:23:12,980 --> 00:23:14,940 0x0, 0x0, one more time. 613 00:23:15,080 --> 00:23:17,380 And we did this with every single IP address 614 00:23:17,380 --> 00:23:18,940 that we have in our input data set 615 00:23:19,020 --> 00:23:20,460 and what we end up with 616 00:23:20,900 --> 00:23:22,760 is basically a probability distribution 617 00:23:22,760 --> 00:23:24,160 where I can say, okay, 618 00:23:24,260 --> 00:23:26,980 in position 1, when I have a nibble value 619 00:23:26,980 --> 00:23:28,880 of 0xa, here is 620 00:23:28,880 --> 00:23:30,900 the likelihood of what the next nibble 621 00:23:30,900 --> 00:23:31,780 is going to be. 622 00:23:32,480 --> 00:23:34,420 And this actually kind of worked. 623 00:23:35,960 --> 00:23:37,300 So once we have this, 624 00:23:37,420 --> 00:23:38,800 we say, okay, how do we turn this 625 00:23:38,800 --> 00:23:40,380 from a model into creating 626 00:23:40,380 --> 00:23:41,720 an IP address? 627 00:23:41,940 --> 00:23:44,480 We say, okay, we're going to start with an 0x2 in position 0. 628 00:23:45,200 --> 00:23:46,760 We look at our data set and say, 629 00:23:46,840 --> 00:23:48,840 okay, what are the probabilities for the next 630 00:23:49,780 --> 00:23:51,240 nibble from position 0 631 00:23:51,240 --> 00:23:52,600 when the current value is 0x2? 632 00:23:53,300 --> 00:23:54,660 And we have those probabilities 633 00:23:54,660 --> 00:23:55,660 based on the data set. 634 00:23:56,480 --> 00:23:58,320 We use that to create a weighted die 635 00:23:58,320 --> 00:24:00,880 and we roll that die and that 636 00:24:00,880 --> 00:24:02,420 gives us the value for the next position. 637 00:24:02,600 --> 00:24:04,080 So now we have the value for position 1 638 00:24:04,080 --> 00:24:05,480 and we do the same thing again. 639 00:24:05,640 --> 00:24:07,980 Okay, when I have a value of 0xa in position 1, 640 00:24:08,080 --> 00:24:09,780 out of everything we've seen before, 641 00:24:09,860 --> 00:24:10,840 what's the probability distribution? 642 00:24:11,380 --> 00:24:13,380 Do it again, do that 32 times 643 00:24:13,380 --> 00:24:14,640 and then we have an IP address. 644 00:24:16,160 --> 00:24:18,560 And so, another lesson 645 00:24:19,020 --> 00:24:19,940 about research projects, 646 00:24:20,500 --> 00:24:22,280 don't get your hopes up too quickly. 647 00:24:22,900 --> 00:24:24,820 So we generated 10 million 648 00:24:24,820 --> 00:24:26,480 addresses and then we 649 00:24:26,480 --> 00:24:28,360 ping scanned all 10 million addresses 650 00:24:28,360 --> 00:24:31,040 and 50,000 of them responded 651 00:24:31,040 --> 00:24:32,580 saying, yup, I'm a real address. 652 00:24:32,920 --> 00:24:33,880 We're really good at this. 653 00:24:34,320 --> 00:24:35,980 Wow, that was 654 00:24:36,700 --> 00:24:38,220 easier than I thought it would be. 655 00:24:38,400 --> 00:24:40,620 I feel like that shouldn't be a thing. 656 00:24:41,540 --> 00:24:43,000 I feel like that was too easy. 657 00:24:43,920 --> 00:24:44,840 So it turns out 658 00:24:44,840 --> 00:24:45,900 it was too easy because 659 00:24:45,900 --> 00:24:48,660 then we learned about these guys. 660 00:24:50,000 --> 00:24:51,520 So in IPv6 661 00:24:51,520 --> 00:24:52,440 there's this phenomenon 662 00:24:52,440 --> 00:24:54,820 which we still do not know why this happens 663 00:24:54,820 --> 00:24:56,460 but there's these 664 00:24:56,460 --> 00:24:57,580 alias network ranges 665 00:24:57,580 --> 00:25:00,220 which basically every single IP address 666 00:25:00,220 --> 00:25:03,000 in an IPv6 667 00:25:03,000 --> 00:25:04,620 network range is mapped 668 00:25:04,620 --> 00:25:06,220 to a single host. 669 00:25:06,960 --> 00:25:08,660 So they're all going to respond 670 00:25:08,660 --> 00:25:09,760 to a ping. 671 00:25:11,020 --> 00:25:12,620 Now if you have 672 00:25:12,620 --> 00:25:14,780 a loop, a feedback loop 673 00:25:14,780 --> 00:25:16,200 where you generate addresses, 674 00:25:16,440 --> 00:25:18,940 scan for them, and then take the ones that responded 675 00:25:19,020 --> 00:25:20,540 and feed them back into your model 676 00:25:21,260 --> 00:25:22,480 and you don't take 677 00:25:22,880 --> 00:25:24,740 these into account, you very quickly 678 00:25:24,740 --> 00:25:26,880 end up with a model that is completely 679 00:25:26,880 --> 00:25:28,880 useless but is really good at 680 00:25:28,880 --> 00:25:30,280 finding alias network ranges. 681 00:25:30,580 --> 00:25:31,860 And that's what happened to us. 682 00:25:33,000 --> 00:25:34,880 So we had to find a way to 683 00:25:34,880 --> 00:25:36,680 detect and eliminate these 684 00:25:36,680 --> 00:25:38,420 alias network ranges from our data sets. 685 00:25:39,240 --> 00:25:40,380 So here's how we did that. 686 00:25:41,500 --> 00:25:42,960 So let's say that this IP address 687 00:25:42,960 --> 00:25:44,600 responded to a ping and we say, okay, 688 00:25:44,720 --> 00:25:46,480 you know what, I don't trust you anymore. 689 00:25:46,680 --> 00:25:49,000 I've learned my lesson. I'm going to think 690 00:25:49,020 --> 00:25:50,740 that you are actually in an alias network range. 691 00:25:51,440 --> 00:25:52,620 So I'm going to wrap you in a 692 00:25:52,620 --> 00:25:54,960 slash 96, and then 693 00:25:54,960 --> 00:25:56,740 I'm going to generate 8 random addresses 694 00:25:56,740 --> 00:25:58,720 in that network. Again, the assumption 695 00:25:58,720 --> 00:26:00,960 here is that you're 696 00:26:00,960 --> 00:26:02,980 in an alias network range, I'm going to test 697 00:26:02,980 --> 00:26:04,940 the addresses around you to see if 698 00:26:04,940 --> 00:26:06,960 they respond as well, and the chances 699 00:26:06,960 --> 00:26:08,900 of us guessing 8 random addresses 700 00:26:08,900 --> 00:26:10,520 out of 4.5 billion 701 00:26:10,520 --> 00:26:12,480 and those actually being live hosts, 702 00:26:12,620 --> 00:26:14,880 that feels pretty small. I'm not a statistician 703 00:26:14,880 --> 00:26:15,840 either, but I think it's small. 704 00:26:17,520 --> 00:26:18,840 So we ping scan these 705 00:26:19,020 --> 00:26:21,020 guys, and if 50% 706 00:26:21,020 --> 00:26:22,720 or more respond, then we know that 707 00:26:22,720 --> 00:26:23,900 network range is aliased. 708 00:26:24,960 --> 00:26:26,540 But that's just the slash 96. 709 00:26:26,860 --> 00:26:28,240 We want to know where 710 00:26:28,240 --> 00:26:30,800 the network boundary is for the 711 00:26:30,800 --> 00:26:32,880 actual alias network range. So now we've got to find 712 00:26:32,880 --> 00:26:33,300 that boundary. 713 00:26:34,940 --> 00:26:36,480 So we know it's the slash 96, 714 00:26:38,020 --> 00:26:38,800 which means 715 00:26:39,760 --> 00:26:40,860 that the rightmost 716 00:26:40,860 --> 00:26:42,980 32 bits are within the alias 717 00:26:42,980 --> 00:26:45,020 network range, but the other 96 bits 718 00:26:45,020 --> 00:26:46,800 we don't actually know anything about yet. 719 00:26:46,960 --> 00:26:49,000 So what we do is we perform a binary search 720 00:26:50,160 --> 00:26:50,940 We take 721 00:26:50,940 --> 00:26:52,900 the right hand of the bits that we don't 722 00:26:52,900 --> 00:26:54,900 know anything about yet, and we flip them. 723 00:26:55,180 --> 00:26:56,920 Again, the logic being that if these 724 00:26:56,920 --> 00:26:58,660 bits are within the alias network range, 725 00:26:58,820 --> 00:27:00,960 then this IP address should respond to 726 00:27:00,960 --> 00:27:01,780 a ping scan as well. 727 00:27:03,720 --> 00:27:04,700 So we take that, 728 00:27:04,780 --> 00:27:06,980 we ping scan it, and one of two things 729 00:27:06,980 --> 00:27:08,900 happens. Either we 730 00:27:08,900 --> 00:27:09,900 don't receive a response, 731 00:27:10,980 --> 00:27:12,860 which means that the boundary of the 732 00:27:12,860 --> 00:27:14,860 alias network range is within the bits that 733 00:27:14,860 --> 00:27:16,780 we flipped, and the bits that we did not 734 00:27:16,780 --> 00:27:18,780 test are definitely not in the network 735 00:27:19,020 --> 00:27:19,100 range, 736 00:27:20,440 --> 00:27:22,420 or a response was received, 737 00:27:22,640 --> 00:27:24,660 which means that the bits that we tested are 738 00:27:24,660 --> 00:27:26,900 within the alias network range, and now we have 739 00:27:26,900 --> 00:27:27,940 to test the ones that we didn't. 740 00:27:28,580 --> 00:27:31,020 So this is a binary search, we rinse and repeat, 741 00:27:31,220 --> 00:27:32,760 and between five and six 742 00:27:32,760 --> 00:27:34,800 iterations of this, you can actually 743 00:27:34,800 --> 00:27:36,960 find the exact boundary 744 00:27:36,960 --> 00:27:38,940 for where the alias network range 745 00:27:38,940 --> 00:27:39,700 begins and ends. 746 00:27:41,840 --> 00:27:42,920 And that was 747 00:27:42,920 --> 00:27:44,480 the first release of our tool. 748 00:27:45,340 --> 00:27:46,220 So basically, 749 00:27:46,540 --> 00:27:48,760 we have this really stupid probabilistic 750 00:27:49,020 --> 00:27:50,680 model, generate IP addresses, 751 00:27:50,900 --> 00:27:52,260 scan for those IP addresses, 752 00:27:52,500 --> 00:27:54,280 all the IP addresses that respond, 753 00:27:54,660 --> 00:27:56,500 we say, okay, test for alias networks, 754 00:27:56,820 --> 00:27:58,740 remove the ones that are in alias networks, 755 00:27:58,900 --> 00:28:00,480 and then feed them back into the loop 756 00:28:00,480 --> 00:28:01,460 and keep going. 757 00:28:02,520 --> 00:28:04,920 And this worked reasonably well. 758 00:28:05,760 --> 00:28:06,880 We basically 759 00:28:06,880 --> 00:28:08,740 had, we would get one new 760 00:28:08,740 --> 00:28:10,820 novel IPv6 address that we had 761 00:28:10,820 --> 00:28:12,840 never seen before once every 762 00:28:12,840 --> 00:28:14,660 15 seconds, which 763 00:28:14,660 --> 00:28:15,940 not great, 764 00:28:16,100 --> 00:28:18,920 but better than guessing one out of 765 00:28:19,020 --> 00:28:20,340 two to the power of 128 766 00:28:20,780 --> 00:28:21,460 to us. 767 00:28:22,680 --> 00:28:24,420 So this is actually the 768 00:28:25,020 --> 00:28:26,880 fourth time that we've spoken on this 769 00:28:26,880 --> 00:28:28,840 topic, and every time that we give a 770 00:28:28,840 --> 00:28:30,780 talk, we like to make sure that we 771 00:28:30,780 --> 00:28:32,560 add new functionality into our software. 772 00:28:33,040 --> 00:28:34,680 And so one of the most recent releases 773 00:28:35,180 --> 00:28:36,540 focused on getting less 774 00:28:36,540 --> 00:28:38,900 dumber. Not easy for 775 00:28:38,900 --> 00:28:39,340 us to do. 776 00:28:40,700 --> 00:28:42,840 But we wanted to improve our discovery 777 00:28:42,840 --> 00:28:44,940 rate. And so we were going to take 778 00:28:44,940 --> 00:28:46,960 a two-pronged approach to that. I'll talk 779 00:28:46,960 --> 00:28:48,820 about the first prong, Mark will talk about the 780 00:28:49,020 --> 00:28:50,940 second. But first was, let's find a 781 00:28:50,940 --> 00:28:52,260 better way to generate these addresses. 782 00:28:52,680 --> 00:28:54,700 And we read this paper called 6Gen, 783 00:28:54,840 --> 00:28:56,760 which comes out of UC Berkeley, published in 784 00:28:56,760 --> 00:28:58,800 2017, and it's basically 785 00:28:58,800 --> 00:29:00,640 a further iteration on the entropy IP 786 00:29:00,640 --> 00:29:02,920 paper, coming up with some really interesting 787 00:29:02,920 --> 00:29:04,960 ideas around how you can find 788 00:29:04,960 --> 00:29:05,940 new IPv6 addresses. 789 00:29:07,640 --> 00:29:08,900 And kind of the 790 00:29:09,660 --> 00:29:11,060 thing that really kind 791 00:29:11,060 --> 00:29:12,520 of hit home with us 792 00:29:12,520 --> 00:29:14,900 was what their notion of 793 00:29:14,900 --> 00:29:16,620 an IPv6 address cluster was. 794 00:29:17,860 --> 00:29:18,960 And they defined 795 00:29:19,020 --> 00:29:21,040 an IPv6 address cluster as 796 00:29:21,040 --> 00:29:22,320 an IPv6 address 797 00:29:22,860 --> 00:29:24,560 and a number of wildcard 798 00:29:24,560 --> 00:29:26,980 indices. And I'll talk more 799 00:29:26,980 --> 00:29:28,220 about what that means here in a second. 800 00:29:28,680 --> 00:29:30,920 They evaluate how good a 801 00:29:30,920 --> 00:29:32,600 cluster is based on two things. 802 00:29:33,100 --> 00:29:34,580 One of them is the capacity. 803 00:29:34,940 --> 00:29:36,700 How many IPv6 addresses 804 00:29:36,700 --> 00:29:38,680 are possible in this cluster? 805 00:29:38,800 --> 00:29:40,920 And then density. Of all 806 00:29:40,920 --> 00:29:42,460 of those possible IPv6 addresses, 807 00:29:42,540 --> 00:29:44,760 how many of them are in your input 808 00:29:44,760 --> 00:29:45,280 data set? 809 00:29:46,420 --> 00:29:47,720 So let me go back to the 810 00:29:49,020 --> 00:29:50,260 question, what do these clusters actually look like? 811 00:29:50,520 --> 00:29:52,680 So let's say that I wanted to create a cluster 812 00:29:52,680 --> 00:29:54,340 from this IP address. 813 00:29:55,100 --> 00:29:56,920 Say, okay, cool. Now I have 814 00:29:56,920 --> 00:29:58,820 a cluster of size one that has no 815 00:29:58,820 --> 00:30:00,980 wildcard indices, and it's fairly 816 00:30:00,980 --> 00:30:02,840 uninteresting. It's just a single IP address 817 00:30:02,840 --> 00:30:04,820 at this point. The interesting part 818 00:30:04,820 --> 00:30:06,500 comes, though, when we say, 819 00:30:06,660 --> 00:30:08,740 well, what if I upgraded 820 00:30:08,740 --> 00:30:10,120 or grew this cluster 821 00:30:10,680 --> 00:30:12,500 to include a second IP address? 822 00:30:14,180 --> 00:30:14,800 Let's take 823 00:30:14,800 --> 00:30:16,280 this second IP address, for example. 824 00:30:16,760 --> 00:30:18,860 Now the process of growing the 825 00:30:19,020 --> 00:30:20,800 cluster to include a second IP address 826 00:30:20,800 --> 00:30:22,820 is that you compare all of the 827 00:30:22,820 --> 00:30:24,640 nibbles, and you figure out 828 00:30:24,640 --> 00:30:26,700 which nibbles you would have to turn into 829 00:30:26,700 --> 00:30:28,740 wildcards in order for the cluster 830 00:30:28,740 --> 00:30:29,780 to fit both of them. 831 00:30:30,480 --> 00:30:32,800 So in this case, there's only 832 00:30:32,800 --> 00:30:34,780 one nibble that is different between 833 00:30:34,780 --> 00:30:36,800 the two IP addresses. So in order 834 00:30:36,800 --> 00:30:38,820 to upgrade this cluster or grow 835 00:30:38,820 --> 00:30:40,920 this cluster so that it includes both of these 836 00:30:40,920 --> 00:30:42,860 IP addresses, we have to add 837 00:30:42,860 --> 00:30:44,800 a wildcard index at that position. 838 00:30:45,420 --> 00:30:47,020 So basically, in order for 839 00:30:47,020 --> 00:30:48,820 an IP address to be contained within this data 840 00:30:49,020 --> 00:30:50,400 set, or within this cluster, 841 00:30:50,580 --> 00:30:52,840 all of the nibbles have to match, except for 842 00:30:52,840 --> 00:30:54,560 the wildcard indices, because those match 843 00:30:54,560 --> 00:30:55,200 any of them. 844 00:30:56,860 --> 00:30:58,820 In this case, this cluster has a capacity 845 00:30:58,820 --> 00:31:00,980 of 16, because there's 16 possible values 846 00:31:00,980 --> 00:31:01,740 for that one position. 847 00:31:03,220 --> 00:31:04,620 Our input data set was 848 00:31:04,620 --> 00:31:06,740 of size 2, and both of them were found 849 00:31:06,740 --> 00:31:08,920 in the cluster. So in this 850 00:31:08,920 --> 00:31:10,880 case, the density of this cluster is 851 00:31:10,880 --> 00:31:12,000 12.5%. 852 00:31:13,900 --> 00:31:14,720 And really, 853 00:31:14,800 --> 00:31:16,860 to hit this home, these are all 854 00:31:16,860 --> 00:31:18,740 the possible addresses that are in that cluster. 855 00:31:19,020 --> 00:31:21,180 You'll notice that every nibble 856 00:31:21,180 --> 00:31:22,580 is held the same value, 857 00:31:22,760 --> 00:31:24,820 except for in that single position, which is where 858 00:31:24,820 --> 00:31:25,560 the wildcard was. 859 00:31:28,640 --> 00:31:29,920 So the original algorithm, 860 00:31:30,740 --> 00:31:32,820 I'm not going to go into depth on it, but 861 00:31:32,820 --> 00:31:34,900 I will say this. If you're ever reading a 862 00:31:34,900 --> 00:31:36,400 research paper, and 863 00:31:36,980 --> 00:31:38,720 one section says algorithm, 864 00:31:39,520 --> 00:31:40,880 and then the next section says 865 00:31:40,880 --> 00:31:43,000 optimizations for this algorithm so that 866 00:31:43,000 --> 00:31:44,320 you can get it to run on your machine, 867 00:31:45,020 --> 00:31:46,600 it's probably an expensive algorithm. 868 00:31:46,880 --> 00:31:48,440 And it's probably not going to play too well 869 00:31:49,020 --> 00:31:50,900 in software that you want to be running in a constant 870 00:31:50,900 --> 00:31:52,920 loop. I will 871 00:31:52,920 --> 00:31:54,760 say, though, that the algorithm that 872 00:31:54,760 --> 00:31:57,180 we came up with is a direct derivation 873 00:31:57,180 --> 00:31:58,900 of their work, and their 874 00:31:58,900 --> 00:32:00,880 work is very impressive. I highly 875 00:32:00,880 --> 00:32:01,900 recommend reading their paper. 876 00:32:04,140 --> 00:32:05,000 So here's 877 00:32:05,000 --> 00:32:07,060 how we use these clusters to generate 878 00:32:07,060 --> 00:32:08,980 IP addresses. So first we want 879 00:32:08,980 --> 00:32:10,780 to build a really good cluster set. 880 00:32:11,020 --> 00:32:12,720 So we take every IP address 881 00:32:12,720 --> 00:32:14,800 in our input data set, and we 882 00:32:14,800 --> 00:32:16,700 create a cluster of size 1 883 00:32:16,700 --> 00:32:18,940 for every one of them. So now 884 00:32:19,020 --> 00:32:20,860 that we have all these clusters, the next 885 00:32:20,860 --> 00:32:22,820 step is I want to figure out 886 00:32:22,820 --> 00:32:24,620 what the best possible 887 00:32:24,620 --> 00:32:26,980 wildcard index to add 888 00:32:26,980 --> 00:32:28,940 to each cluster is. So I'll take 889 00:32:28,940 --> 00:32:30,860 one cluster and I say, okay, well what if I 890 00:32:30,860 --> 00:32:33,120 turned index 0 into a wildcard? 891 00:32:33,300 --> 00:32:34,480 How good would that cluster be? 892 00:32:34,920 --> 00:32:37,000 What about index 1? What about index 2? 893 00:32:37,180 --> 00:32:38,140 What about index 3? 894 00:32:39,040 --> 00:32:40,880 And in doing this, I figure 895 00:32:40,880 --> 00:32:42,960 out what the best position to add a 896 00:32:42,960 --> 00:32:44,940 wildcard at is, and that's 897 00:32:44,940 --> 00:32:46,900 the best possible upgrade for that cluster. 898 00:32:47,740 --> 00:32:49,000 Now in some cases, 899 00:32:49,020 --> 00:32:50,680 it doesn't matter which index 900 00:32:50,680 --> 00:32:52,880 you pick, they're all bad choices, 901 00:32:53,120 --> 00:32:54,640 which means effectively that 902 00:32:54,640 --> 00:32:57,020 this IP address is kind of out there in the ether 903 00:32:57,020 --> 00:32:58,760 and has no adjacent 904 00:32:58,760 --> 00:33:01,040 IP addresses, in which case we don't really 905 00:33:01,040 --> 00:33:02,940 want to build a clustering model around it. 906 00:33:03,020 --> 00:33:04,760 We just kind of set it off to the side 907 00:33:04,760 --> 00:33:06,020 and we reuse it later. 908 00:33:07,120 --> 00:33:08,960 So now that we have all of these clusters 909 00:33:08,960 --> 00:33:10,620 and we have all of these upgrades, 910 00:33:10,900 --> 00:33:12,740 we sort the upgrades by density 911 00:33:12,740 --> 00:33:15,000 because we want to pick the densest upgrades first, 912 00:33:15,480 --> 00:33:16,820 and then we take the 913 00:33:16,820 --> 00:33:18,900 best upgrade off the top, put it 914 00:33:19,020 --> 00:33:20,660 into our cluster set, and then 915 00:33:20,660 --> 00:33:22,740 recalculate what the next best upgrade 916 00:33:22,740 --> 00:33:24,840 for that new cluster might be, and put it 917 00:33:24,840 --> 00:33:25,840 back in the list of upgrades. 918 00:33:26,400 --> 00:33:28,140 So we take the best upgrade off the top, 919 00:33:28,320 --> 00:33:30,600 recalculate what its upgrade would be, put it back in the 920 00:33:30,600 --> 00:33:32,320 upgrade candidates, and rinse and repeat. 921 00:33:32,680 --> 00:33:34,020 And we keep doing this 922 00:33:35,180 --> 00:33:36,300 based on a score. 923 00:33:36,660 --> 00:33:38,980 So we have a mechanism for scoring 924 00:33:38,980 --> 00:33:40,200 the overall utility 925 00:33:40,800 --> 00:33:42,540 of the cluster set that we're building, 926 00:33:42,720 --> 00:33:44,440 and it's based on capacity and density. 927 00:33:45,080 --> 00:33:46,840 And what you'll find is that 928 00:33:46,840 --> 00:33:48,860 when you first start doing this, the score 929 00:33:49,020 --> 00:33:50,740 goes up, up, up, up, up, and then it 930 00:33:50,740 --> 00:33:52,820 plateaus, and then it starts coming down. 931 00:33:53,260 --> 00:33:54,860 And we want to find the model 932 00:33:54,860 --> 00:33:56,520 at the peak of this curve. 933 00:33:59,360 --> 00:34:00,860 So once we have that, 934 00:34:04,040 --> 00:34:04,980 once we have that, 935 00:34:05,080 --> 00:34:06,720 we want to use that to generate 936 00:34:06,720 --> 00:34:07,400 new IP addresses. 937 00:34:08,720 --> 00:34:10,800 And to do that, we basically say, okay, 938 00:34:10,880 --> 00:34:12,880 we pick a cluster at random from the set 939 00:34:12,880 --> 00:34:14,120 of clusters that are in our model, 940 00:34:14,580 --> 00:34:16,880 and then for every one of the 32 941 00:34:16,880 --> 00:34:18,920 nibbles that we need to generate, we flip a 942 00:34:19,020 --> 00:34:20,960 coin, and if the coin lands 943 00:34:20,960 --> 00:34:22,720 on heads, we generate from the cluster. 944 00:34:22,920 --> 00:34:25,140 If the coin lands on tails, we generate 945 00:34:25,140 --> 00:34:26,960 from a probability distribution 946 00:34:26,960 --> 00:34:29,060 of all the addresses we didn't 947 00:34:29,060 --> 00:34:30,360 put in the clustering model. 948 00:34:31,740 --> 00:34:32,920 So if we're generating from the 949 00:34:32,920 --> 00:34:34,960 cluster set, we basically say, okay, 950 00:34:35,060 --> 00:34:36,800 is this index a wild card? 951 00:34:36,980 --> 00:34:38,860 If so, just pick a random nibble. 952 00:34:39,260 --> 00:34:40,940 If not, just take the value 953 00:34:40,940 --> 00:34:42,920 at that nibble. Or, 954 00:34:43,040 --> 00:34:44,560 if we're getting it from the probability distribution, 955 00:34:44,920 --> 00:34:47,060 we say, okay, for this nibble position, 956 00:34:47,380 --> 00:34:48,760 what is the probability distribution 957 00:34:49,020 --> 00:34:51,000 across all addresses that aren't in the cluster set? 958 00:34:51,400 --> 00:34:52,960 Create a way to die, roll it, 959 00:34:53,060 --> 00:34:55,020 and that gives us the value. We do that 960 00:34:55,020 --> 00:34:56,800 32 times, that gives us an IP address, 961 00:34:57,040 --> 00:34:58,760 and this actually works pretty well. 962 00:34:59,280 --> 00:35:00,920 And so the second part of 963 00:35:00,920 --> 00:35:02,960 what we wanted to do to kind of improve 964 00:35:02,960 --> 00:35:04,920 our identification 965 00:35:04,920 --> 00:35:07,000 or detection accuracy is 966 00:35:07,000 --> 00:35:08,860 fan out from initial discovery points, 967 00:35:09,020 --> 00:35:10,460 which is what Mark's going to talk about next. 968 00:35:11,560 --> 00:35:12,680 So as Chris explained, 969 00:35:12,860 --> 00:35:14,380 we have the 666 gen algorithm, 970 00:35:14,840 --> 00:35:16,720 and we use this to generate our 971 00:35:16,720 --> 00:35:18,720 potential candidate IPv6 addresses 972 00:35:19,020 --> 00:35:20,580 We ICMP ping scan them, 973 00:35:20,760 --> 00:35:22,760 and we have a set of discovered addresses. 974 00:35:23,140 --> 00:35:24,900 From that initial set of discovered 975 00:35:24,900 --> 00:35:27,000 addresses, we then want to fan out 976 00:35:27,000 --> 00:35:29,000 and use those as starting points and assume 977 00:35:29,000 --> 00:35:30,940 that we're going to have either neighboring networks, 978 00:35:31,160 --> 00:35:33,160 neighboring hosts, or similar addresses 979 00:35:33,160 --> 00:35:33,640 in structure. 980 00:35:34,360 --> 00:35:36,300 And so for the similar addresses in structure, 981 00:35:36,540 --> 00:35:38,820 we do something which we call a nibble-adjacent 982 00:35:38,820 --> 00:35:40,700 fan out. And the premise here is that 983 00:35:40,700 --> 00:35:42,960 because there is inherent structure in IPv6 984 00:35:42,960 --> 00:35:44,920 addresses, if we've discovered one address, 985 00:35:45,180 --> 00:35:46,980 we think it's likely that we're going 986 00:35:46,980 --> 00:35:48,820 to find other addresses by varying 987 00:35:49,020 --> 00:35:51,180 at most one nibble from that address. 988 00:35:51,500 --> 00:35:53,040 And so in this example, we have 989 00:35:53,040 --> 00:35:55,100 a target network of 2000 slash 4, 990 00:35:55,240 --> 00:35:57,120 and the slash 4 tells us that 4 bits 991 00:35:57,120 --> 00:35:58,700 are going to be the network mask, 992 00:35:58,940 --> 00:36:00,560 which means the first nibble, the 2, 993 00:36:00,660 --> 00:36:02,460 is going to be static, and we can vary 994 00:36:02,460 --> 00:36:04,200 the other 31 nibbles in the address. 995 00:36:05,000 --> 00:36:06,900 So we start in this case with the last 996 00:36:06,900 --> 00:36:08,860 nibble in this address. It starts at a 997 00:36:08,860 --> 00:36:10,840 value of 1, so we generate one 998 00:36:10,840 --> 00:36:12,780 new candidate address by setting that last 999 00:36:12,780 --> 00:36:14,920 nibble to 0. We generate another candidate 1000 00:36:14,920 --> 00:36:16,680 address by setting that to 2, 3, 1001 00:36:16,800 --> 00:36:18,680 and so forth, and we've now generated 1002 00:36:19,020 --> 00:36:20,960 15 new candidate addresses by 1003 00:36:20,960 --> 00:36:22,600 changing that one last nibble. 1004 00:36:22,780 --> 00:36:24,760 In this case, because our target network is a 1005 00:36:24,760 --> 00:36:26,940 slash 4, we have 31 nibbles that we can 1006 00:36:26,940 --> 00:36:28,940 vary, so we go all the way down and we 1007 00:36:28,940 --> 00:36:30,760 do the same procedure across all of the 1008 00:36:30,760 --> 00:36:32,580 31 nibbles. For each nibble, 1009 00:36:32,620 --> 00:36:34,640 we generate 15 new candidate addresses, 1010 00:36:34,840 --> 00:36:36,860 and so this gives us between 15 1011 00:36:36,860 --> 00:36:38,720 and 465 new candidate addresses 1012 00:36:38,720 --> 00:36:40,280 for every newly discovered address. 1013 00:36:40,820 --> 00:36:42,900 And one of the reasons we do this is scanning 1014 00:36:42,900 --> 00:36:44,640 is cheap, generation is hard, 1015 00:36:44,740 --> 00:36:47,120 and by using just these small derivations 1016 00:36:47,120 --> 00:36:48,460 from previously discovered addresses, 1017 00:36:49,020 --> 00:36:50,780 we have what we perceive to be a high 1018 00:36:50,780 --> 00:36:52,420 likelihood of finding new addresses. 1019 00:36:52,820 --> 00:36:54,860 And then we do a similar technique looking at 1020 00:36:54,860 --> 00:36:56,980 sequentially increasing and decreasing 1021 00:36:56,980 --> 00:36:58,980 network addresses. So again, 1022 00:36:59,080 --> 00:37:00,860 if we find an address which is 1023 00:37:00,860 --> 00:37:02,840 a colon colon 1 at a slash 64, 1024 00:37:03,020 --> 00:37:04,960 this means the first address at a slash 1025 00:37:04,960 --> 00:37:06,760 64 network, we're going to assume 1026 00:37:06,760 --> 00:37:08,460 that this may be a piece of networking equipment, 1027 00:37:08,720 --> 00:37:10,820 maybe some infrastructure gear, or consumer premises 1028 00:37:10,820 --> 00:37:13,120 equipment, and if we are an ISP 1029 00:37:13,120 --> 00:37:14,980 or a networking provider, we might 1030 00:37:14,980 --> 00:37:17,100 think that you would do monotonically 1031 00:37:17,100 --> 00:37:18,900 increasing and decreasing network 1032 00:37:19,020 --> 00:37:20,480 addresses. So we take this address, 1033 00:37:20,720 --> 00:37:23,080 we take the leftmost 64 bits, 1034 00:37:23,160 --> 00:37:25,060 and we increase that and we decrease 1035 00:37:25,060 --> 00:37:26,620 that to look for potentially neighboring 1036 00:37:26,620 --> 00:37:28,840 addresses that are still at that same colon colon 1037 00:37:28,840 --> 00:37:30,920 1, just different slash 64s. 1038 00:37:31,120 --> 00:37:32,620 And then we do a similar technique 1039 00:37:32,620 --> 00:37:34,740 looking for neighboring hosts. So if we have 1040 00:37:34,740 --> 00:37:36,240 this colon colon 1 slash 64, 1041 00:37:36,540 --> 00:37:38,540 we're going to assume that is going to be 1042 00:37:38,540 --> 00:37:40,980 a router which may be doing monotonically 1043 00:37:40,980 --> 00:37:42,640 increasing DHCP leases, 1044 00:37:42,760 --> 00:37:44,600 which means we might expect to see devices 1045 00:37:44,600 --> 00:37:46,980 at colon colon 2, colon colon 3, 1046 00:37:47,060 --> 00:37:48,900 and so forth. So we generate a bunch 1047 00:37:49,020 --> 00:37:50,500 of these neighboring slash 64 networks, 1048 00:37:50,680 --> 00:37:52,920 slash 64 hosts, as well as 1049 00:37:52,920 --> 00:37:54,820 the nipple adjacent fanout candidates. 1050 00:37:55,060 --> 00:37:56,800 And what we discovered is that 1051 00:37:56,800 --> 00:37:58,880 by combining this fanning out 1052 00:37:58,880 --> 00:38:00,720 with the 666 gen algorithm, 1053 00:38:00,980 --> 00:38:02,840 we're actually able to generate a huge 1054 00:38:02,840 --> 00:38:04,840 amount more addresses than we were with our initial 1055 00:38:04,840 --> 00:38:07,060 implementation. So here 1056 00:38:07,060 --> 00:38:08,580 we have in v0.2, 1057 00:38:08,720 --> 00:38:11,020 we were able to discover around 60,000 1058 00:38:11,020 --> 00:38:12,600 addresses over the course of 8 days, 1059 00:38:12,760 --> 00:38:15,000 and 80% of those were novel 1060 00:38:15,000 --> 00:38:16,540 addresses not in our public datasets. 1061 00:38:16,860 --> 00:38:19,000 And this wasn't great, but it was a good 1062 00:38:19,020 --> 00:38:20,900 start, and it would show that we could actually find 1063 00:38:20,900 --> 00:38:22,900 these new IPv6 addresses and their 1064 00:38:22,900 --> 00:38:25,440 connected hosts. Now with version 0.3 1065 00:38:25,440 --> 00:38:26,780 where we added 666 gen 1066 00:38:26,780 --> 00:38:28,980 and the fanning out, this was a remarkable 1067 00:38:28,980 --> 00:38:30,920 improvement. And we're able to discover 1068 00:38:30,920 --> 00:38:32,800 in this case 1.57 million 1069 00:38:32,800 --> 00:38:34,460 new addresses 1070 00:38:34,940 --> 00:38:36,820 in the course of one hour, and this 1071 00:38:36,820 --> 00:38:39,140 approached 10 or more million in 24 hours, 1072 00:38:39,300 --> 00:38:41,060 and 78% of these were not 1073 00:38:41,060 --> 00:38:42,540 in publicly available datasets. 1074 00:38:42,880 --> 00:38:44,860 And so this is a 503,000% 1075 00:38:44,860 --> 00:38:46,880 improvement, and this is validation that 1076 00:38:46,880 --> 00:38:48,380 all of this hard work led us to 1077 00:38:49,020 --> 00:38:51,020 a set of algorithms that we can actually 1078 00:38:51,020 --> 00:38:53,140 discover a huge amount of new IPv6 1079 00:38:53,140 --> 00:38:54,740 addresses. Yeah, this is 1080 00:38:54,740 --> 00:38:56,980 less a testament to how good we are 1081 00:38:56,980 --> 00:38:58,840 now and how bad we were before. 1082 00:38:59,200 --> 00:39:00,920 Yes. And so we 1083 00:39:00,920 --> 00:39:03,000 took a sample of 100,000 addresses 1084 00:39:03,000 --> 00:39:04,960 from this dataset, and we decided to 1085 00:39:04,960 --> 00:39:06,960 do a TCP connect scan across a number of 1086 00:39:06,960 --> 00:39:08,960 common TCP ports. And our goal here was 1087 00:39:08,960 --> 00:39:10,920 to sanity check our work and make sure that we 1088 00:39:10,920 --> 00:39:13,020 weren't fooling ourselves at having 1089 00:39:13,020 --> 00:39:14,920 false positives. And in this test 1090 00:39:14,920 --> 00:39:16,760 we had quite a few devices with 1091 00:39:16,760 --> 00:39:18,940 open TCP ports. We found lots 1092 00:39:19,020 --> 00:39:20,640 of networking equipment, both infrastructure 1093 00:39:20,640 --> 00:39:22,260 and consumer premises equipment. 1094 00:39:22,540 --> 00:39:24,860 We found completely unauthorized 1095 00:39:24,860 --> 00:39:26,860 MongoDB instances, lots of ancient 1096 00:39:26,860 --> 00:39:28,960 SSH and Telnet services, and this 1097 00:39:28,960 --> 00:39:30,920 was the first validation we had seen of 1098 00:39:30,920 --> 00:39:32,580 our initial hypothesis, was that 1099 00:39:32,580 --> 00:39:34,760 there were likely lots of IPv6 connected 1100 00:39:34,760 --> 00:39:36,540 hosts on the internet that were potentially 1101 00:39:36,540 --> 00:39:38,480 misconfigured or not intended to be exposed. 1102 00:39:38,820 --> 00:39:40,900 And now we're a year and a half into this 1103 00:39:40,900 --> 00:39:42,840 project, and we finally have the 1104 00:39:42,840 --> 00:39:44,860 data and tools to start to validate 1105 00:39:44,860 --> 00:39:46,520 our initial hypotheses. And so 1106 00:39:46,520 --> 00:39:48,900 a year and a half later we can actually 1107 00:39:49,020 --> 00:39:50,600 start the research that we wanted to start 1108 00:39:51,080 --> 00:39:51,960 way back then. 1109 00:39:52,940 --> 00:39:54,680 So now Chris is going to take you to the cloud. 1110 00:39:55,680 --> 00:39:56,760 Right up to the cloud. 1111 00:39:57,200 --> 00:39:57,940 Alright, so 1112 00:39:58,420 --> 00:40:00,800 as I said before, we don't like giving the same 1113 00:40:00,800 --> 00:40:01,320 talk twice. 1114 00:40:03,060 --> 00:40:04,960 And so here's what we've done for 1115 00:40:04,960 --> 00:40:06,780 this release of our software. 1116 00:40:07,160 --> 00:40:08,660 So we, last 1117 00:40:08,660 --> 00:40:10,840 release, we're like, oh my gosh, 1118 00:40:10,900 --> 00:40:12,860 our discovery rate is so much 1119 00:40:12,860 --> 00:40:14,880 better, this is really cool. And then we 1120 00:40:14,880 --> 00:40:16,660 found that, you know, you can actually run two 1121 00:40:16,660 --> 00:40:18,680 instances of this software side by side 1122 00:40:19,020 --> 00:40:20,720 and they would find mostly unique addresses. 1123 00:40:21,060 --> 00:40:22,800 Which means that this is pretty horizontally 1124 00:40:22,800 --> 00:40:24,360 scalable. So we started thinking, 1125 00:40:24,600 --> 00:40:26,560 well it would be really cool to aggregate 1126 00:40:26,560 --> 00:40:28,880 all of this data and provide this data back 1127 00:40:28,880 --> 00:40:30,900 to the community. So what we've done 1128 00:40:30,900 --> 00:40:32,240 is we added a little bit of functionality 1129 00:40:32,760 --> 00:40:34,900 into the tool where you can opt in and 1130 00:40:34,900 --> 00:40:37,000 say, I'm okay sharing the data that I'm collecting. 1131 00:40:37,260 --> 00:40:39,000 And it uploads it to our central server 1132 00:40:39,000 --> 00:40:41,220 and then all of that data is queryable 1133 00:40:41,220 --> 00:40:42,680 on our website, which is 1134 00:40:42,680 --> 00:40:44,160 ipv6.exposed. 1135 00:40:45,500 --> 00:40:46,920 And so, you know, maybe 1136 00:40:46,920 --> 00:40:48,920 you want to run the tool, maybe you want to like send some 1137 00:40:49,020 --> 00:40:51,000 data to us, maybe you want to provide some data, or maybe 1138 00:40:51,000 --> 00:40:52,620 you just want to query all the data that we 1139 00:40:53,560 --> 00:40:54,780 have aggregated thus far. 1140 00:40:55,000 --> 00:40:56,900 It's all cool by us, but we hope to 1141 00:40:56,900 --> 00:40:58,920 enable other folks to start 1142 00:40:58,920 --> 00:41:00,700 taking a look at IPv6 1143 00:41:00,700 --> 00:41:01,940 security posture by doing this. 1144 00:41:03,280 --> 00:41:04,880 We did not have time to 1145 00:41:04,880 --> 00:41:06,260 put the link into this slide, 1146 00:41:06,420 --> 00:41:08,780 but I will make sure to have it posted on our 1147 00:41:08,780 --> 00:41:09,780 GitHub later. 1148 00:41:12,700 --> 00:41:14,480 And so our tool set is known as 1149 00:41:15,160 --> 00:41:15,560 ipv666. 1150 00:41:16,800 --> 00:41:18,260 The 0.4 release 1151 00:41:19,020 --> 00:41:20,660 is for pushing scan results to the cloud, 1152 00:41:20,820 --> 00:41:22,660 opting in for that. If you have 1153 00:41:22,660 --> 00:41:24,600 golang 1.11 or higher 1154 00:41:24,600 --> 00:41:26,880 installed, just type in go git 1155 00:41:26,880 --> 00:41:28,820 and then this URL. I'll leave this 1156 00:41:28,820 --> 00:41:30,900 up here in a minute when we get 1157 00:41:30,900 --> 00:41:32,900 to Q&A. But there's a number 1158 00:41:32,900 --> 00:41:33,700 of things that it can do. 1159 00:41:34,520 --> 00:41:36,660 We can do the address discovery. 1160 00:41:37,200 --> 00:41:38,640 We can test to see if 1161 00:41:38,640 --> 00:41:41,000 a network is aliased. We can generate 1162 00:41:41,000 --> 00:41:42,040 just random addresses. 1163 00:41:42,640 --> 00:41:44,660 We can generate a new model if you have addresses 1164 00:41:44,660 --> 00:41:45,580 you want to create one from. 1165 00:41:46,180 --> 00:41:48,720 We can generate a blacklist to make it so that you don't 1166 00:41:49,020 --> 00:41:50,400 have a particular address range. 1167 00:41:50,600 --> 00:41:52,620 We can clean a list based on the contents of the 1168 00:41:52,620 --> 00:41:54,840 blacklist that shipped. Or you can convert 1169 00:41:54,840 --> 00:41:56,800 files containing IPv6 addresses to 1170 00:41:56,800 --> 00:41:57,640 various representations. 1171 00:41:59,120 --> 00:42:00,820 And again, we'll leave the links up here 1172 00:42:00,820 --> 00:42:02,980 in a second, but I'll let 1173 00:42:02,980 --> 00:42:03,400 Mark finish. 1174 00:42:05,980 --> 00:42:06,900 So we started by 1175 00:42:06,900 --> 00:42:08,780 talking about how we got into this research and 1176 00:42:08,780 --> 00:42:10,700 how it was an offshoot of our Comcast vulnerability 1177 00:42:10,700 --> 00:42:12,520 research that we presented at DEF CON 25. 1178 00:42:13,040 --> 00:42:14,880 We looked at the difficulty of scanning 1179 00:42:14,880 --> 00:42:17,000 this IPv6 address space due to this 1180 00:42:17,000 --> 00:42:19,000 128-bit search space being too long. 1181 00:42:19,020 --> 00:42:21,740 We talked about the failures 1182 00:42:21,740 --> 00:42:23,360 we had with honeypotting, the 1183 00:42:23,360 --> 00:42:25,000 marginal results we had with the initial 1184 00:42:25,000 --> 00:42:27,220 probabilistic modeling, and the much 1185 00:42:27,220 --> 00:42:29,160 better results we had by introducing 666 1186 00:42:29,160 --> 00:42:30,400 and the fanning out. 1187 00:42:30,620 --> 00:42:32,560 We then looked at the results from our scanning 1188 00:42:32,560 --> 00:42:34,840 and some initial port scans. Chris talked about 1189 00:42:34,840 --> 00:42:36,760 pushing our results to the cloud so that we can 1190 00:42:36,760 --> 00:42:38,760 generate this global cloud source 1191 00:42:38,760 --> 00:42:40,120 dataset of IPv6 addresses. 1192 00:42:40,620 --> 00:42:42,820 We touched on the IPv666 1193 00:42:42,820 --> 00:42:44,840 toolset we've released, which we encourage you to use. 1194 00:42:45,100 --> 00:42:46,660 And I just want to say that 1195 00:42:46,660 --> 00:42:48,200 we've spent a year and a half on this. 1196 00:42:49,020 --> 00:42:50,900 We've done a lot of learning. We've made a lot of mistakes. 1197 00:42:51,240 --> 00:42:52,940 But this is how research projects go. 1198 00:42:53,160 --> 00:42:55,200 And we encourage you to work on your own research. 1199 00:42:55,400 --> 00:42:56,600 We hope this can contribute to that. 1200 00:42:56,760 --> 00:42:58,540 And we welcome contributions to the codebase. 1201 00:42:58,760 --> 00:42:59,620 And thank you very much. 1202 00:43:00,960 --> 00:43:02,920 Here we have a number of links that 1203 00:43:02,920 --> 00:43:04,880 had inspired us. We recommend taking a look at these 1204 00:43:04,880 --> 00:43:06,780 if you are interested in this project. 1205 00:43:12,400 --> 00:43:13,820 I'll put the links back up. 1206 00:43:16,060 --> 00:43:17,000 Yes, thank you all. 1207 00:43:24,280 --> 00:43:26,460 Thank you.