>> All right. Hello, everyone. Welcome to my talk, investigating the practicality and cost of abusing memory errors with DNS. I'm Luke young, I'm a mastered student at a big university that has nothing to do with this talk. I currently work in the Bay area. Is this better? Sorry about that. I'm the founder of hydro-labs which has funded this research. It's funny how you can do that when you're the only employee. In case you didn't catch that, it means I'm not hiring unless you want to work for a 19 year-old kid for minimum wage. If you do, there is my email address. If you have questions about the research or want to send me legal threats or both. That's my email. Or you can snail mail on the project domain information which is at the end. A quick run down. I'm going to talk about a bit flip and the history of exploitation. After that bit squadding. Finally move into my research on bit flips via bit squatting and finish up with complete code release -- followed by Q and A. A bit flip occurs when a bit flips from a 1 to a 0 or 0 to 1. It can happen for a variety of reason, heat, electrical problems, radio active contamination, I'm not going to focus on what causes it but how we can exploit them. In 2003 a paper was published by Princeton, they took a 50-watt lightbulb to intentionally produce bit flips and escape the VDM. In 2014 a paper was published (audio blipped) flushing and induce bit flips. You may have heard of this by Roman. They showed it possible to obtain a bit flip to get -- privileges. Bit squatting was a named coined by DINANBERG. It's the purchasing domains which are one bit away from the legitimate domain in the hopes that a bit flip will occur and end up in your domain instead of the original intended domain. We take CMN dot update com. If the last 0 in the first end flips from a 0 to a 1 it changes to CON.COM. Normally these do mains aren't registered and they will fail or the user will never notice that something happened. The bit squat purchases these domains. How do you come up with all the possible bit squats. If we take a legitimate domain, you can see the binary representation of one of the letter, E for example. We can throw away bit flips that occur in the first bit flip because it's always going to be 0 and we can throw away flips that occur in the third bit. That's because this represents the case of the character and in domain names this is irrelevant. Unfortunately this doesn't leave us with 6 possible bit flips. Domain mains only have several valid characters. In the case of E this gives five possible flips. There are exceptions to the rule. If a flip word occurs it changes to a different character. An M to a dot or a slash to an 0. These can happen where a flip occurs and it completes to a valid domain or a sub domain can change to dub dub dub and DEFCON dot org. These are researched at DEFCON 21 by Jason from Cisco. He explored this in dot exchange and dot cloud. So using this information, we can find there is 43 possible top level bit squats of dub dub dub DEFCON.ORG. I generated a -- of look up. It's linked on the project site at the end. Quickly note the previous bit squatting before my research. During DEFCON 19, the term bit squatting was termed and more recently -- there was more extensive research into bit squatting. What is project bit flip? My research into how do you exploit a bit squat. It makes sense (audio blipped) and how it's sent to potentially the wrong person. How do you exploit that to pivot somewhere. Let's take an example. Let's imagine an internal site, a corporate Wiki or system that includes the J query. Since you're browser is loading this page for the first time, it doesn't know who code dot J query is. It's going to initiate a request to the dissolver. This is Google GMS, Comcast, et cetera. Now a bit flip occurs. Co-dot J query has become queasy. This can happen in memory on the device running the browser or in the memory of the NIC or in transit or in the memory of the DNS resolver itself. The DNS resolver doesn't know who is in charge of D queasy so it's going to have a name server look up and send that and the DNS answers with NS1 and NS2 bit flip. What is this do main. It's the domain I purchased to act as the control domain for the entire site. It has a one in it because someone owned bit flip .com. These answers get sent (audio blipped) going to use to send a query to the project bit flip server. It's going to ask for J queasy.com. This deviates from a standard DNS question and answer. We send back two answers. One for code dot J query and one for queasy. We don't know where the bit flip resolves. We send both back and let the resolver pick the correct one and ignore the other. The resolver sends this back to the browser which (audio blipped) get request. If you're attentive you may have noticed two different answers had different IP addresses. This is because it allows us to determine which type of bit flip occurs most commonly. This get request is different depending on which was accepted by the DNS resolver. Get request gets sent to the project server. Instead of answering this with a 404 or 200, we're going to be needy and send back a 301 moved permanently. This permanently caches the bit flip in the browsers cache. It goes to the server even when a bit flip didn't occur. It's a unique sub domain. The browser doesn't know who is in charge of the sub domain. When it gets the request it issues another GNS question and sends it through to project bit flip. This allows me to tie a user's browser with the DNS resolver. There is no way to tell which browser initiated a specific query. Following this we have a standard path. The answer goes back to the browser. And issues a -- and we find the answer with a 200 and send back this tracking Java script. I didn't ask for that. Too bad. Instead we're going to send back this which the browser believing that it originated from J dot query .com is now from the internal site. Internal Wiki. Anything with important data on it. Or any site that a user is tricked into believing credentials are on the original site. How do you build all this? The second tool is BFDNS, a DNS server designed to answer bit squad queries and BF dub dub dub. It has a bunch of PHP scripts used to answer the tracking java script. What does the java script tract? Everything that you can track. It pulls the users installed plug ins, time zone, language, document title, screen size, do not track cookie, the installed fonts and the local IP addresses on the system via web RTC. Some of you may have seen this from the beef talk. There is a way to pull the protocol and it contains all the local IP addresses on the system and java has access to those. These are internal LANIPs. In addition to external IPs if your computer is directly connect today the internet. It pulls the cookie names. You can pull the cookie values, I don't want to get screwed so I just pull the 256 hash of them. We need a place to host this. We need somewhere that supports multiple addresses so we can answer each question with a different address. We want IPV6 support. And somewhere that bandwidth is cheap incase of a spike. If a big DNS resolver caches a results like Google DNS or Comcast. Because it would serve it to a lot of customers. I wanted a smaller company incase there were letters or legal threats. I settled on ram node. 3 terabytes of bandwidth, 15 bucks a month. We need domains. Other than the project domain. I don't know how many of you know a college student but we're lazy. Whatever option that requires the least amount of work is the one we take. Unlike doing a list of domain sets, I fired up a web proxy and browsed the internet for a day. At the end of the day I looked at the top sites and looked for ones with interesting data. I took care to only grab sites that would yield interesting data and avoid sites that would have data such as HIPAA or PCI. The first site I bought is Google user.com. Serves images for Google sites. It's a really long domain name. There is a lot of opportunities for a bit flip to occur in memory when browsers copy the domain name multiple times. In fact here is all of the possible bit flips or the 72 of them I was able to buy. There are 79 valid ones. I hadn't set up a proper server. So I pointed to the VPS and ran net cat on port 80. If you're in IT you have an oh shit moment. Run on the wrong server. Shut down all but the server you wanted to. If you can't read the tiny text that is an attachment for Google user content. It serves all mail attachments for Google and Google apps. Oops. By their very nature the links are valid without session cookies. Each misdirected request I can grab that attachment myself if I wanted to. I decided to look more at the domain I bought and what else is served on it at this point. It serves not just mail attachments but the authentication for Google fonts and translated pages. There is no valuable data on that. I looked at Amazon. Cloud front dot net. It serves a lot of really popular sites like ESPN, Amazon itself and more. 43 possible bit flips. 40 were registered and I registered the rest. I looked at Amazon AWS.com. Sub domains of Amazon. Elastic load bouncing and EC2. This is one of the few domains I came across in research that a lot of the bit flips were owned for. The other one is IKIMI who owned all of their bit flips. Amazon owned 33 out of possible 38 bit flips. The rest were registered by someone else. Amazon ask .com. Of course I wasn't satisfied with the single bit flip so I decided to decide where the dot changes to N. Moving on from there, I decided to take on doubleclick dot net. If you're familiar with ad network, this serves Google's ad network and serves them over java script. 19 were registered and I registered the other 26. I hit apple.com. A lot of these flips were valid sites and not owned as bit flips. So I grabbed one of them. Apple G.com. I took a look at I club.com next. If you have an I operating system device, it checks in here regularly for back ups, contacts and more. Additionally most apple accounts have an I cloud.com email address delivered to this domain. I looked at web dub. I don't know how many of you heard of J query it's a compatibility layer that makes IEs suck less. Used by 70 percent of the top 10,000 sites making it a good target. I registered the 15 available of that. I hit DISCUS.com. And finally the peak, there is 24 purchased. The peak of my web Deb is Google analytics.com. I guess you know what this is. Serves analytics for every site ever. The most widely used statistics website service in the world. I wasn't the first person to have this idea. 53 of the bit flips were registered by another party but I grabbed the remaining 10. Moving on, static.com the sales force CDN. 42 bit swaps, I bought all of them. I'm going to pick up the pace. MS8067 Ajax, serves a lot of Microsoft sites. 38 domains. Google API, java script, another 22 out of 39 registered. G static.com. This is fun. Google static content hosting. The chrome internet conductivity test. When chrome says you're online now, it's hitting G static.com. It is the Chromecast login page and other stuff. The thing that makes this interesting is this is one of the domains purchased by -- in their research and it was freely available. I was able to grab 19 out of 30 possible. Finally, Facebook CDN, YouTube, Twitter and there we go. Now, that was 337 domains. I know you were counting. You're asking yourself how did I pay for all of those? Coupons. I don't know if you have seen the TLC show extreme couponing. That was the documentary of my life for a month. I ran out of coupons and found one on one. Ninety-nine-cent domain names. The first one is 99-cents and when you try to buy the second one it charges you $11. If you start the process in an in cog knee toe window and login half way through, it's still 99-cents. After that, five minutes per domain. I got this email. You have exceeded the limit of our special offer. The rest will be canceled. Security team. And that's when I stopped buying domain names. I bought 89 domains from GoDaddy. 255 from one in one. At an average cost of 162 per domain, 500 and $45. The next thing I realize is I was missing out on a lot of data. This traffic was coming in over SSL. I decided to buy SSL certificates, too. If you're familiar, you know that I need a wildcard SSL certificate. I don't know the sub domains that are going to requested for each. Wildcard SSL certificates can be expensive. $595. You get bulk discounts and other things. If you do easy math that is over 200 grand which I done have lying around for a fun side project. I was able to find a solution. Some of you may have heard of them from other talks. Start SSL is a unique model. A one time fee and get SSL certificates from them at no additional cost. At a cost of $60 I got wildcard SSL certificates. Because this is a unique model, start SSL has a very manual process. No API for requesting certificates or anything like that. It makes requesting them really annoying for 337 domains because you have to do domain verification on all. It's more likely that someone is going to notice what you're doing. 17 of the domains were flagged for manual review by star SSL who then approved all of them. By four different employees of the company I might add. 103 certificates that I was issued. You might have noticed that I bought 337 domains and only got 103 certificates. There is a good reason for that. On August 25th I received this email. My login certificate was revoked for abuse. Please contact us. Reaching out to start SSL I received the following quotes. For high profile names only the name owner should be able to get certificates for it and those resembling them closely never issued. Most certificates shouldn't have been issued to start with. Oops. Here is the actual excerpt from the certificate policy. Star come will not infuse domain names for misleading or ... (reading from board) ... I guess the fact that I owned domains with their example in it is probably not so great. I went back and forth with the CTO of star COM letting them not about the project and suggesting only the Google certificates. Here was the time line on that. I don't know how many of you have been to a stand up comedy show. You don't take your phone out during someone's set. We get made fun of by the comedian but it's rude. I was at a comedy show and my phone started vibrating and kept vibrating for five minutes straight. When the set ended I took out my phone and saw this. They revoked 81 certificates with two emails for each one. Now I'd like to note that I had full wildcard certificates for all these domains for two months before they were added to the revocation list. Not that that matters. A lot of browsers like Google chrome doesn't check. If I were malicious I could continue to use these certificates at the risk of being sued. They left 22 certificates unrevoked. When I inquired about why, I received the response everything we haven't revoked so far is considered not problematic and left them to expire naturally. All the domains remaining seemed to not contain the trademark name of the company that is it. I don't know that for a fact that's the reason they were left behind. The future. The EFF announced the free automated certificate authority called let's encrypt. Using that it may be easier to do exploitation. It's an automated process and you don't have manual review. They don't support wildcard certificates but I'm looking into it. You can use a larger provider at a much higher cost depending on how much money you have. Those certificate revocations begged the question, did anyone else even notice? Well, the first and only public case of someone notices was by a third party. Noted that all the bit flips of G static.com were registered by the same individual with name servers at bit flip.com. I thought that was it. I went to a friend's house and I checked on the site and saw this. I logged in to the server console and found out it was allow and well. I figured I broke the DNS server or it was handling packets wrong and I hit the Google DNS check and it worked. After a bit of further investigation and panicked calls to friends in other states, I wasn't crazy. Comcast DNS server was refusing to answer requests for bit flip.com. Only for A and quad A records. Here is the weirdest part. The requests for forwarded to the server, the answers were not getting forwarded back to clients. This makes it hard to pinpoint when they put this block in place and I still don't know. I tried to reach out through the business class support line and never got an answer. Short while after noticing the Comcast incident I got a notice that my credit card payment didn't go through. I called the bank. They were approving the transaction and I had adequate funds. I reached out to the CFO and he received the response that we have reason to believe that card has been associated with fraudulent activity. This is odd, that card was only used with five vendors. And only one of them, this server was purchased through stripe. Stripe not the bank was refusing the transaction. I reached out to stripe on my own and they said we are blocking due to the level of risk on this card that we're not willing to take. This is a very vague reason but for security purposes I'm limited to how much information I can give out. I paid for the month on another card and paid through the end of August ahead of time in case it were to occur again. I want to take a second and have everyone look at this slide and tell me what is wrong with this slide? I put my bank on there. About two hours after the DEFCON CD slides came out, I started getting password resets. Whoever is doing this, I don't bank with them anymore. Nice try, though. Now, moving onto the part that you're all probably here for. The data. The first question people ask when I tell them this is, is this actually a problem? Is there traffic to these bit flips? Let's start with a graph. This is the traffic I received during a section of the time the server was running. Some of you probably can't see that because it's small. I'll give you a number. I received over 1 million DNS queries every 24 hours for over a month. Notice the graph is all over the place. There are a lot of reasons for that. Different servers caching the results for longer. It's not the cleanest data set. Of the million queries 4.8 resulted in TCP connections. Of those TCP connections, 85 percent of the initiated SSL connections completed the handshake and issued an ACDP request. You might have noticed I had 22 certificates out of the 337 domains. Those numbers don't add up. The best answer I can give you on that is a lot of people have misconfigured systems that are accepting SSL certificates that are for the invalid names. These are valid SSL certificates just not for the domain that the user requested. What about the HTTP access logs. The server handled 2.4 million requests. Repeat users, they cached the results. After a flip occurred, where it occurred in the request process, you continue to try to access J query for the next 4.3 times you visited that site. I can tell you interesting things from this tract. The most common languages that users had on their system. The graph on the left is the HTTP accept language header. And the graph on the right is the languages returned from the java script. It seems like the java script executed on Chinese machines more than any other language. Not sure why. It's interesting that most of the traffic was coming from a Chinese language set and this doesn't match up with standard data sets of what most common accept language headers are. Bit flips were occurring more commonly on Chinese computers. I the tell you the most common screen resolution or IP6 adoption. Which is 1.67 percent of queries. I wasn't forcing users to try IPV6. I can tell you things like browser use. You can see the Wiki media. Wikipedia's traffic on February is on the left. Versus the traffic I received is on the right. It's a significantly larger chunk is coming from chrome. Because maybe chrome is doing more memory copies in each request. Maybe more of the users happen to be running chrome. Along with a larger proportion of IE. I can tell you operating system usage. Same statistics, Wiki Media on the left and my traffic on the right. A large portion of traffic from Windows 7 and XP. A smaller from operating system X and I operating system. I can tell you cookies. I acquired 240,000 cookie names and values. These could be anything from Google Analytics tracking data to session tokens for say your gmail login. The top were from Google Analytics and Vidoo and weather.com. I have thousand of users ZIP codes they look up weather for in my data set. I can tell you here is someone browsing Amazon.com looking for an iPad. And their session codes were sent to me. We can look at here is someone trying to log into Olaf and their session cookies sent to me. Or iPhones checking in to download in this case checking into the app store, or in this case downloading an app from me. Some of you may have seem the hacking team there, research was into serving malicious applications to users. That could be utilized with this. As long as it's signed with a valid certificate I operating system will accept and install it. Or have I operating system devices asking for software updates. I did research into this and you can serve them different software updates instead. I do things like the HTTP refer value. Here were the top Google searches from the referred values. For some reason a lot of people really want to know about wood birthday gifts for their wife. I have no idea. Another thing is local IP addresses. I was able to pull 158,000IP addresses. 12 percent were non-private. That means those systems were directly connected to the internet or using a lot of them are IPV6 addresses which by their very nature don't go through an app. The most common local IP addresses. 192.168. Primarily consumers. We look at other traffic. For example here is the SMTP traffic my server received. You can't see it, it's small text. The numbers on the side are 20,000, 40,000 and 60,000. That's how many requests I was receiving each day. That's someone trying to send an email, a bit flip occurs and it gets sent to me instead. If you have worked on mail systems you know that SMTP doesn't work well with TLS. Everyone uses self-sign certificates and if you weren't, I actually own the certificates for these sites as well. It doesn't make a difference. And you'll notice that big jump there at the end up to another 60,000, that was June 19 where hot mail cached the mail and sent all the mail to me instead. Oops. I was looking at the traffic and I set up a query that would show where the origin VGP route came from. I found that 38 percent of the traffic is from AS3134 owned by Twitter. And you'll notice that pie chart is for what the DNS requests for coming from them. They are all for I cloud.com. These are AX and record look ups and resulted in connections. 390 connection attempts per day and based on this info I'm guessing a bit flip was occurring and Twitter was trying to send password resets and other things to users with an I cloud email address and sending them to me instead. I reached out to Twitter and it said we're trying to restrict information going to bit flip domains. This should outline the specific problems you pointed out. I wrote a tool called BS flunk. Source types for spelunk and a bunch of queries. It's listed at the end. Now, how do you remediate this? Buy your bit flips. You buy the typos, buy the bit flips as well. It's not that expensive and can save the users problems. Own them so someone else doesn't. You can use memory and set up an RPZ for internal flips. It protects users within your network. Before I get into data release I want to talk about the domains. I reached out to all the companies and offered to transfer the domain to them for free. The first company was sales force. I want to give them props. They gave me authorization to transfer the domains in under 2 hours and it transferred within 24. The next domain is apple, two days. And Amazon AWS, transferred in two weeks due to scheduling issues on my end. Facebook, a tad over two weeks. Microsoft is being transferred now. Those are the companies that accepted the transfers. Some companies like Twitter, said, they didn't want the domains. Here was the exact quote. We don't try to prevent bit flipping attacks due to the fact these attacks are rare and we own quite a few domains. We're not interested in acquiring the domains you have. Please maintain possession of them until they expire. The next company is Google. They had a similar response. Not interested in purchasing them. 154 domains are up for purchase. The companies that did want to buy them, some of them doesn't do it right. The name servers are still pointed to me even though they own the domain. I get the user traffic even though they own the domain. I'm not going to call out the companies they are. Because I just noticed this and I'm didn't give them a heads up yet. Complete DNS logs for every query, the source, the port, the Q name, type, all that. The info is self-explanatory on the site. Anonymized web server logs, the user agent, the accepted language header, the host they were intending, the method. Do not contain the URL or the query and a hash of the source address. I'm releasing SSL and SSMT logs which contain the same hashed source IP. And finally my contact info along with the project website with the data dumps. At this point I think I have a short period of time for some questions. Anyone have one? >> Did anyone offer a bounty to help you cover the cost? >> No and I wouldn't have accepted it if they did. It's already a gray area legally and that can push you if you're accepting money for it, it can push it even more. I did get some care packages from the companies though. >> Did you look for double bit flips? >> You're referring to when two bit flips occur. >> You can figure out the one bit flips and 0. >> I did not. If you look at the data. A lot of the queries I got where a bit flip occurred, lots of other bit flips occurred in the query. In the URL is malformed as well. Indicating those users have messed up memory. I don't have statistics on it. It would be very interesting to look at that. Any other questions? >> Does enforcing name server bailiwick have any effect on your responses? >> I do not know. Any other questions? >> How did you figure out who the contact in these companies to get a quick response? How do you know who to email at Google or Microsoft about this, just being someone on the outside? >> So all of these -- all of these contacts out to the company were sent to the security@LES or whatever information they had listed. If I googled the company name and security, a few of them had to get pinged through personal connections to make sure they got handled. All right. Thank you very much. "This text is being provided in a rough draft format. Communication Access Realtime Translation (CART) is provided in order to facilitate communication accessibility and may not be a totally verbatim record of the proceedings."