C (21:33)
Clear HTTP handshake, somebody's up to no good, that's something you need to go in and dig deeper on. So first pass is to go through and identify if it's communication on a well known port, is the application associated with that port being used. Prozeek is a great tool for this because it will go in, it will look for those headers and it will ID it appropriately for you to let you know, you know, yeah, I am actually seeing DNS on UDP 53 or no, I'm not. You can also go in and validate the integrity of the protocol itself. So let's say we're looking at, yes, it's a protocol on a well known port and it is actually the protocol I expect to see. What else can I go in and do from here? One of the things you can do is you can go in and you look for user agent. Now don't shut me out because I know we've all been down the user agent road. We were told, yeah, check your user agents. This is awesome. You can catch all sorts of backdoors. Just look for this specific agent field and you know, and attackers go in and change it. And now all of a sudden that trick doesn't work anymore. That's true, but hear me out. If I have a standardized environment, so let's say Everybody's running Windows 10 and they're supposed to be using Chrome as a web browser. How that system goes out and identifies itself as a user agent on HTTP, how that system generates an SSL TLS hello packet to start an encrypted session should be pretty consistent. So if I go in and I look at, if I just go in and collect up all the user agents that are, that I see heading out to the Internet, if I collect all the SSL hellos that are going out towards the Internet and I say, okay, show me the outliers. You know, if something has, you know, if most of the systems are using one particular format or one particular setup, I don't care, get those out of the way, show me the unique ones. Because anything unique might be interesting. Now again, this is a weighted field. By that I mean if all I see is a unique user agent I don't recognize, or if all I see is a SSL client hello that I don't recognize, that's not enough to go in and freak out about. I gotta see a persistent connection first once I know the persistent connections there. Now if it has this attribute associated with it as well. Oh yeah, that makes it far more suspicious. But I got to establish there's a persistent connection first. That's got to be my baseline line here. Another slick one to go after. DNS is a really popular command and control channel these days. We've seen queries going out looking for text records associated with fully qualified domain name. And the text records are actually command and control orders. We've seen IPv6 queries quad A queries going out and the 128 bit IP address coming back is not a legit IP address. It's actually command and control orders because you can fit that 100 if you know what you're doing. We've also heard, haven't seen, I haven't seen this specifically, but I've heard tell that domain keys are now being used. So folks are going out looking for the domain keys associated with fully qualified domain name. The domain keys are invalid, but if you go in and decompress them and unobfuscate them, there's actually a command and control channel sitting in there as well. So again, there's three different mechanisms that's taking place over DNS. What they all have in common is that every time that thing wants to call home, every time the internal compromised system wants to go out to check, to see, you know, do you have something new for me to do? It's going to use a new fully qualified domain name. Otherwise, what it may get back is cached information from the local DNS server, which means it'll never actually reach its command and control server. And they can't have that. So the side effect of that is you will see what appears to be a lot of hosts sitting inside of a specific domain. So if you take a look at the first line output here, the r1x.com, actually let me kind of start at the bottom and then we'll work up to that because then it makes a lot more sense. So think about how many fully qualified domain names your environment exposes to the Internet. And for most of us, that number is pretty small. You know, it's usually like 10 or less. We get a website, a mail server, some DNS servers, maybe a customer portal. I mean, you get the ide, the number of hosts we're going to put in our DNS so that people on the Internet can try and get to them is going to be a relatively small number. And then you get into the environments that everybody's heard of. Microsoft, Amazon, Akamai. You know, these are large organizations that have been around forever that offer many services on the Internet. You've heard of them. So to see them with, you know, couple hundred, maybe 500 domain names that are exposed to the Internet, especially if you're using like aws, you know, and you get a lot of systems out there, that's not uncommon. But once you start getting up above 500, and certainly once you get up above like 800 or a thousand now, things get a little wonky. In other words, you know, if a domain has 2000 fully qualified domain names that it's exposed to the Internet, that starts not making a whole lot of sense, especially if it's not one of these big companies that everybody's heard of before. So now let's go up and take a look at that top line. So I've got this domain, r dash1x.com. Who the heck are they? I have no idea. I've never heard of them before. They've never been in the news. So the fact that it looks like they have 63,332 host names that are resolvable, that they're exposing the Internet. Oh, something's wrong there. So again, you know, protocol analysis, these are valid DNS queries, but it's an unexpected behavior. We don't expect to see that many host names associated with remote domain. So long as RETA is installed to see what host names are getting resolved out on the Internet, it'll be able to pull this information for you. So we've gone through the protocol, we figured out, you know, does the protocol make sense? Are they using it the right way? Does all of that stuff look legit? We've added or subtracted some points to our threat score based on that. Now we go in and we start looking at the target, target IP address itself. You know, who, who are they? You know, dig Dash X and then the IP address, what domain is it going to do? I know that domain, do I recognize it? Is it a business partner? Is it, you know, is it one of my vendors? So if my security system that analyzes logs is calling out to the vendor that made that software, okay, I may not like that, but that doesn't mean it's a backdoor. Right? That's really what I'm trying to get to the root of here. Take a look at the GEO information, make sure that makes sense. We had a customer that figured out they had three IP based cameras on their network that were compromised straight from the vendor, simply because the three IP addresses were beaconing out to Quanzu, China and they didn't have a field office in Quanzu, China. That was the first thing that set off a warning bell for them. So even though Geo isn't 100% accurate, it gets in the ballpark, can be really helpful. Also, look at how old is the domain. Any domains that are seven days old or less be really suspicious of. In our previous life I worked for registrar and one of the things that ICANN does with registrars is they mandate that you give a seven day money back guarantee on a domain. So the idea is, in a drunken stupor, I can go out and I can register some stupid domain name and so long as I sober up over the next seven days and say, wow, that was a really bad idea, I should not have spent money for that domain. You can go back to the registrar and say, give me a refund and they have to do it. Well, attackers leverage that. So when I was at this registrar, I started poking through their database and I was able to tie down sources that were using multiple accounts and they were doing the same thing with each account. They usually had three, some of them only had two. But what they would do is they would register a domain, they would spam from it, attack from it, pollute the heck out of it, and then 6.9 days later come back to us and say, hey, I Changed my mind, I want a refund. Meanwhile, they'd have a second account that they would then go through and register and pollute and spam. So while their refund was getting processed on the first account, that Phil overused the second account. And by the time the second account hit 6.9 days, they had already gotten a refund for the first account. They'd now use that money to go out and get an additional account. I found malicious actors that literally had burned through hundreds and hundreds of domain names that way over a couple of years just because they didn't know how to go in and look for that within their system. Once we tagged it, oh yeah, we started kicking those people out left and right. But you get the idea. If you see a lot of traffic going to a domain that's less than seven days old, that's something to go in and pay attention to is the destination on any known blacklist. We're doing this one last, you know, and John and I started talking about this one a little bit back in the beginning and I'm going to kind of rope into why. And here's a great example why. So here is an IP address that has been, you know, there's been 142 reports from 115 different sources that this IP address is evil and this IP address is a bot for Bing. Now we might not, you might not use Bing, you might not care about Bing, but Bing's got web crawlers just like Google does. And they do the same thing Google does, they go out and they index websites. But if you take a look at some of these write ups, you know, oh my God, it's crawling my website and it's running all my JavaScripts. Yeah, that, that's what a bot does. That's what a web crawler does. So 115 different individuals looked at this and said, oh my God, it's evil, ban it. And this got it on a bunch of different blacklists. So if I see one of my systems talking to this IP address, should I, should I be concerned? No, clearly not. It's not. It's a lot easier to get on a blacklist than it is to get back off it at a. So I'm not saying you should not worry about blacklists at all. That's why, you know, that's why I had a slide on it. Make sure you check that. But once you check it, give it a little bit of leeway, you know, again, all the other pieces have to kind of line up for me before the fact that it's on a blacklist actually matters at all. And some additional tools you can use to go in and do some additional reconnaissance on this target IP address. You know, dig, hey, this is a simple tool we've all used in the past, right? Let's go in and look at what's the, what's the PTR record associated with this IP address, what mains responsible for that section of the network you can get rid of plus short and it'll give you a verbose output that'll also show you, you know, who's responsible for the domain name servers and that type of thing. There's a couple of links online, these are just two of my favorites that you can go in, you can plug in an IP address and they'll tell you everything that they know about them. You know, is it on any blacklisted IP addresses you know, is there, is there identified malicious activity associated with this host in the past? Who's responsible for that? I what company is associated with it? You can get a lot of really useful investigative information out of that. So what do you do next? Well, so now we've gone through, we've, we've looked at is there persistent communications, yes or no? If yes, then we went in and we got threatened. We got some intel information on our internal IP address. Then we went in and we analyzed the protocol. Then we went in and we analyzed the reputational information. Now we need to take all those data points, put it together and we need, in it, we literally need to make a black or white choice. There's a very small gray area in the middle and the black and white choice is is this internal IP address compromised? Yes or no? If the answer is no, I need to go in and create a white list entry. I need to be able to go in and have some way to be able to say, don't show me this activity in the future. I've already blessed it and said it's okay. And that might be a note in a JIRA ticket that might be whitelisting the IP within the tool. That really kind of depends on your but you've done all the work to do this investigation. You don't want to have to keep doing it again. And that's actually, if you do that. This makes threat hunting a continuously improving process because the first time you do a threat hunt, you're going to be see a bunch of stuff you don't recognize. And now you're going to go in and you're going to say, okay, here's Eight to ten things I know are, okay, great. Now tomorrow those eight to ten things don't show up. You can focus on anything that's after that, and you can go on from there. Our other big possibility is, hey, I think the system is whacked. Something's really wrong. In which case, what we do here depends upon our incident handling policy. You know, maybe we go into full for incident forensics. You know, maybe we go into full incident handling mode where we do forensics, we start pulling out host log files, and that kind of comes down to your environment, what to do next. But we're definitely into some form of incident handling slash forensics at that point there. Now, I mentioned there's a very small gray area in the middle. What is that? Well, that's when, geez, I'm really suspicious, but not enough to pull that big red lever and get everybody to freak out. So what do you do? Well, what I do is I make a note of that, I pay, and then that's the first thing I go looking for when I go into the data tomorrow. You don't want to do that that often. You know, you don't want to be kicking the can down the road, so to speak. But. But even better, you may go in and say, hey, I'm highly suspicious of this IP. Maybe I start getting full PCAPs of all the traffic leaving that box. Maybe I start collecting host entries off it. You know, maybe I don't kick off full incident handling mode. We need something, you know, something below forensics. You know, we need like a quasi forensics where we go in and we say, I'm suspicious. So we're gonna, you know, start taking, you know, more detail, start collecting more detail up on that. And once we have that information, now we're back to this slide. Is it evil? Is it not? If it is evil incident handling mode. If it's not, we go in and we do a white list on it, and that's about it. I wanted to make sure we left plenty of times for Q and A at the end of this because I know this is kind of like a new thing and everybody's still trying to figure it out. So, John, you said you, you willing to handle questions.