Hey, everybody. There is a goon here, a very nice guy, who decided I shouldn't talk about DNS. I think Paul would agree, if you were here for the last session. So he said, hey, do a different kind of session. It's DEF CON. I said, OK, how about women, girls, and the role in DEF CON over the years? That sounded good, right? OK, so I'll give about it. No, I won't talk about that. Oh, got to activate this shit. Here we go. OK, DNS abuse infrastructure, games and tricks. But first, OK, so women, girls, and the changing role in DEF CON over the years. So basically, we had the scene horrors, right? All these girls going around giving stickers and trying to get you to buy products and whatnot. We had the girl hackers. They're cool. Some of them really know their shit. Some of them don't know shit. But well, they're cool anyway. Come to DEF CON, girls. Then we had the girlfriends. And we didn't have that many of those. But in the past year or two, dude, did everybody get married or something? I mean, seriously. When hackers get old, do chicks dig them or what? What the fuck is going on with all these chicks at DEF CON? We need to keep it up. Anyway, let's start with the actual presentation now. Go out! Archangel, the goon! He just invented his own nickname today, so. DNS abuse infrastructures, games and tricks. OK, my name is Gadi Evron. I work for an Israel security vendor called Beyond Security. And today, I'm going to talk to you about, well, games and tricks. Now, in contrary to common belief, I will not be talking to you about DNS. And I'll tell you why. Well, you guys will be shocked about what I'm going to talk to you. Any guesses? . No, not girls. I don't know anything about girls. A what? A what? . I'm afraid of Russians. I won't say that. Who? Oh, yes, tubes and trucks. Yes, we'll talk about tubes and trucks. That joke is getting old, even for me. I mean, seriously. OK. . OK, I'm going to talk to you, surprise, surprise, about botnets. And I believe this is the very first time that I agreed to talk on botnets directly. But since this is about DNS anyway, it won't be about botnets directly. OK, enough blah, blah, blah. Actually, do you guys know what blot means in Russian? They just say blah, but it's blot and it's spelled B-L-Y-A-D. No? Well, depending on what level of Russian you can speak, it can be a connecting word that you say every second word. You can guess by yourselves what it means. What? Right. OK, so we're not talking about DNS. We're talking botnets, phishing, what a surprise. Yeah, yeah, yeah. Yes, botnets, what a surprise. Let's start. OK, before we begin, let's talk about the TTL. I actually asked Paul to invent a line for me about TTL, and this is what he came up with, because I was too stupid to come up with it on my own. But basically, the TTL is part of DNS itself. You can't do squat without it. That said, it works. Whatever you want to do, whatever attack you want to use, if you don't use the TTL ahead of schedule, set the settings for that ahead of schedule the way you want it to be, your attack probably won't be that successful. And it works very well, both for the good guys and the bad guys. And that's basically what we're going to show. But what we're going to start with is the use of DNS, a little bit of it anyway, for botnets and phishing and, well, OK, I'm repeating myself again. Let's start. What kind of technologies do the bad guys have? There still are a lot of companies out there called dynamic DNS providers. What these guys basically do is provide with an often free service that lets you go. Go to their site, register, and they will give you free DNS hosting or give you a host in case you don't own a domain. Whatever else, it's cool. These guys give it to you for free. And if you only have, say, a GeoCities website, or you only have a site at home, or you don't really have the iron to put up your own DNS servers, these guys do an amazing service for the web. These guys are old news. Why do I say this? Well, a lot of dynamic DNS providers, in essence, provide with a great functionality for the internet users all around. Whatever can be used as functional can also be abused as well for abuse. Yes, my English is great. Thank you. So what happened was that around the year 2004, well, that's when it started earlier than that, but around that time. What basically happened was that, you know, it happened, and OK, I'll stop with this now. It's not funny. Bad guys would go register with a dynamic DNS provider and say, hey, look, dude, I want this RR record to point to this IP address. Do this for me, please. And they would say, sure, please, register with us. They would advertise this, say, host on their malware, on their viruses, worms, whatever you want to call them, so that whenever Trojan horse, a worm, whatever, installed itself on your computer, it would go out and connect to the command and control server for the botnet. As you know, or you don't know, botnets are basically, a bot is basically a Trojan horse, meaning you have a computer that is completely owned. As in, as it is compromised, the attacker has complete control over it. That's Trojan horses. That's how these things work. Duh. But multiply that by a million. Multiply that by 10 million. These are the numbers we are talking about. And one of the ways that you can do that is to go to the command and control server, and tell it to do this. But there are a lot of ways of getting them. What's going after a centralized point? Is going after one bot at a time is not really working. It might be just what we'll end up doing, but it's not really scalable, especially when some of the ISPs don't have the manpower or will to do that. And I'm not sure that's really their job anyway. So going after a centralized point that controls all these bots is a pretty good idea. server. It doesn't help you. That said, dynamic DNS is great. Why? Because I take down that IP address. I take down that command and control server. The bot sitting on your computer, on a million of computers, trying to connect to that command and control server will not find it. That's amazing, right? Wrong. I'll go to the dynamic DNS provider, log into my account, go to the control of that particular host that the bot knows to connect to, and I'll change the IP address. Isn't that smart? Once that dynamic DNS provider is on to me and they get abused real bad, it really hurts them that these guys do this because botnets basically suck. Even though they're only using the service provided by dynamic DNS providers, they're taking a lot of bandwidths. Now, the dynamic DNS providers will see them because they take a lot of bandwidths and kill that particular account. That same day, two other accounts, will be opened with their dynamic DNS provider, 10 other dynamic DNS providers, and these guys are heroes on the internet. Even though they're businesses, they do a lot to stop this threat. All this is old news. Yes, they're still being abused. Yes, dynamic DNS providers are still being used for botnets, but that's not really the biggest threat out there. That was the beginning of how DNS was abused because before that, what you would do, you would find a command and control server, say in 1996. You would find a command and control server, say in 1996, and you would find an IP address from that you would somehow get to the RR record, and you'll try to find other RRs because the bot itself, the Trojan horse, would store other hosts it can connect to. If one went down, it would go to the next. That said, the sample could be analyzed locally, so you would have all these hosts and could go after everything. Much like with games, computer games, network games, when the user profile was saved locally, in any security system at all, but computer games are a good example, they could be hacked. Hacking became a lot more difficult. I wish Luigi was here. He's cool. Hacking became a lot more difficult because the user information was saved on the remote server. That's what these DNS records mean. When this could be changed very, very quickly, we had some trouble with that. Now, okay, we just covered that. Multi-homing. Now, I didn't even know it's called multi-homing, or multi-homing. I don't know how you guys pronounce it, but basically that means you have a lot of A records, or when you search for, say, blah dot, or I own your ass dot example dot com. Oh, come on, that's one of the more boring names. You really have to see some of the hosts the button controllers are using sometimes. Hey, guys, I know you're in there somewhere. Do you speak Russian? Bleh. No? Okay. So, an ex-girlfriend of mine is Russian. I love Russians. A sixth of Israel is Russian. Seriously, I love Russians. This is just something I have against the Russian mob, okay? So, basically, when you would look for the A record, when you would look for the host, you would find 10 IP addresses, 13 IP addresses, and you would have to take down each and every of these IP addresses, each and every compromised IRC server. But, in the end, you had to get rid of the command control server in order to get rid of the botnet. That meant you had to run after a lot more ISPs all around the world to get rid of just one point of control. That got a little bit more complicated. And at this point in time, we said, Hey, you know, guys, we can do this. I mean, we know we're doing something bad because whenever you push the bad guys, and again, bad guys for me are not black hats. Bad guys for me are people who still use the same IP address, but we need steal your mother's money, or people who steal your thesis, people who destroy your computer, or people who steal your grandma's money. OK, you get the point. The mob. People who do real crime online. And things were pretty nice then, because we could kill the command and control servers. We could, with one coordinated strike, bring down a botnet of 500k hosts. OK, and that was three years ago. And we had one of 250ks. I believe David Dagon was involved with that back then, and David Ulovich from EveryDNS. That's a test case they often show. Life was good back then, but we pushed the bad guys to evolve, just like with spam. You ignore the problem when it's small. You ignore it when it's not bothering you, when the cost of dealing with it is not worth it, because you don't lose that much. Two or three years later, it's too late. And you enter a never-ending war that's basically reactive. And when you do something, the bad guys invent a new technology, because they have a return on investment that they don't want to lose. If you get into their business, they'll find a way to get their business back. So they will invent new technologies to do that. So that's multi-homing, and that was the good life. Fast flux. Fast flux is something that's been around for a while. There are several people who can tell you about examples of this with worms from several years ago, who kept changing IP addresses at an alarming rate. That said, it was brought to the fore. Again, it was used just by a few worms three years ago, four years ago, two years ago. There is a girl that was called April Lorenzen, who has done a lot of work in this area, and she deserves a lot of the credit. Now, fast flux. Fast flux basically means that you'll take the A record, you'll set a really low TTL, and within a day, for example, in the better cases, that IP address would be somewhere else entirely. So you would waste that day trying to take down the 10 IP addresses that that botnet uses for the command and control server, not to speak of the secondary controls channel, and not to speak of all the other shit that the bad guys put in there. And then it would already be somewhere else, because it's a very large change already. Sucks, right? What happens if it's happening every 10 minutes? By the time you run after one address, one IP address that's currently hosting the IRC server, or whatever other means or mediums this botnet is using to communicate or to be controlled, it's already gone. In botnets, we've been a little bit more lucky. It's not been 10 minutes. But in phishing, oh, yeah. Definitely. Phishing. We've seen this kind of games a lot, and it's wearing us down. Now, I'll show some examples for fast flux with the botnet that we handled a year ago, and then more recently. What happened with the group that was controlling it? Now, what you see here, for example, is an NS record for addictedtodrugs.info.nf.bnmq.com. The TTL is set. Oh, quite normally to 86,400. Now, as you move down, you can see other addresses that are somewhat related to the first one, other name servers. We'll get back to why that is happening later. But if you look down, and that's a bit disturbing, and I still haven't been able to explain that one, by the way, you can see name servers with TTLs of 15 seconds. Dude, 15 seconds? Wow. I mean, that's a DDoS by itself, right? The bots keep checking for what the fuck is the host. I can't hear you. You're probably right. You're probably very smart, but I can't hear you. Please go to the mic. Won't most resolvers just ignore TTLs that small? Probably. OK. Like I said, I haven't been able to figure the 15 seconds part, but you know. As we go down, you can see other examples here. And what's amazing, really? Oh. OK, I'll explain why I skipped ahead here. OK, my slides are a little bit confusing. Allow me to go ahead with them and explain something else, and we'll get back to the examples in a second. I can't really give you live examples with botnets that are running right now and show you how we track them down using DNS rigs, because, well, my screen isn't working. But, oh well. There is enough info here. The bad guys. Use other type of. Fast flux, which is called NS fast flux. Now, imagine you don't play with the A record anymore. You don't move the A record around. You move the name server around. OK? Imagine every day, the name server itself just switches an IP address. Imagine in spam, OK, that you would go out there, register a domain. When you register it, you put it on, say, ns3.google.com, and ns4.google.com. These don't really have any traffic as far as I know, but I may be wrong. And then you change it to something real, the domain, to point to real name servers. You wait a little while. You send out your spam run, spam everybody and their brothers, and get it back to google.com. How do you find what was used to spam it? You look at the domain, and you have no idea what was used. You see Google. Hey, what's going on here? These guys are starting to hide themselves, because we've got to get ahead of the game again. We started to think, hey, they're moving very fast. We'll have to move very fast, too. So once again, whack-a-mole. Let's run after every IP address out there, every changes on the spot, on the fly. Sounds good, right? Well, let's do it with name servers. But the problem with name servers is they're a little bit harder to replace than domains. A sparring can go out there and buy, say, 5K domains for funds, throw away domains, and move on to the next domain. A name server is a real server. It's not that complicated, but it's a little bit more complicated just using another domain, you know, kind of. So that's the difference between regular FastFlux and name server FastFlux. It's just another record, but people often confuse that. Now, let's take a look at this example, and we'll get to the examples I intended to show earlier. I was getting ahead of myself. YP whatever blah blah blah dot com. This is Randy Vaughn's kind of writing, by the way, so I have no idea what he wants from me. It's an odd duck. There is a group called OMG, as in oh my god, I think, but I don't want to know what it means if it's not that. And they really bounced around. I don't know what cats with masking tape on their toes means. OK. Now, they used ns.xenet.cn and ns.xenetdns.com. Now, the A record only used in 120 TTO. And yes, that worked in most cases. Shouldn't it? You seem to know about DNS. What do you think? You asked a question. Where are you? Yo, would it work? You're on the spot now. Answer me now. Come on. I don't hear you. Go to the microphone. Move, move, move, move, move, move, move, move. OK, I don't want to hear from you. Go back to your seat. No, I'm serious. I'm asking a question, really. And back at you. I suspect that 60 seconds is. Oh, in much kind of way? OK. I think that. Do you know the joke that Matt Joseph, because I don't want to steal it from him, so please tell me you know this joke. OK. That, the Microsoft encryption? Yes. Yeah, yeah. I seem to recall that most reasonable resolvers won't cache anything with less than a 60 second TTL. So 120 would probably work. Thank you for saying that. I appreciate it. So yes, you're right. You're right again. And I didn't call you to make fun of you. I wanted that to be affirmed. Thanks. Now, shut up. Shut up. I can do it in metal screaming, too. Wait a second. Shut up. No, it won't work for now. OK, never mind. Now, the original command control servers were in the United States and in Europe. But, well, you know, even if the United States and Europe can't be played around with and ISPs can be moved and the command control servers can be jumped really quickly, well, China is so much easier. You know? Kind of. So it moved to China. Now, there are quite a few CNCs, OK, that with short TTLs and long name server TTLs for exactly the same reason that we talked about fast flux for A records. And, well, for example, got robbed your info at a TTL of 600, which is just 600 seconds, not that much. And, whatever, blah, blah, blah, blah, blah. Yeah, well, again, they used dynamic DNS providers, nothing big that much, nothing that big. And we are done with run this test, thank God. OK. Now, here is an example of a promising command control server. GameLame.Hungary. Is Hungary lame? I don't know about gay. Actually, I don't know Hungary. Here, it's a beautiful country. Whatever. And the IP address. And the name server was netquest 60. You said 60, right? That's the minimum. Here you go. GameLame.Hungary and all that, whatever. Now, this is pretty interesting. The A record. Godlike.ostabil.nu, whatever. Keep changing IP addresses. And what I wanted to do, basically, was take these IP addresses, take these hosts, take these domains, and show you how many IP addresses they have right now and what the history is. But, sorry, I can't do that. Whatever. Next. Now, as you can see, all these name servers were used for these A records of the previous, oh my God, botnet that I just showed you. Interesting name servers. Now, there is one that's really interesting, which is nameserver2.bnmq.com. What do you think about that? All these A records now mitigated. As you can see, they've all been mapped to non-existing IP addresses. 0.0.0.0.0, whatever. So, these are all closed now. They don't exist. And then, we see some other examples down there, as you can see. And these are all at Anaro, Telecom, whatever, somewhere, whatever. University of New Mexico. Sorry about that, University of New Mexico, but you guys closed it pretty quickly. They're all dead. Not very interesting, right? Now, take a look at this. All these addresses have been used. And these are not, this is not just multi-homing. This is keeping addresses every couple of hours, which was pretty annoying. They're, actually, these are live right now, if you want to check them. This is the IRC server. Main. This is the IRC server. Maybe we shut it down by now, got these a few days ago. Could be, but still. They're live right now. Probably the last IP address, whatever. Here are some of the bounces they had, as you can see. IP addresses, again, all the time. Should have kept it. Kind of the time stamp would have helped. There are long TTLs, though, on the A record and the NS records. As you can see, they're not really that worried. Now the good guys have a lot of, OK, let's first talk about that. Before I move to what the good guys are doing to combat this issue, do you guys have questions about this? How it works, what it does? How the command and control servers and phishing servers are controlled? Everybody understood? Am I that slow? Woo, cool. OK, let's move on. Now what can we do to track these guys, really? We can do a lot. We can use a lot of good tools, such as traceroute, reverse DNS, looking just at who he is and what not, and just see what the DNS answers are when we set requests. That's pretty straightforward. That said, a lot of other tools, such as, for example, Florian Wiemers, I'm sorry, I never remember how to pronounce the last name. He's a very good guy from Germany. He's a very good guy. And he invented something called a passive DNS replication. What it basically means is that you sit with a sniffer outside of the DNS box on the same network, basically, and you look at queries. You don't look at who is sending the queries. You only look at the actual responses, the actual answers. And that way, you keep them all in the database. And for example, if you look for one IP address, historically, you can. Actually, their perspective, again, they don't have perfect coverage. This is basically harvesting. They can see all the historic IP addresses, all the historic hosts. And in some occasions, when they look, for example, for some domain that was spammed in an email, and I'm quick enough, I can see 400 or 1,000 IP addresses in the history. When I look at the IP address, I can find 400 other domains or 1,000 other domains that were used. It's pretty interesting to follow these things. And with every domain, it's never ending. You would need a huge, huge visual system to be able to visualize all these things. And maybe that won't really help us at all, because who can handle such huge pictures? Maybe Dan Kaminski. I can't, if you've seen his presentation, visual stuff, 100 megabytes pictures. Now, there are other things we can do. For example, again, April Lorenzen really, I think, is a really, really good example of how you can do this. You can download, basically, .com. You can download the .com, .net, .org, .info, a little bit of others. Some of them you need to register. Some of them do a little bit of vetting, such as, hey, what's your name, or something like that. Not that difficult to get them. Some are a little bit more paranoid than others. And when you download these files, these databases, every day, and you look for diffs, you can find what domains have been registered since yesterday. And that has been very helpful in tracking down phishing, tracking down what new spam domains are about. If there is one spam domain that we know is a spam domain, looking for others like it, searching by a lame method, such as keywords, or, for example, checking, woohoo, what domains are on what name servers. Yeah. That could help, right? So, if, for example, we see that a bad domain is using a name server, we could potentially look historically at the data and see what other domains are using this name server. Is it a legitimate name server? Is it not a legitimate name server? So, like I said earlier, the bad guys started using Google when they spammed out. Still, it was a cute trick. Now, there are other games not really related to botnets that you can do with DNS. And these are not really related to botnets, to DNS itself. For example, with Google, you all heard about blog spam, right? Comment spam and all the related stuff around it. So, for example, Google... Okay, this is a bit of a story, but let's go over this slide real quickly. You can see here 5 billion and a half results. It's something like 5 million, apparently, by some Google guy who clarified this. But 5 billion results for elqz2q.org, which basically was a blog spam run for that registered domain with... Yeah. Three oldies, which means coming before the elqz2q with a dot. They basically spammed a ton of blogs, a ton of comments, a ton of sites. And what they got to was making sure that whatever ad, the domain in it, would have a really high ranking in Google. Yeah, Google did something called nofollow for the blogs to help deal with comment spam and rating poisoning and all that shit. But they still indexed the sites, so it doesn't really help us. So, for example, an unrelated system, and unrelated to DNS in any way, well, in almost any way, and still, the way they archive DNS entries, the way they archive sites, was abused. I'm not saying this is something against Google, this is just the way it happened. And these things keep happening, because DNS, whether by use of the infrastructure itself... As you'll notice, I try not to talk about the infrastructure, the root servers, the TLD servers, because these are taken care of. You've seen Paul Vixie standing here just an hour ago. But what can be done by the use of DNS, which is a network that's everywhere? Everyone is using it all the time. It's pretty cool. For example, if you want to hijack a site, right, that's not beyond reason that you will be able to do it. There are far easier ways to get users to go to a malicious web page and get installed with... A lot of spyware. There are hundreds to thousands of new sites every day, each of them installing rootkits and Trojan horses with rootkit technologies to steal banking information from users every day. Legitimate sites, you can find them on Google. Still, you don't really need to hack a DNS server or to do some trick to do all this. If you already have a Trojan horse on the machine, go to the host file, put in www.google.com, and point it to your own server, and you will serve spyware. In every place in the chain, whether it's the name server, the actual record on your machine, that can be played with. And these games are being played with daily. Spyware, malware, all this stuff, I've been doing it for years on the machine itself. We've heard of domain hijacking, although that's less of a threat. There are so many easier ways to get this stuff done. And here we go with Google. Google just stores this information, and a domain that was just spamvertized on blogs, which is basically another way to do regular spam. It's not some other type of unoffensive spam out there. It's very disturbing. It's very huge, as you can see, has been affected. So, yes, there are a lot of games, fast flux, moving domains around, moving name servers around. Rick Wesson and Adam, I forgot your last name. I apologize. Please don't kill me. Are you here? Can you tell me your last name? Never mind. They, for example, started a blacklisting, probably graylisting service that will tell you if a domain that's being emailed to you is less than five days old. That's very effective in scoring against spam. That said, spammers will just wait a month. You know, for the first month or so, they'll have higher costs because they'll register double the domains or a lot more domains and start using them only after a certain period of time. But their costs will go down and the effectiveness of the blacklisting will go down as well. Whatever we do, they always have a different way of approaching that. And if our response is plain, kill the fire now, instead of seeing it coming at us and trying to deal with it at the core when it's still small and when nobody cares about it, we're never going to win. So, that's basically about that. And other things that can be done, for example, blacklisting name servers. Again, ns3.google.com on your domain after you finish spamming. You finish the spam in 10 minutes, send a billion messages from a million bots, and you're done. Now, we have about 10 or a little bit more minutes to hear questions about all these issues about botnets, phishing, and everything else, users' DNS. I would love to hear your questions. Or not. Thanks, guys.