1 00:00:00,000 --> 00:00:09,080 My name is Artem Dynaberg. I work as a security researcher for Raytheon Company, and I'm here to talk to you about a vulnerability I discovered called BitSquatting. 2 00:00:09,600 --> 00:00:20,440 So, in these slides, I always like to start off with a problem. And the problem is that you may be compromised even when you're following the very best web security practices. 3 00:00:21,280 --> 00:00:29,020 So, let's go into a little more detail. Let's pretend you're a user somewhere around the world and you're browsing Facebook. 4 00:00:29,020 --> 00:00:35,940 When you're browsing Facebook, a lot of things get loaded in the background, such as images, JavaScript, and CSS. 5 00:00:36,480 --> 00:00:42,820 And sometimes they're not actually loaded from Facebook. They're loaded from a domain that's one bit away from Facebook. 6 00:00:43,540 --> 00:00:52,380 And Facebook isn't the only site that's vulnerable. Technically, any site is vulnerable, and the more popular a website is, the more vulnerable it is. 7 00:00:53,280 --> 00:00:58,320 But some of you may be out there thinking, hey, I'm running Windows 7 and, you know, latest Chrome. 8 00:00:58,420 --> 00:00:59,000 So, I'm not going to be able to do that. 9 00:00:59,000 --> 00:01:02,900 So, this problem isn't something I should be bothered by. But you're probably wrong. 10 00:01:03,520 --> 00:01:10,960 This slide has actual platforms that have requested resources from me instead of from the domain they originally were going to. 11 00:01:11,720 --> 00:01:16,740 The problem is actually platform, operating system, and hardware agnostic. 12 00:01:17,900 --> 00:01:23,260 You may be thinking, hey, this is pretty interesting. So, it must need, you know, a lot of skills. 13 00:01:24,540 --> 00:01:27,920 But you'd be wrong. It's actually extremely easy. 14 00:01:27,920 --> 00:01:39,040 To perform bit squatting, all you need to do is, one, have knowledge of some simple math, two, be able to register domains, and three, properly answer DNS for them. 15 00:01:39,600 --> 00:01:42,520 But there's got to be, you know, some resource constraint. 16 00:01:42,920 --> 00:01:47,740 Like, you know, maybe you need lots of money, but actually it's extremely cheap. 17 00:01:48,080 --> 00:01:51,960 Like I said, the only real requirements are domain registration and hosting. 18 00:01:52,260 --> 00:01:55,900 And the cost of registering at .com these days is about $8. 19 00:01:57,920 --> 00:02:00,420 Once again, the attack is called bit squatting. 20 00:02:00,720 --> 00:02:05,220 And it's called bit squatting because it's like typo squatting, but for bits. 21 00:02:06,460 --> 00:02:09,160 So, I'm assuming we're all familiar with typo squatting. 22 00:02:09,260 --> 00:02:11,080 But if not, here's a good example. 23 00:02:11,980 --> 00:02:16,860 Let's say you want to go to Google, which is a popular search engine, but you type in extra G. 24 00:02:17,300 --> 00:02:24,640 And you go to Goggle, where you can win Walmart gift cards, free iPads, but sorry, they're out of MacBook Airs. 25 00:02:26,180 --> 00:02:27,900 And this is not what I'm talking about. 26 00:02:28,460 --> 00:02:31,500 Bit squatting requires absolutely no typing. 27 00:02:32,020 --> 00:02:40,540 And the reason is that while humans do a lot of typing, and they make a lot of mistakes, computers make a lot more DNS queries. 28 00:02:42,700 --> 00:02:45,620 So, the graph on this slide is actually to scale. 29 00:02:46,200 --> 00:02:50,240 If you look at that top right corner, you see the little guy circled in red. 30 00:02:50,720 --> 00:02:57,500 That's the proportion of DNS requests that humans make to the proportion of DNS requests that computers make. 31 00:02:58,400 --> 00:03:00,620 A little bit about how I got these numbers. 32 00:03:01,700 --> 00:03:05,760 The 1500 comes from doing some math on the OpenDNS blog. 33 00:03:06,240 --> 00:03:13,220 In a blog post dated this March, they said that they had 30 billion unique DNS queries per day. 34 00:03:13,660 --> 00:03:17,260 If you go to their website, it says that they have 20 million users. 35 00:03:17,780 --> 00:03:21,800 Doing some simple mathematics leads to 1500 DNS queries per user. 36 00:03:22,300 --> 00:03:27,900 Another website, visualeconomics.com, calculated that people go to 89 different domains. 37 00:03:27,900 --> 00:03:31,320 Pro-rated, two per day, that's three. 38 00:03:31,800 --> 00:03:36,200 So, while bit squatters are going after the three domains that you type in, 39 00:03:37,020 --> 00:03:41,920 typo bit squatting goes after the 1497 that you don't. 40 00:03:42,460 --> 00:03:47,000 And how can you take advantage of these 1497 domain lookups? 41 00:03:47,960 --> 00:03:49,240 Computer hardware errors. 42 00:03:49,960 --> 00:03:56,060 Just to clarify, I'm not talking about things like bad programming, buffer overflows, or logic bugs. 43 00:03:56,280 --> 00:03:57,880 I'm talking about errors in the network. 44 00:03:57,880 --> 00:04:02,040 Errors in the hardware that cause even perfectly written programs to misbehave. 45 00:04:02,460 --> 00:04:06,180 And the thing is, computers are devices made by mere mortals. 46 00:04:06,240 --> 00:04:09,360 And they have things like tolerances and mean times to failure. 47 00:04:10,780 --> 00:04:14,440 One of the potential failures that can arise is called a bit error. 48 00:04:14,780 --> 00:04:18,640 And in literature, these are sometimes referred to as single upset events. 49 00:04:19,120 --> 00:04:24,340 And this means that the electrical representation of a 1 gets transformed into a 0. 50 00:04:24,660 --> 00:04:27,040 Or, the electrical representation of a 0 51 00:04:27,040 --> 00:04:28,720 gets transformed into a 1. 52 00:04:29,400 --> 00:04:33,660 And it's really important to notice that these bit errors happen in context. 53 00:04:34,400 --> 00:04:35,920 They don't happen in a void. 54 00:04:36,260 --> 00:04:39,460 Whenever a bit changes from a 1 to a 0 or a 0 to a 1, 55 00:04:39,640 --> 00:04:44,260 it happens in, let's say, your linked lists, your trees, other data structures, 56 00:04:44,720 --> 00:04:49,320 maybe your login credentials, or maybe it happens in some cached HTML 57 00:04:49,320 --> 00:04:51,340 that happens to have a domain name. 58 00:04:51,540 --> 00:04:56,140 And maybe your browser will then look up that domain and fetch some JavaScript from it. 59 00:04:57,040 --> 00:05:01,280 So, now that we've talked about bit errors, let's go through an introduction. 60 00:05:02,140 --> 00:05:07,320 I don't know if you all can tell what this man is doing, but he's actually working on the ENIAC. 61 00:05:07,660 --> 00:05:10,520 And what he's doing is he's replacing a vacuum tube. 62 00:05:11,120 --> 00:05:14,000 The ENIAC was made before modern transistor technology, 63 00:05:14,240 --> 00:05:17,140 and it used vacuum tubes for memory storage and computation. 64 00:05:17,820 --> 00:05:21,180 And these vacuum tubes failed, and they failed a lot. 65 00:05:22,540 --> 00:05:26,760 Whenever one of these tubes would fail, the machine would either give incorrect answers, 66 00:05:26,760 --> 00:05:28,700 or it would stop working at all. 67 00:05:29,160 --> 00:05:33,260 These were the first examples of bit errors, and they've been with us for a very long time. 68 00:05:34,080 --> 00:05:36,640 But, you know, we don't use vacuum tubes these days. 69 00:05:36,960 --> 00:05:39,840 We moved on to transistors and then integrated circuits, 70 00:05:40,060 --> 00:05:46,800 and they're much more reliable, and we should have never encountered any problems with ICs and random failure. 71 00:05:47,000 --> 00:05:47,580 Right, guys? 72 00:05:49,060 --> 00:05:50,380 Well, not quite. 73 00:05:50,740 --> 00:05:55,020 This is a RAM board from the MITS Altair 8800. 74 00:05:55,020 --> 00:05:58,460 The MITS Altair is actually a very famous computer. 75 00:05:59,060 --> 00:06:01,280 It ushered the mini-computer revolution. 76 00:06:02,120 --> 00:06:05,440 Microsoft's first product was Altair Basic. It helped launch the company. 77 00:06:05,920 --> 00:06:07,660 But we're not here to discuss that. 78 00:06:07,880 --> 00:06:11,600 What we're focused on is those purple chips at the top of this RAM board. 79 00:06:12,040 --> 00:06:15,320 Those are Intel 2107 series DRAM chips. 80 00:06:15,800 --> 00:06:22,680 And in 1978, two engineers from Intel, May and Woods, discovered that these chips were catastrophically failing. 81 00:06:22,680 --> 00:06:26,220 The problem was traced back through the supply chain, 82 00:06:26,420 --> 00:06:33,860 and eventually they found out that what had happened is that Intel had built a chip fab downstream from an old uranium mine. 83 00:06:34,440 --> 00:06:40,300 And during fabrication, these chips would be contaminated with radioactive alpha emitters, 84 00:06:40,380 --> 00:06:44,920 so then when this chip was running software, possibly MITS Altair Basic, 85 00:06:45,640 --> 00:06:51,400 an alpha particle would get emitted, it would shift from 1s to 0s, and your perfectly running application would crash. 86 00:06:52,000 --> 00:06:52,660 This was a huge problem. 87 00:06:52,680 --> 00:06:55,740 They published a paper on this, and the semiconductor industry took note. 88 00:06:55,920 --> 00:06:57,220 They took this very seriously. 89 00:06:57,910 --> 00:07:00,140 And they refined manufacturing processes. 90 00:07:00,660 --> 00:07:04,060 And this certainly never happened again. Right, everyone? 91 00:07:05,820 --> 00:07:07,960 Fast forward to 2008. 92 00:07:08,680 --> 00:07:10,640 Sorry, not 2008, 2001. 93 00:07:11,080 --> 00:07:13,320 This is a Sun Ultra Spark II. 94 00:07:13,860 --> 00:07:17,340 The one in the slide is from 1997, but that's not what we're focused on. 95 00:07:18,620 --> 00:07:22,480 In 2001, a lot of very expensive Sun servers started, 96 00:07:22,480 --> 00:07:23,200 randomly failing. 97 00:07:23,580 --> 00:07:26,920 And this server would be running, then it would crash, you would reboot it, 98 00:07:27,000 --> 00:07:29,620 you would do a full self-test that would say it's perfect, 99 00:07:29,860 --> 00:07:31,920 and then later it would randomly die again. 100 00:07:32,460 --> 00:07:34,700 And naturally there were a lot of angry customers, 101 00:07:34,920 --> 00:07:37,440 and Sun started to check what the problem was, 102 00:07:37,560 --> 00:07:42,320 and it turned out it was radioactive contamination of their L1 and L2 cache. 103 00:07:43,060 --> 00:07:47,740 To make things worse, the L1 and L2 cache on the Ultra Sparks had no error detection, 104 00:07:47,980 --> 00:07:50,080 so the only time you'd realize something was wrong 105 00:07:50,080 --> 00:07:52,460 is when your mission-critical applications went down. 106 00:07:52,480 --> 00:07:55,900 But this had to be the last of it. 107 00:07:56,000 --> 00:07:58,960 There wouldn't really be something required, you know, 108 00:07:59,020 --> 00:08:03,580 no operating system ships something to test hardware with its installation, do they? 109 00:08:05,720 --> 00:08:07,380 This is an Ubuntu installation. 110 00:08:07,820 --> 00:08:08,880 It's a direct screen shot. 111 00:08:09,180 --> 00:08:10,920 One of the options is test memory. 112 00:08:11,520 --> 00:08:13,300 Why would you ever want to test memory? 113 00:08:14,020 --> 00:08:16,500 Because a lot of the times your test will fail. 114 00:08:21,180 --> 00:08:22,460 And this is only for a few reasons. 115 00:08:22,460 --> 00:08:24,300 The only people who would actually know that it would fail 116 00:08:24,300 --> 00:08:26,080 is the people who decided to run that test. 117 00:08:26,440 --> 00:08:29,300 Think about how many people are running with bad hardware components 118 00:08:29,300 --> 00:08:30,420 who don't even know it. 119 00:08:32,040 --> 00:08:34,560 And these bit errors have security implications. 120 00:08:35,040 --> 00:08:39,860 And these security implications range a lot further than just random data corruption. 121 00:08:40,200 --> 00:08:43,580 In fact, they range from things like sandbox escapes 122 00:08:43,580 --> 00:08:47,220 to extracting encryption keys out of proprietary devices. 123 00:08:48,780 --> 00:08:52,300 So, up first is a JVM sandbox. 124 00:08:52,460 --> 00:08:56,700 In 2003, Sudhakar and Apple of Princeton University 125 00:08:56,700 --> 00:09:00,660 published an extremely interesting paper in IEEE Security and Privacy. 126 00:09:01,020 --> 00:09:05,680 They had found a way to use random bit errors to escape out of the Java JVM sandbox. 127 00:09:06,380 --> 00:09:10,240 What they would do is, they would fill memory with two Java objects 128 00:09:10,240 --> 00:09:11,980 and references to those objects. 129 00:09:12,220 --> 00:09:13,740 And when a bit error would occur, 130 00:09:14,220 --> 00:09:17,340 it would change one of the references to point from one object to the other. 131 00:09:17,880 --> 00:09:21,300 Once you had two differently typed references to the same object, 132 00:09:21,480 --> 00:09:22,340 you could then, 133 00:09:22,460 --> 00:09:24,520 establish a write-what-where primitive, 134 00:09:24,700 --> 00:09:27,420 and once you write executable code to anywhere in memory, 135 00:09:27,600 --> 00:09:28,380 it was game over. 136 00:09:29,480 --> 00:09:31,160 To test their experiment, 137 00:09:31,380 --> 00:09:33,620 they couldn't exactly wait for a bit error to happen, 138 00:09:33,720 --> 00:09:35,840 so they devised the apparatus you see in this slide. 139 00:09:36,140 --> 00:09:40,340 That is a heat lamp attached and pointing at the RAM, 140 00:09:40,560 --> 00:09:44,180 and it would heat the RAM to above its critical operating temperature 141 00:09:44,180 --> 00:09:46,040 to where random bit errors would happen. 142 00:09:46,520 --> 00:09:49,520 They were able to verify their results experimentally. 143 00:09:51,300 --> 00:09:54,420 Next security implication is smart card piracy. 144 00:09:55,020 --> 00:10:00,020 There's actually an ongoing war between cable TV set-top box manufacturers 145 00:10:00,020 --> 00:10:01,180 and smart card pirates. 146 00:10:02,480 --> 00:10:05,620 Satellite signals are broadcast throughout and they're encrypted, 147 00:10:05,760 --> 00:10:09,840 and the way you view satellite TV is if you have the decryption key in a smart card. 148 00:10:10,240 --> 00:10:13,880 Well, pirates want to be able to decrypt those signals as well 149 00:10:13,880 --> 00:10:15,340 and sell knock-off smart cards. 150 00:10:15,620 --> 00:10:19,000 One of the ways in which they get to the encryption key 151 00:10:19,000 --> 00:10:22,040 in the smart card is they will attach to the smart card bus, 152 00:10:22,320 --> 00:10:26,080 and then they will induce a bit error in the smart card CPU, 153 00:10:26,460 --> 00:10:28,380 usually via direct electrical probing, 154 00:10:28,420 --> 00:10:31,140 to redirect execution to a pirate code, 155 00:10:31,360 --> 00:10:34,160 which will then proceed to dump RAM contents 156 00:10:34,160 --> 00:10:35,760 before it has a chance to lock itself. 157 00:10:38,040 --> 00:10:40,220 Now, there's other causes of bit errors 158 00:10:40,220 --> 00:10:43,020 besides probing by smart card pirates and heat lamps, 159 00:10:43,140 --> 00:10:45,360 and I'm going to get into four of them. 160 00:10:46,800 --> 00:10:48,980 So, cause number one is error. 161 00:10:49,000 --> 00:10:49,120 Number two is heat. 162 00:10:49,660 --> 00:10:54,140 It is a physical fact that heat affects properties of electrical devices, 163 00:10:54,220 --> 00:10:56,380 such as conductivity and resistivity. 164 00:10:57,440 --> 00:11:02,260 Now, this isn't too much of a problem in desktops and maybe even laptops 165 00:11:02,260 --> 00:11:05,500 because they're well-cooled and they're normally operated indoors, 166 00:11:05,880 --> 00:11:09,700 but when it comes to mobile devices, heat can be a serious issue. 167 00:11:10,560 --> 00:11:15,120 This is what happens when your iPhone gets too hot and eventually tells you. 168 00:11:15,680 --> 00:11:17,900 But did you ever wonder what happens, 169 00:11:19,000 --> 00:11:20,360 before the screen has a chance to come up, 170 00:11:20,400 --> 00:11:21,960 in devices that don't have one, 171 00:11:22,080 --> 00:11:25,720 or even under what temperature it comes on anyway? 172 00:11:26,740 --> 00:11:29,100 So, I've got a handy graph here for you guys. 173 00:11:29,800 --> 00:11:32,200 This is the iPhone operating temperature, 174 00:11:32,400 --> 00:11:33,920 as taken from the Apple website, 175 00:11:34,220 --> 00:11:37,000 plotted against two climates in North America, 176 00:11:37,240 --> 00:11:40,380 one here in Las Vegas and one in Montreal, Canada. 177 00:11:41,180 --> 00:11:44,980 Right now, since it's August, we are at the top of that blue curve. 178 00:11:45,200 --> 00:11:48,640 If you notice, it's well above the maximum iPhone operating temperature 179 00:11:49,000 --> 00:11:49,580 of 95 degrees. 180 00:11:50,240 --> 00:11:53,660 If you've used your iPhone outside today, congratulations, 181 00:11:54,080 --> 00:11:55,840 you've been violating its operating requirements. 182 00:12:01,660 --> 00:12:04,880 So, next cause of bit errors, electrical problems. 183 00:12:05,560 --> 00:12:07,400 This slide is actually very apt. 184 00:12:07,560 --> 00:12:10,080 When I found the picture, the caption for it was that 185 00:12:10,080 --> 00:12:15,080 this is the backup power supply for a group of computers in rural India. 186 00:12:15,600 --> 00:12:18,160 We are all accustomed to always-on, 187 00:12:18,160 --> 00:12:20,480 very good AC power in the Western world, 188 00:12:20,620 --> 00:12:22,920 but this isn't true for a lot of parts. 189 00:12:23,500 --> 00:12:26,280 Sometimes your power is extremely unreliable, 190 00:12:26,380 --> 00:12:27,480 intermittent or both, 191 00:12:27,660 --> 00:12:29,860 and sometimes your backups are car batteries. 192 00:12:32,500 --> 00:12:35,340 When you have extremely unreliable input voltage, 193 00:12:35,500 --> 00:12:37,800 odds are that extremely unreliable effects 194 00:12:37,800 --> 00:12:39,400 may propagate through your electronics. 195 00:12:40,780 --> 00:12:44,100 Sometimes, though, it's the electronics themselves that are faulty. 196 00:12:44,500 --> 00:12:47,260 The picture here is a pirate capacitor. 197 00:12:48,160 --> 00:12:50,680 This is actually entire websites on the internet 198 00:12:50,680 --> 00:12:55,220 dedicated to identifying faulty capacitors and common motherboards. 199 00:12:55,740 --> 00:12:58,040 Their list is a lot higher than you would think. 200 00:12:59,920 --> 00:13:03,020 Whenever they bid components out to the lowest bidder, 201 00:13:03,100 --> 00:13:05,300 sometimes they get exactly what they pay for. 202 00:13:06,720 --> 00:13:10,160 Capacitors also aren't the only electronic components that are pirated. 203 00:13:10,480 --> 00:13:13,880 There's knock-offs of all kinds of things sold on the black market, 204 00:13:13,980 --> 00:13:17,400 and sometimes, to skimp a buck or maybe pocket the difference, 205 00:13:18,160 --> 00:13:20,060 people making your electronics might not use the best ones. 206 00:13:21,060 --> 00:13:23,740 Even if they do use the very best components, 207 00:13:24,060 --> 00:13:28,080 as we saw earlier in the case of the Intel DRAMs and the Sun UltraSpark, 208 00:13:28,340 --> 00:13:30,980 sometimes they may just be radioactive contamination 209 00:13:30,980 --> 00:13:32,360 somewhere during manufacturing. 210 00:13:33,930 --> 00:13:35,320 And speaking of radiation, 211 00:13:35,640 --> 00:13:40,760 that brings us back to the last, but certainly not least, cause of bit errors, 212 00:13:40,940 --> 00:13:43,940 and that is cosmic rays. 213 00:13:45,020 --> 00:13:46,220 Yes, I'm serious. 214 00:13:48,760 --> 00:13:53,060 And I specifically mean the intergalactic kind, not the solar kind. 215 00:13:53,320 --> 00:13:55,640 From all the research I've been able to do, 216 00:13:55,740 --> 00:13:59,900 the solar kind are generally not energetic enough to penetrate the upper atmosphere, 217 00:14:00,080 --> 00:14:02,140 but the intergalactic ones certainly are. 218 00:14:03,520 --> 00:14:06,660 Potentially, far from being a remote nuisance, 219 00:14:06,900 --> 00:14:09,980 there are some studies that indicate that cosmic rays 220 00:14:09,980 --> 00:14:13,020 are actually the number one source of bit errors at ground level. 221 00:14:14,200 --> 00:14:17,920 This is a graph taken directly from the IBM Journal 222 00:14:18,160 --> 00:14:21,620 of Research and Development, volume 40, number 1, page 13, 223 00:14:21,800 --> 00:14:22,740 for those who are interested. 224 00:14:23,540 --> 00:14:28,480 And what it's plotting here is altitude versus cosmic ray flux, 225 00:14:28,800 --> 00:14:31,960 which go hand in hand as the higher up you go, 226 00:14:32,120 --> 00:14:35,180 the more cosmic rays there are since there is less atmosphere. 227 00:14:35,600 --> 00:14:38,520 And if you notice these circles and the triangles, 228 00:14:38,760 --> 00:14:43,880 those are actual experimentally observed errors in cache and main memory. 229 00:14:44,120 --> 00:14:47,160 If you notice, they align exactly with the prediction 230 00:14:47,160 --> 00:14:48,340 for the cosmic ray flux. 231 00:14:51,260 --> 00:14:55,080 Now, this IBM study ran from 1978 to 1994, 232 00:14:56,020 --> 00:14:59,660 so it's entirely possible newer generations of RAM are differently affected, 233 00:14:59,960 --> 00:15:02,620 but cosmic rays is definitely something you want to consider. 234 00:15:04,600 --> 00:15:10,040 So, what's the distribution of various causes of bit errors that I see in the wild? 235 00:15:10,740 --> 00:15:12,780 Honestly, I don't really know. 236 00:15:12,920 --> 00:15:16,060 I can't go halfway around the world and see what was wrong with somebody's iPhone. 237 00:15:17,160 --> 00:15:19,340 And it's entirely possible it's a cause I didn't consider. 238 00:15:19,620 --> 00:15:22,540 What is interesting to know is that these bit errors do happen, 239 00:15:22,640 --> 00:15:23,540 and they're real. 240 00:15:25,620 --> 00:15:27,620 We've mentioned DRAM for a bit, 241 00:15:27,720 --> 00:15:30,840 and I'm going to go into a little more in-depth discussion about DRAM. 242 00:15:31,680 --> 00:15:37,380 DRAM is the source of really great information density for bit errors to happen. 243 00:15:37,860 --> 00:15:40,680 It's hard to cool, the components are always cheap, 244 00:15:40,860 --> 00:15:46,080 and it happens to be where the previous majority of bit error studies have focused. 245 00:15:47,160 --> 00:15:48,720 So, I'll start off with some really good news. 246 00:15:49,300 --> 00:15:53,640 And the good news is that all errors in DRAM can be fixed 247 00:15:53,640 --> 00:15:56,760 by use of what is called ECC, or error correcting codes. 248 00:15:57,020 --> 00:16:00,980 And ECC can detect and fix all single bit errors. 249 00:16:01,280 --> 00:16:08,180 There's actually forms of ECC that will detect all 1, 2, 3, and 4 bit errors. 250 00:16:08,520 --> 00:16:12,400 But ECC only works if you actually use it. 251 00:16:13,600 --> 00:16:17,140 A lot of you in the audience probably manage extensive server farms, 252 00:16:17,160 --> 00:16:19,680 and those typically have ECC memory, 253 00:16:19,860 --> 00:16:24,260 since hardware manufacturers know that bit errors do happen, 254 00:16:24,400 --> 00:16:25,440 and especially high-end ones. 255 00:16:26,200 --> 00:16:30,300 But have you thought about all the RAM in your server? 256 00:16:31,660 --> 00:16:32,960 I'm going to go with no. 257 00:16:33,280 --> 00:16:39,240 This is a hard drive pulled from one of these enterprise class servers with ECC memory. 258 00:16:39,930 --> 00:16:43,820 That chip there highlighted in yellow is 128 megabit DRAM. 259 00:16:44,020 --> 00:16:45,860 It does not have ECC. 260 00:16:47,160 --> 00:16:49,060 And this drive is actually a few years old. 261 00:16:49,180 --> 00:16:50,960 It only has 16 megabytes of cache. 262 00:16:51,240 --> 00:16:54,840 Newer drives have 32 or even 64 megabytes of cache. 263 00:16:55,480 --> 00:16:59,220 And enterprise servers typically have 5 to 8 of these drives. 264 00:17:00,420 --> 00:17:06,020 So, the data in your enterprise class server may be going through a lot of non-ECC memory. 265 00:17:10,200 --> 00:17:13,000 Let's look at some DRAM failure rates. 266 00:17:13,100 --> 00:17:16,400 Now that we've established there's probably a little bit in your server somewhere. 267 00:17:17,660 --> 00:17:20,180 This slide summarizes two different studies. 268 00:17:20,500 --> 00:17:23,180 One from Terrazahn Semiconductor, 269 00:17:23,280 --> 00:17:25,780 and one from Schroeder at the University of Toronto, 270 00:17:26,080 --> 00:17:28,340 in association with some engineers from Google. 271 00:17:28,960 --> 00:17:32,860 And the first thing you notice is that the scale varies very widely. 272 00:17:33,080 --> 00:17:34,620 This is also a logarithmic scale. 273 00:17:35,000 --> 00:17:38,200 The lowest error rate is about 50, 274 00:17:38,360 --> 00:17:41,940 and the highest error rate is about 100,000 failures in test. 275 00:17:42,280 --> 00:17:47,140 And a failure in test is about one error in one billion operating systems. 276 00:17:47,160 --> 00:17:47,340 So, it's about 50,000 operating hours. 277 00:17:48,440 --> 00:17:53,260 Another interesting thing of note here is if you see the manufacturer one to manufacturer six columns, 278 00:17:53,480 --> 00:17:55,080 those are from the Schroeder study. 279 00:17:55,360 --> 00:18:00,160 And those were bit error rates measured in actual servers in Google data centers. 280 00:18:00,860 --> 00:18:06,860 One of their conclusions was also that the vast majority of bit errors could be attributed to specific DIMMs, 281 00:18:06,960 --> 00:18:08,560 counteracting the IBM study, 282 00:18:08,800 --> 00:18:14,000 and in fact suggesting that maybe manufacturing defects are in fact the number one cause of DRAM failures. 283 00:18:15,680 --> 00:18:20,520 But you don't typically think in terms of one failure in one billion operating hours, 284 00:18:20,720 --> 00:18:23,620 so let's put this in a more usable perspective. 285 00:18:24,420 --> 00:18:28,960 If you go to Dell.com, the cheapest PC you can buy will have four gigabytes of RAM. 286 00:18:29,820 --> 00:18:32,600 Assuming the worst case scenario from the previous slide, 287 00:18:32,820 --> 00:18:36,060 that PC will encounter approximately three bit errors per hour. 288 00:18:36,540 --> 00:18:40,940 Assuming the best case scenario, it will encounter approximately three bit errors per month. 289 00:18:42,020 --> 00:18:43,980 But also, it's not great. 290 00:18:44,000 --> 00:18:45,360 It's not right to think of just a single PC. 291 00:18:45,720 --> 00:18:50,660 What we want to see is the emergent effect of all the DRAM on the internet. 292 00:18:52,680 --> 00:18:58,400 And there are several studies that say that there are approximately five billion devices 293 00:18:58,400 --> 00:19:00,420 that are connected to the internet in 2010. 294 00:19:01,140 --> 00:19:05,240 Assuming each of these devices has 128 megabytes of RAM, 295 00:19:05,740 --> 00:19:08,700 and now this assumption isn't really based on scientific fact, 296 00:19:08,880 --> 00:19:13,880 I felt it was a very fair compromise between the servers that have multiple, multiple gigabytes, 297 00:19:14,000 --> 00:19:16,680 and your phone, which may have, you know, six to twenty. 298 00:19:17,300 --> 00:19:22,580 You will get approximately 600 petabytes of DRAM that is connected to the internet. 299 00:19:24,680 --> 00:19:29,100 And using the lower end error estimates from the previous slide, 300 00:19:29,740 --> 00:19:36,780 that's approximately 600,000 bit errors that occur daily in all the world's internet connected DRAM. 301 00:19:38,020 --> 00:19:42,240 Now, how many of those errors actually happen somewhere that is interesting? 302 00:19:44,000 --> 00:19:45,780 I set up an experiment to find out. 303 00:19:48,220 --> 00:19:50,860 And this experiment is in three parts. 304 00:19:51,620 --> 00:19:54,540 Part one, register domain names. 305 00:19:55,300 --> 00:19:58,440 This list includes actual domain names that I registered. 306 00:19:58,820 --> 00:20:02,740 They are one bit away from certain very popular domain names. 307 00:20:03,260 --> 00:20:06,880 By one bit away, I mean is you take the domain name, 308 00:20:06,980 --> 00:20:09,120 then you put it in its ASCII representation, 309 00:20:09,560 --> 00:20:11,580 you expand it out as a binary string, 310 00:20:11,820 --> 00:20:13,380 change ones to zeros, 311 00:20:14,000 --> 00:20:14,380 change zeros to ones. 312 00:20:14,560 --> 00:20:17,480 If it's still a valid domain name when you put it back to ASCII, 313 00:20:17,560 --> 00:20:18,320 you register it. 314 00:20:18,780 --> 00:20:22,060 And the domain names you pick tended to be those of popular websites, 315 00:20:22,360 --> 00:20:26,100 and more crucially, advertising and content delivery networks. 316 00:20:26,480 --> 00:20:30,660 And the reason they picked those is because nobody ever types those addresses in, 317 00:20:30,820 --> 00:20:33,820 but you certainly look them up an extremely large amount of time. 318 00:20:36,200 --> 00:20:39,420 Experiment step two is you have to properly answer DNS. 319 00:20:39,780 --> 00:20:41,200 And this is actually very important. 320 00:20:41,460 --> 00:20:43,280 And I'm going to go through this via an example. 321 00:20:44,360 --> 00:20:48,660 So let's say somebody out there is trying to resolve a domain name you registered. 322 00:20:48,980 --> 00:20:53,280 Let's say it's MIC2OSOFT.com, one bit away from Microsoft. 323 00:20:53,660 --> 00:20:55,620 So you're going to get an A record request, 324 00:20:56,220 --> 00:20:57,760 and of course you'll answer it. 325 00:20:58,500 --> 00:21:02,800 But the trick here is that we think that a bit error happened somewhere 326 00:21:02,800 --> 00:21:05,940 on that server that asked you for the domain name. 327 00:21:06,260 --> 00:21:09,260 Therefore, we will also send it back a second reply 328 00:21:09,260 --> 00:21:11,940 for the original domain we expected it to be. 329 00:21:12,740 --> 00:21:13,980 And the reason we do this, 330 00:21:14,000 --> 00:21:17,820 is because if it's expecting a reply for Microsoft.com, 331 00:21:18,020 --> 00:21:21,160 it will discard the reply for MIC2OSOFT.com, 332 00:21:21,300 --> 00:21:23,120 but silently accept the Microsoft one. 333 00:21:23,420 --> 00:21:26,280 If it did indeed query MIC2OSOFT.com, 334 00:21:26,460 --> 00:21:27,580 it will accept that reply, 335 00:21:27,820 --> 00:21:29,500 but discard the Microsoft reply. 336 00:21:31,300 --> 00:21:32,320 In an overview, 337 00:21:32,920 --> 00:21:36,860 for every DNS request you receive, 338 00:21:37,160 --> 00:21:38,960 you have to send back two responses. 339 00:21:39,520 --> 00:21:41,140 And this isn't just A records. 340 00:21:41,400 --> 00:21:43,840 This is also other types of records, 341 00:21:44,000 --> 00:21:45,120 such as NS requests. 342 00:21:48,960 --> 00:21:51,140 Assuming your bit squatting was successful, 343 00:21:51,520 --> 00:21:53,280 next thing that's going to happen is 344 00:21:53,280 --> 00:21:54,740 you will get an HTTP request. 345 00:21:55,060 --> 00:21:57,680 So you set up an HTTP listener, 346 00:21:57,820 --> 00:22:00,240 and you log the connection. 347 00:22:01,160 --> 00:22:02,340 And in this case, 348 00:22:02,440 --> 00:22:05,500 I chose to return HTTP 404 not found 349 00:22:05,500 --> 00:22:07,180 for every single request I received, 350 00:22:07,400 --> 00:22:10,360 since I wanted to avoid causing any damage 351 00:22:10,360 --> 00:22:11,480 to any of the requesting computers. 352 00:22:12,440 --> 00:22:14,740 Once again, that's you get a request, 353 00:22:15,020 --> 00:22:16,300 you log the request, 354 00:22:16,620 --> 00:22:17,960 you send it back a 404, 355 00:22:18,140 --> 00:22:19,260 and you close the connection. 356 00:22:20,560 --> 00:22:22,560 Then this is how I set up my experiment. 357 00:22:23,440 --> 00:22:26,620 And the first thing that really surprised me 358 00:22:26,620 --> 00:22:28,920 is that people actually show up. 359 00:22:29,800 --> 00:22:33,180 This is the traffic volume of raw HTTP requests 360 00:22:33,180 --> 00:22:34,440 for a six-month period 361 00:22:34,440 --> 00:22:37,200 from the end of September to the beginning of May. 362 00:22:38,060 --> 00:22:39,080 As you can see, 363 00:22:39,160 --> 00:22:41,460 there is a steady background streamer 364 00:22:41,480 --> 00:22:44,360 of requests punctuated by several extreme spikes, 365 00:22:44,520 --> 00:22:46,300 the biggest of which was approximately 366 00:22:46,300 --> 00:22:48,740 3,500 HTTP requests per day. 367 00:22:49,540 --> 00:22:52,580 But raw requests isn't necessarily a fair comparison 368 00:22:52,580 --> 00:22:54,880 since, you know, maybe some machines out there 369 00:22:54,880 --> 00:22:56,780 get in a loop when you have one guy requesting 370 00:22:56,780 --> 00:22:58,640 the same resource over and over again. 371 00:22:59,120 --> 00:23:02,040 So here instead is the traffic volume 372 00:23:02,040 --> 00:23:03,980 by unique IP address per day. 373 00:23:05,280 --> 00:23:06,680 Some of the peaks disappear, 374 00:23:07,360 --> 00:23:08,780 but others still remain. 375 00:23:09,640 --> 00:23:11,460 Aside from the steady volume 376 00:23:11,480 --> 00:23:12,580 and steady stream of background noise, 377 00:23:13,400 --> 00:23:14,720 there's three major events 378 00:23:15,280 --> 00:23:17,720 labeled here as A, B, and C, 379 00:23:18,460 --> 00:23:20,460 each of these caused by bit squatting, 380 00:23:20,540 --> 00:23:23,580 and I will get into detail of these in the next few slides. 381 00:23:24,080 --> 00:23:26,920 So what caused event A 382 00:23:26,920 --> 00:23:31,200 that affected more than 1,600 unique IPs 383 00:23:32,200 --> 00:23:33,160 on the Internet? 384 00:23:33,640 --> 00:23:36,760 And that critical application happens to be 385 00:23:38,020 --> 00:23:38,580 FarmVille. 386 00:23:39,660 --> 00:23:40,700 Yes, I'm serious. 387 00:23:43,500 --> 00:23:45,960 The reason this says 1,300 IPs 388 00:23:45,960 --> 00:23:48,220 is because it could only attribute 1,300 of those 389 00:23:48,220 --> 00:23:49,180 directly to FarmVille, 390 00:23:49,980 --> 00:23:53,240 but the other 300 are also of similar causes. 391 00:23:55,560 --> 00:23:57,500 So how exactly does this happen? 392 00:23:57,980 --> 00:23:59,760 Well, let's diagram this out. 393 00:24:00,400 --> 00:24:02,640 Let's pretend you're a user somewhere 394 00:24:02,640 --> 00:24:04,520 and you want to go play some FarmVille. 395 00:24:06,200 --> 00:24:08,640 Then you request some stuff from Facebook 396 00:24:08,640 --> 00:24:10,260 and a bit error happens 397 00:24:10,260 --> 00:24:13,240 in either the Facebook or the FarmVille servers, 398 00:24:13,380 --> 00:24:17,440 and profile.aka.fbcdn.net 399 00:24:17,440 --> 00:24:22,440 changes to pbofile.aka.fbbdn.net. 400 00:24:23,080 --> 00:24:25,880 I happen to own fbbdn.net, 401 00:24:26,060 --> 00:24:28,600 and this bit error happens to happen 402 00:24:28,600 --> 00:24:30,860 in the URL of an ad server, 403 00:24:31,100 --> 00:24:34,520 and this URL gets cached 404 00:24:34,520 --> 00:24:36,980 and then served up to the 1,300 people 405 00:24:36,980 --> 00:24:38,540 who keep requesting that resource. 406 00:24:42,380 --> 00:24:45,280 Instead of requesting ads from FarmVille, 407 00:24:45,400 --> 00:24:47,100 they're requesting ads from me. 408 00:24:47,660 --> 00:24:49,740 I could have sent them anything I wanted, 409 00:24:49,800 --> 00:24:51,860 but I chose the 404. 410 00:24:53,760 --> 00:24:54,880 Once again, an overview. 411 00:24:55,300 --> 00:24:56,620 You're doing nothing wrong, 412 00:24:56,780 --> 00:24:57,960 going to play some FarmVille. 413 00:24:58,240 --> 00:25:00,920 A bit error happens somewhere outside of your control 414 00:25:00,920 --> 00:25:03,380 in either Facebook or the FarmVille servers. 415 00:25:03,820 --> 00:25:05,560 This bit error gets cached, 416 00:25:05,660 --> 00:25:07,780 served up to 1,300 people, 417 00:25:07,780 --> 00:25:11,200 and those 1,300 people request ads from me 418 00:25:11,200 --> 00:25:12,280 instead of from FarmVille. 419 00:25:13,460 --> 00:25:15,100 And that's event A. 420 00:25:15,220 --> 00:25:18,700 And event B was 456 unique IPs, 421 00:25:18,740 --> 00:25:23,240 and the cause of that was also FarmVille. 422 00:25:27,100 --> 00:25:29,960 The reasoning behind it was actually 423 00:25:29,960 --> 00:25:31,340 also pretty much the same, 424 00:25:31,440 --> 00:25:33,300 except the bit error here was different. 425 00:25:33,800 --> 00:25:35,220 You would play FarmVille, 426 00:25:35,360 --> 00:25:37,760 bit error changes FBCDN, 427 00:25:37,780 --> 00:25:40,280 FBGDN.net to FBGDN.net. 428 00:25:40,520 --> 00:25:42,640 Once again, this bit error gets cached 429 00:25:42,640 --> 00:25:44,360 somewhere in the FarmVille cache, 430 00:25:44,580 --> 00:25:47,140 gets served up to 130 different people 431 00:25:47,140 --> 00:25:48,800 who request ads from me. 432 00:25:49,300 --> 00:25:50,740 And of course, you don't have to send them ads. 433 00:25:50,940 --> 00:25:52,320 I chose to send 404s, 434 00:25:52,320 --> 00:25:53,800 but there's no reason somebody malicious 435 00:25:53,800 --> 00:25:55,740 couldn't send them some choice JavaScript. 436 00:25:58,860 --> 00:26:00,980 And that's it for event B. 437 00:26:01,700 --> 00:26:05,060 And event C is actually the most interesting one of all, 438 00:26:05,140 --> 00:26:07,220 and I promise it's actually not FarmVille. 439 00:26:07,220 --> 00:26:11,160 And it affected 246 unique IPs. 440 00:26:12,640 --> 00:26:14,240 What's interesting about event C 441 00:26:14,240 --> 00:26:17,660 is that it's an actual case of DNS poisoning 442 00:26:17,660 --> 00:26:19,520 caused by random bit errors. 443 00:26:20,320 --> 00:26:23,180 And I have an, after looking through the logs 444 00:26:23,180 --> 00:26:25,140 for the days of event C, 445 00:26:25,320 --> 00:26:27,440 I noticed that all of the requests 446 00:26:27,440 --> 00:26:29,000 for those few days were, 447 00:26:29,140 --> 00:26:31,040 one, from the same slash 24, 448 00:26:31,640 --> 00:26:34,420 and two, they were all for the same server. 449 00:26:34,720 --> 00:26:37,120 And here is approximately what happened. 450 00:26:37,220 --> 00:26:40,280 So, you're someone in that slash 24. 451 00:26:40,620 --> 00:26:45,760 You request your ISP to resolve s0.2mdn.net. 452 00:26:48,100 --> 00:26:51,240 A bit error occurs somewhere in your ISP's 453 00:26:51,240 --> 00:26:52,240 recursive domain server. 454 00:26:52,910 --> 00:26:56,060 Instead of requesting s0.2mdn.net, 455 00:26:56,220 --> 00:27:00,380 you request to resolve s0.2-dn.net, 456 00:27:00,500 --> 00:27:01,800 which I happen to own. 457 00:27:02,860 --> 00:27:04,360 If you recall from before, 458 00:27:04,580 --> 00:27:06,280 we always send two DNS replies. 459 00:27:07,220 --> 00:27:08,800 One of the replies we're going to send back 460 00:27:08,800 --> 00:27:11,340 is for s0.2mdn.net. 461 00:27:11,760 --> 00:27:13,360 This reply is going to, one, 462 00:27:13,460 --> 00:27:15,320 get cached in the DNS server, 463 00:27:15,480 --> 00:27:18,320 and two, get propagated to the original request store, 464 00:27:18,480 --> 00:27:22,200 who will then request an add from me 465 00:27:22,200 --> 00:27:24,040 instead of from 2mdn. 466 00:27:24,780 --> 00:27:26,740 And I will send them a 404, 467 00:27:26,840 --> 00:27:28,540 but, of course, you can be more creative. 468 00:27:30,280 --> 00:27:32,660 As a full overview of the entire process, 469 00:27:33,340 --> 00:27:34,960 you are browsing some website. 470 00:27:35,100 --> 00:27:36,300 You request an add. 471 00:27:36,300 --> 00:27:39,780 Your local ISP's DNS server cache happens to be empty. 472 00:27:40,060 --> 00:27:43,980 It queries instead s0.2-dn.net. 473 00:27:44,160 --> 00:27:45,060 I own that. 474 00:27:45,300 --> 00:27:47,460 I answer DNS authoritatively for it. 475 00:27:47,520 --> 00:27:51,200 And I say, hey, here's the IP address for s0.2mdn.net. 476 00:27:51,380 --> 00:27:53,640 That gets propagated, that gets cached, 477 00:27:54,280 --> 00:27:55,560 propagated to the original requester, 478 00:27:55,680 --> 00:27:58,200 and now everybody in that slash 24, 479 00:27:58,540 --> 00:28:01,020 when they're requesting s0.2mdn.net, 480 00:28:01,180 --> 00:28:03,680 will instead request, will instead get my IP 481 00:28:04,260 --> 00:28:05,280 instead of the original one, 482 00:28:05,280 --> 00:28:07,180 until the DNS cache expires. 483 00:28:08,440 --> 00:28:11,580 So that concludes the three outlier events. 484 00:28:12,140 --> 00:28:15,060 And if you look at the traffic without outliers, 485 00:28:15,180 --> 00:28:18,820 you see that it's generally just a random trickle of requests. 486 00:28:19,200 --> 00:28:22,420 But even this, you can see by the blue line 487 00:28:22,420 --> 00:28:24,740 that there is an average of 59 requests. 488 00:28:25,340 --> 00:28:29,540 This is 59 requests with only 32 domains. 489 00:28:29,860 --> 00:28:32,500 This can easily be linearly scaled up 490 00:28:32,500 --> 00:28:34,640 by any sort of organized person. 491 00:28:39,380 --> 00:28:42,400 Next thing I wanted to do after measuring the traffic volume 492 00:28:42,400 --> 00:28:45,200 was to see the volume per hour. 493 00:28:45,880 --> 00:28:49,340 My intuition here was that there would be more bit errors 494 00:28:49,340 --> 00:28:51,120 when it's hotter outside during the day. 495 00:28:51,820 --> 00:28:54,560 Unfortunately, it also turns out that most people 496 00:28:54,560 --> 00:28:55,980 use their computers during the day, 497 00:28:56,040 --> 00:28:58,900 so it's impossible for me to separate the causes due to heat 498 00:28:58,900 --> 00:29:00,820 from simply more traffic use. 499 00:29:01,100 --> 00:29:04,140 But it is very interesting that this graph 500 00:29:04,140 --> 00:29:06,820 approximately mirrors North American internet traffic. 501 00:29:07,180 --> 00:29:10,880 And this only includes the traffic from those IPs 502 00:29:10,880 --> 00:29:13,360 that are geolocated within the United States. 503 00:29:14,400 --> 00:29:19,420 There is a steady start of traffic about 8 Eastern. 504 00:29:19,680 --> 00:29:22,900 It goes and levels off at about 2 PM 505 00:29:22,900 --> 00:29:25,140 and stays steady up until midnight 506 00:29:25,140 --> 00:29:26,520 where it rapidly drops off, 507 00:29:26,660 --> 00:29:28,080 only to resume again the next morning. 508 00:29:32,100 --> 00:29:34,060 Next thing I was curious about is, 509 00:29:34,140 --> 00:29:37,400 what operating system are all of these users using? 510 00:29:37,880 --> 00:29:40,500 So I have their user agent header, 511 00:29:40,600 --> 00:29:42,600 which conveniently tells me browser and operating system. 512 00:29:42,900 --> 00:29:46,080 So I decided to compare the operating system 513 00:29:46,080 --> 00:29:48,220 of people visiting my BitSquad domains 514 00:29:48,220 --> 00:29:52,160 to the people visiting Wikipedia for March of 2011. 515 00:29:53,100 --> 00:29:54,740 I'll start off with the commonalities. 516 00:29:55,000 --> 00:29:58,700 So there's a giant common share of Windows boxes, 517 00:29:58,800 --> 00:29:59,900 which is to be expected. 518 00:30:00,040 --> 00:30:01,820 Windows is the most popular OS. 519 00:30:02,420 --> 00:30:04,120 Then there's about 3.5 million 520 00:30:04,140 --> 00:30:08,220 2% iPhones, 1% Linux users, and 1% Android. 521 00:30:08,840 --> 00:30:11,280 Now, the differences is what's really striking. 522 00:30:11,740 --> 00:30:15,280 First, for some reason, only 2% of the visitors 523 00:30:15,280 --> 00:30:17,800 to my BitSquad domains use Apple OSX, 524 00:30:17,880 --> 00:30:20,160 whereas 8% of the visitors to Wikipedia do. 525 00:30:20,920 --> 00:30:23,620 I do not have a conclusive explanation for this. 526 00:30:23,840 --> 00:30:28,560 My thoughts think from a potentially better build quality 527 00:30:28,560 --> 00:30:32,400 to maybe the aluminum casing being a better cosmic ray shield. 528 00:30:32,600 --> 00:30:33,560 Not really sure. 529 00:30:36,560 --> 00:30:40,700 And the crucial thing here is that other field. 530 00:30:40,940 --> 00:30:44,000 The other field for BitSquads is 5%, 531 00:30:44,000 --> 00:30:46,860 whereas the other field for Wikipedia is 2%. 532 00:30:46,860 --> 00:30:50,420 So I looked at the user agent of these others, 533 00:30:50,520 --> 00:30:54,240 and this is all kinds of handheld mobile devices 534 00:30:54,240 --> 00:30:55,220 and gaming platforms. 535 00:30:55,860 --> 00:30:59,340 Things I saw were Wiis, PlayStation 3s, 536 00:30:59,440 --> 00:31:03,180 PSPs, Sony Ericsson phones, Samsung phones, 537 00:31:03,180 --> 00:31:04,620 and other devices. 538 00:31:05,000 --> 00:31:07,400 And a lot of these phones also really like telling you 539 00:31:07,400 --> 00:31:08,940 what carrier they're on for some reason. 540 00:31:09,220 --> 00:31:11,120 Not sure of the logic behind that. 541 00:31:14,760 --> 00:31:17,920 Next I wanted to know, so where are these people coming from? 542 00:31:19,320 --> 00:31:22,500 At first I graphed this for all of the visitors, 543 00:31:22,740 --> 00:31:25,300 but I chose to limit it to Microsoft.com 544 00:31:25,300 --> 00:31:26,840 since some of the sites in BitSquad 545 00:31:26,840 --> 00:31:28,960 are disproportionately popular in the United States. 546 00:31:29,880 --> 00:31:32,160 I figured Microsoft would be a good target, 547 00:31:32,160 --> 00:31:34,180 since the vast majority of DNS lookups 548 00:31:34,180 --> 00:31:36,940 would in fact be from automated Windows machines. 549 00:31:37,660 --> 00:31:39,940 The results here are actually extremely surprising. 550 00:31:40,280 --> 00:31:42,300 They do not correspond to population, 551 00:31:42,700 --> 00:31:45,000 they do not correspond to number of Internet devices, 552 00:31:45,320 --> 00:31:48,540 and they do not correspond to number of Internet users. 553 00:31:49,780 --> 00:31:52,400 I don't have a solid explanation for this. 554 00:31:52,540 --> 00:31:56,100 My only guesses include potentially that, 555 00:31:56,140 --> 00:31:59,080 as we saw from before, not all BitSquads are equal. 556 00:31:59,280 --> 00:32:01,460 Sometimes you win the BitSquad lottery 557 00:32:01,460 --> 00:32:03,100 and get some server in Farmville, 558 00:32:03,260 --> 00:32:05,440 sometimes you just BitSquad somebody's iPhone. 559 00:32:06,100 --> 00:32:09,220 It's entirely possible that it just happened to BitSquad 560 00:32:09,220 --> 00:32:12,100 more useful places in China and Brazil. 561 00:32:16,180 --> 00:32:18,040 But this definitely warrants further research 562 00:32:18,040 --> 00:32:20,020 to see exactly what the issue is. 563 00:32:21,620 --> 00:32:23,220 Next what I looked at was, 564 00:32:23,380 --> 00:32:25,260 which domain are these people looking up? 565 00:32:25,700 --> 00:32:27,360 And this includes outliers, 566 00:32:27,460 --> 00:32:30,320 so of course Facebook is by far and away the crowd favorite. 567 00:32:30,840 --> 00:32:31,440 . . . 568 00:32:31,460 --> 00:32:43,780 . . . 569 00:32:43,780 --> 00:32:44,580 . . . . 570 00:32:44,580 --> 00:32:45,020 . . . . 571 00:32:45,020 --> 00:32:45,660 . . . . 572 00:32:45,660 --> 00:32:45,840 . . . . 573 00:32:45,840 --> 00:32:45,900 . . . . 574 00:32:45,900 --> 00:32:47,580 . . . . 575 00:32:47,580 --> 00:32:48,080 . . . . 576 00:32:48,080 --> 00:32:48,260 . . . . 577 00:32:48,260 --> 00:32:48,720 . . . . 578 00:32:48,720 --> 00:32:48,900 . . . . 579 00:32:48,900 --> 00:32:49,220 . . . . 580 00:32:49,220 --> 00:32:49,300 . . . . 581 00:32:49,300 --> 00:32:49,780 . . . . 582 00:32:49,780 --> 00:32:49,880 . . . 583 00:32:49,880 --> 00:32:50,380 . . . 584 00:32:50,380 --> 00:32:50,480 . . . 585 00:32:50,480 --> 00:32:55,260 . . . 586 00:33:01,460 --> 00:33:07,140 where bit errors can happen. There's two different places. One of these is the DNS path, and 587 00:33:07,140 --> 00:33:11,520 this happens during name resolution. And one of these is the content path, which occurs 588 00:33:11,880 --> 00:33:18,960 before DNS ever has a chance to work. We'll start off with the DNS path. And this is best 589 00:33:18,960 --> 00:33:28,460 illustrated by example. So you request FBCDN.net from your ISP. A bit error occurs in your 590 00:33:28,460 --> 00:33:36,420 ISP's DNS server, and instead it requests FBBDN.net. I own FBBDN.net. I send two DNS 591 00:33:36,420 --> 00:33:41,620 replies. One of these is for the original domain, and this domain reply gets propagated back 592 00:33:41,620 --> 00:33:47,600 to the original requester. Then, this is crucial, the original requester will make an HTTP 593 00:33:47,600 --> 00:33:53,180 request to me. I don't know how many of you are familiar with the HTTP 1.1 protocol, but 594 00:33:53,180 --> 00:33:58,320 HTTP 1.1 requires that you use the host header, and the host header contains the 595 00:33:58,320 --> 00:34:03,840 domain that you are actually ‑‑ you think you're connecting to. So in the case of bit 596 00:34:03,840 --> 00:34:10,680 errors during DNS, I will see a host header of the original domain in my HTTP logs. And, 597 00:34:10,760 --> 00:34:13,220 of course, then you can send them whatever you'd want back. 598 00:34:14,740 --> 00:34:22,240 Once again, as an overview, you request FBCDN.net. A bit error occurs somewhere in the DNS resolution 599 00:34:22,240 --> 00:34:26,020 path, and what ends up being requested is FBBDN.net. 600 00:34:27,080 --> 00:34:28,300 The bad reply is FBBDN.net. The bad reply is FBBDN.net. The bad reply is FBBDN.net. 601 00:34:28,300 --> 00:34:28,540 The bad reply is FBBDN.net. The bad reply is FBBDN.net. The bad reply is FBBDN.net. 602 00:34:28,540 --> 00:34:31,920 After that, the API gets propagated to the original requester who then makes an HTTP 603 00:34:31,920 --> 00:34:37,880 connection and crucially in their host header uses FBCDN.net, the original domain. 604 00:34:39,800 --> 00:34:47,680 Now, on to bit errors in the content path, and the content path is the farmville type 605 00:34:47,680 --> 00:34:54,480 bit errors. So you're somebody browsing something like Facebook. A bit error happens somewhere 606 00:34:54,480 --> 00:34:57,040 in the extensive Facebook memory caching infrastructure. 607 00:34:57,040 --> 00:35:01,200 structure. And let's say it's, you know, for a JavaScript you're about to pull from it. 608 00:35:01,340 --> 00:35:09,640 And the domain changes from FBCDN.net to FBBDN.net. Then you will connect to my BitSquad server 609 00:35:10,160 --> 00:35:16,100 and in your host header you will say FBBDN.net because the bit error occurred before you 610 00:35:16,100 --> 00:35:21,960 ever looked the domain name up. You are bound to connect to FBBDN.net because of the bit 611 00:35:21,960 --> 00:35:27,060 error happened in the actual content. And now this content didn't actually have to get 612 00:35:27,060 --> 00:35:32,100 corrupted somewhere on the server end. It could have entirely been corrupted in, let's 613 00:35:32,100 --> 00:35:38,860 say, the memory of your iPhone. Afterwards, I send them back a reply. And as an overview, 614 00:35:39,180 --> 00:35:44,800 you're browsing Facebook. A bit error happens somewhere in the content, either on the cache 615 00:35:45,220 --> 00:35:49,640 or maybe somewhere in your memory or maybe when you're parsing HTML. And crucially, 616 00:35:49,740 --> 00:35:51,940 when you make the HTTP request, it's going to be a bit error. 617 00:35:51,940 --> 00:35:55,700 Your host header has the BitSquad domain and not the original domain. 618 00:35:57,160 --> 00:36:04,580 So what's the actual breakdown of these that we see? 96% of the time, and this includes 619 00:36:04,580 --> 00:36:10,320 the outliers since they were actually caused by bit errors, 96% of the time the host header 620 00:36:10,320 --> 00:36:15,160 that I see is the BitSquad host header. That means that all of the security research that 621 00:36:15,160 --> 00:36:21,820 we've been doing for DNS would not fix it. What we need is research on ensuring content 622 00:36:21,820 --> 00:36:29,260 integrity. The other 4% of the time, the error happens along the DNS path. And if you look, 623 00:36:29,380 --> 00:36:34,060 1% of the domains aren't the BitSquad domain. They're not the original domain. They're, 624 00:36:34,140 --> 00:36:39,880 in fact, the other domain, such as the MSN.com that we saw earlier. And the reason this 625 00:36:39,880 --> 00:36:51,120 occurs is because of CNAME chains. This is an actual example that I observed. In a CNAME 626 00:36:51,820 --> 00:36:57,220 domain, when you want to resolve a domain, the domain is actually says, hey, I'm a canonical 627 00:36:57,220 --> 00:37:01,800 name for this other domain. And that domain is a canonical name for yet another one. And 628 00:37:01,800 --> 00:37:07,080 you follow this chain until you finally resolve a domain to an IP. If a bit error occurs anywhere 629 00:37:07,080 --> 00:37:12,200 following the CNAME chain, you will get redirected to a BitSquad domain instead of the original 630 00:37:12,200 --> 00:37:20,800 domain. And that's how I was able to get requests for Microsoft and this guy for ax.init.iTunes.apple.com. 631 00:37:21,980 --> 00:37:24,520 Despite the fact that I did not BitSquad those domains. 632 00:37:26,200 --> 00:37:32,900 So speaking of other domains, it's time for a series of real life examples. I apologize 633 00:37:32,900 --> 00:37:38,280 if this is really small, but I couldn't think of a way to better convey it. So sorry for 634 00:37:38,280 --> 00:37:45,060 those of you in the back. The very top request is, of course, for ax.init.iTunes.apple.com. 635 00:37:45,540 --> 00:37:50,680 And I believe that person is actually trying to activate their iPhone. I can only assume 636 00:37:50,680 --> 00:37:51,160 they were unsuccessful. 637 00:37:54,980 --> 00:37:58,820 There is a few of these for ‑‑ there is one for AddMob, and there is a few for 638 00:37:58,820 --> 00:38:04,320 MSN. I want to note that this is not an exhaustive list of the ones I saw. I saw quite a bit 639 00:38:04,320 --> 00:38:06,680 more of these. These are just the ones they chose to include. 640 00:38:07,680 --> 00:38:14,540 Next up is people browsing Facebook. These are people requesting JavaScript from me while 641 00:38:14,540 --> 00:38:16,400 they're logged in to and browsing their 642 00:38:21,160 --> 00:38:25,060 doesn't take a lot of thinking to figure out that you can extremely easily steal their 643 00:38:25,060 --> 00:38:29,960 Facebook session cookies, send them some phishing pages or do other really malicious activity. 644 00:38:31,820 --> 00:38:41,240 Next up is people requesting Windows updates. Some of these are for the initial Windows 645 00:38:41,240 --> 00:38:46,760 update self-updater, but if you see that bottom one is somebody is actually requesting an 646 00:38:46,760 --> 00:38:53,440 XE from my server instead of the Windows update server. I really hope they verify those signatures. 647 00:38:58,500 --> 00:39:04,820 Next up, people browsing their Web mail and requesting ads from me while they're logged 648 00:39:04,820 --> 00:39:11,520 into their Web mail session. This is also not an exhaustive list, but I hope you'll 649 00:39:11,520 --> 00:39:15,980 recognize the dangers of this if you have JavaScript running when you're logged into 650 00:39:15,980 --> 00:39:16,740 your Web mail session. 651 00:39:16,760 --> 00:39:23,620 I can potentially steal your Web mail credentials. That's not a good thing. Also, the two examples 652 00:39:23,620 --> 00:39:28,120 here from live.com, I don't want to pick on them. I got lots of requests from various 653 00:39:28,120 --> 00:39:31,700 Web mail sessions. These are just the ones that I happened to find first and put in. 654 00:39:34,220 --> 00:39:44,560 Next example, Dr. Watson crash reports. So one of the biggest criticisms I got during 655 00:39:44,560 --> 00:39:46,740 this entire thing was that, hey, this is not a good thing. This is not a good thing. 656 00:39:46,740 --> 00:39:51,640 These things can't possibly be legitimate because you're going to ‑‑ whenever a 657 00:39:51,640 --> 00:39:56,080 machine encounters bit errors, it's just going to crash and it will die before you 658 00:39:56,080 --> 00:40:00,700 ever see anything useful. Well, I'm sure that certainly happens a very large percentage 659 00:40:00,700 --> 00:40:06,100 of the time, but some of the time the machine crashes and you can get something useful out 660 00:40:06,100 --> 00:40:09,840 of it. Interestingly enough, I don't know if you're 661 00:40:09,840 --> 00:40:14,840 familiar with Windows error reporting, but the server on the other end can actually potentially 662 00:40:14,840 --> 00:40:16,720 request a full memory dump. So if you're familiar with Windows error reporting, you can request 663 00:40:16,740 --> 00:40:20,600 a full memory dump from your machine. So if this happened to you, I could have potentially 664 00:40:20,600 --> 00:40:22,820 requested you to send me the contents of your RAM. 665 00:40:26,660 --> 00:40:33,240 My favorite is actually that second one. It's a Watson report from notepad.exe. We 666 00:40:33,240 --> 00:40:41,040 all know how unreliable that process is. So now that we've seen that these things 667 00:40:41,040 --> 00:40:46,540 happen, that they're very serious, let's talk about some mitigations. We'll start with 668 00:40:46,740 --> 00:40:54,100 mitigation number one, and that is ECC on everything. If you're in this room and you're 669 00:40:54,100 --> 00:40:59,260 in the charge of a bill of materials for the next mobile device, the next laptop, desktop, 670 00:40:59,740 --> 00:41:05,060 the next server, please make sure you use ECC memory everywhere. That includes things 671 00:41:05,060 --> 00:41:13,860 such as your drive and your NIC and maybe your keyboard controller. Next mitigation, 672 00:41:15,680 --> 00:41:16,620 pre‑register domain. 673 00:41:16,740 --> 00:41:22,920 This is actually the easiest you can do, since bit squatting affects a very small percentage 674 00:41:22,920 --> 00:41:29,820 of all domain lookups. If you own a really, really popular domain, you also have the most 675 00:41:29,820 --> 00:41:34,540 money to register potential bit squats of that domain. There's actually a quick upper 676 00:41:34,540 --> 00:41:39,880 bound you can place on this. If you're only looking at single‑bit errors, the most possible 677 00:41:39,880 --> 00:41:45,500 bit squats that can exist is six times the amount of letters in your domain. That's only 678 00:41:45,500 --> 00:41:46,520 for single‑bit errors. 679 00:41:46,520 --> 00:41:53,380 The great thing about pre‑registering is, one, you can do it right now. Two, it'll help 680 00:41:53,380 --> 00:41:58,760 all your users, even your users running in some really hot climate, in really terrible 681 00:41:58,760 --> 00:42:00,680 power supplies with a really bad computer. 682 00:42:06,580 --> 00:42:15,380 Mitigation number three, trust but verify your data. As we noticed earlier, 96% of these 683 00:42:15,380 --> 00:42:16,500 bit errors occur during the day. That's a lot of data. That's a lot of information. 684 00:42:17,640 --> 00:42:18,240 It's a lot of work. 685 00:42:18,240 --> 00:42:22,400 If you're somebody here responsible for building a really large memory caching infrastructure, 686 00:42:22,860 --> 00:42:27,140 you should check that what you put in your cache is actually what comes out of the cache 687 00:42:27,140 --> 00:42:28,280 when somebody requests it. 688 00:42:30,660 --> 00:42:37,320 Please include something like a CRC32 with every cached element. Modern CPUs actually 689 00:42:37,320 --> 00:42:42,780 have a CRC32 instruction, so performing this should actually be extremely quick. And you're 690 00:42:42,780 --> 00:42:44,980 probably going to be bound by network delay anyway. 691 00:42:45,660 --> 00:42:46,500 The next item is a lot of information. This is something we put a lot of stress on. Hopefully 692 00:42:46,500 --> 00:42:50,200 place where you should consider doing this is if you're developing mobile 693 00:42:50,200 --> 00:42:53,820 devices or something else that's going to work in high stress environments 694 00:42:53,820 --> 00:42:59,820 please be sure to verify things like the integrity of your outgoing DNS queries 695 00:43:06,440 --> 00:43:11,800 some room for future research previously it's only been possible to bit squat 696 00:43:11,800 --> 00:43:18,100 second-level domain names but I can has approved generic TLDs it'd be entirely 697 00:43:18,100 --> 00:43:22,760 possible for somebody to I don't know register dot-com for conferences and 698 00:43:22,760 --> 00:43:27,300 perhaps you would get a nice slice of the traffic for dot-com I was actually 699 00:43:27,300 --> 00:43:31,020 talking to somebody in black hat and apparently there's a 300 page guide of 700 00:43:31,020 --> 00:43:34,680 rules you have to follow to get one of these things and they try to preclude 701 00:43:34,680 --> 00:43:41,100 similarities but still you want to be sure another possible issue is a puny 702 00:43:41,100 --> 00:43:41,540 code domain 703 00:43:41,540 --> 00:43:46,340 I have not looked into what happens at bit errors and puny code domains for 704 00:43:46,340 --> 00:43:50,700 those unfamiliar puny code is how you would use internationalized characters 705 00:43:50,700 --> 00:43:54,740 and domain lookups but it's quite possible that a bit error in a puny code 706 00:43:54,740 --> 00:43:57,720 domain in one language would actually be a domain in a completely different 707 00:43:57,720 --> 00:44:02,500 language making the attempted use of trademark laws to get it back extremely 708 00:44:02,500 --> 00:44:10,680 difficult I would like to give a special thanks to a few people 709 00:44:10,680 --> 00:44:16,400 notably Robert Edmonds of ISC who a first noticed DNS bit errors in a essay 710 00:44:16,400 --> 00:44:21,520 data another person is a Paul Royal who helped me immensely when creating the 711 00:44:21,520 --> 00:44:22,220 white paper for this 712 00:44:22,220 --> 00:44:28,680 Aaron le masters for acting as the adversarial researcher the entire Raytheon 713 00:44:28,680 --> 00:44:32,400 Roslin office for their support and helping me but many multiple reviews 714 00:44:32,920 --> 00:44:38,540 my other patient support reviewers whom I begged to review my slides in my white 715 00:44:38,540 --> 00:44:38,860 paper 716 00:44:38,860 --> 00:44:45,420 paper, the DEF CON 19 staff for helping me actually present this to you guys, and to 717 00:44:45,420 --> 00:44:49,980 everybody who licenses your photography in a Creative Commons format. Without you, this 718 00:44:49,980 --> 00:44:54,040 presentation would not have been possible. And of course, to all of you guys who came 719 00:44:54,040 --> 00:44:59,900 to see my talk, I greatly appreciate it. And finally, I'd like to say, if you want a quick 720 00:44:59,900 --> 00:45:04,600 tool to identify which bits quads of your domain are available, you can get a Python script 721 00:45:04,600 --> 00:45:07,400 at dynaberg.org. Thank you.