So now, it is my pleasure to make a quick, to introduce to you, actually, let me say a few words about a very, very special guest that we now have on stage. Monzi Mirza. Monzi have been, you know, from the humble roots of, you know, from the humble roots of, well, he's been everywhere. From scrubbing toilets, to government, and here he is, as chief security evangelist at Splunk, who will talk about real world automation for our rapid response. My pleasure to introduce to you, Monzi Mirza. That's it. Thank you, Ming. How are you guys doing? Can you hear me all right? Can you guys hear me okay now? Is this better? Yeah. Is this better? Yeah, all right. Good morning. So, thank you for the kind introduction, Ming. My name is Monzi Mirza. Our time is short. I'll get right to the point. I've done a bunch of things, and those are not important sometimes. But here's what I'd like to first thank Splunk for allowing me to be here. A lot of people work for a lot of organizations. I don't let them come to DevCon. I don't let them come to DevCon or Black Hat because they think it's a boondoggle. So, it's not a boondoggle. It's about making friends and learning from the community. So, I'm really grateful for Splunk for helping me do this. So, very quickly on the agenda, I basically want to cover four things today. First, I'll talk very briefly about what the motivations are for this kind of a discussion. Then we'll talk a very minimum set of requirements. Then we'll go over a couple of use cases. And then you'll see, because we'll use some specific technologies in our examples, then you can say, well, what if I don't have those sets? Stuff, technologies, what if I have something else, right? If you're thirsty, I have your solution here. So, you can get in the spirit of what's going on. Yeah. So, let's jump right into it. First thing, when you are looking at a network or an environment, when you show up to work every day in the morning, whether you're a sysadmin or whether you're a security analyst, and you come to work. work and it's your first day at work or your first week at work, you have to understand some things about your environment. Because you can't just get to work, right? There's no real sense of, oh, here's a piece of malware or here's an incident and so you're going to follow these steps. Some organizations are very mature. They have these things called runbooks. But I talk to hundreds of organizations a month and large majority of them do not have anything equivalent to what's a runbook. And for those of you who are not familiar with the term runbook, maybe you know it with other terms like playbooks. So the idea is that when you see an alert or when you see something interesting, you follow a certain set of processes. So what I want to do today is to talk a little bit about that in the context of a rapid response environment. The overall goal is what we want to do is really to reduce the cost of exploration. What do I mean by that? The thing is that when we see something bad, we all have a general sense, an intuitive sense of what to do about it. But maybe the tools that we're using or the environment that we're in, we can't actually execute those things. And so it takes a very long period of time to do any number of basic things. So I'm going to talk about some very simple things that can be aggregated together. None of this stuff is novel. I'm not the inventor of any of these techniques. But the thing is I see people burning lots and lots of time all the time. Whether they are just starting out in the security industry, whether they're IT guys, sysadmins, or if they're senior security guys who've been in the security industry for a long time, whether they're in the business for a long time, I see people burning a lot of time on the basics. And then ultimately what happens is people tend to give up and then you don't get value out of what's going on. So I want to go through a quick scenario. When you download a file somewhere, have you ever wondered maybe this is a bad file? And then what do you do? You try to figure out, like, has anyone seen it before? So maybe you upload it somewhere. Maybe you go to VirusTotal. Maybe you go somewhere else. And you try to figure out, well, no, my organization doesn't actually allow me to upload it, or I can't get to that web URL right now or something like that. And so ultimately you stop. You don't do that, right? How many people actually upload everything that they ever see to VirusTotal or something like that every time they get a download, right? There's like two people in the back. We don't because it's too expensive, because it takes too long. You have to make some choices. And if you take on the pain, then you have to work on it. If you tell someone, then you might end up being responsible for it. So you do nothing. And that's bogus. So my goal is to help you share a couple things with you so that you can aspire to do, in my mind, as little as possible, but do that with confidence so that you know where you're headed and what's going on. So let's take the last example, right? If you download a file from somewhere, and if you don't have a super awesome malware sandbox, no problem. Here's what you do. I'm going to go through sort of an ingredient section, and then I have a script at the end of this that's very simple that you can follow. So one of the things that you can use, you can download a file from somewhere, and if you don't have a super awesome malware sandbox, you can use the team comery. The team comery has a malware hash repository that you can interact with using DNS or Whois or even HTTP request. How many people are familiar with that? There's a few of you, right? And those of you who are not, you can use this. And so the URL is there. And then you can take whatever file you have, and you can run it through that, and you can get some results back, right? So here's a very basic example script of what that might look like. You might want to follow a directory, and for any file in that, so every time you're downloading a something, maybe it goes in a downloads directory, right? I think everybody sort of does that by default. And so what you can do is you can run a little job in bash that says any time something goes into that suspicious directory, I want to print the time stamp, and I want to make a request to team comery for this particular file. And then you can get the results back, and then you can move the file out of the suspicious directory into a directory that's called checked. Because you don't know whether this file is good or bad, but you know that you've checked it, right? So then it's done, so it's in that other directory. What team comery returns is a result. It's a very simple result that says it has a date and time stamp, which is what we printed, right? Because we echoed the date. And then team comery result is at the bottom of the screen here that's showing you a date, a last seen epoch time date, and the percentage of antiviruses that they have in their databases that actually detect that particular file as being malicious. So you may not have 15 different AV engines or 15 different analysis engines, but these guys probably have many, many. And so you can do a lot of different things with that. And you can take advantage of that very quickly. So very simple, very simple thing. You can attach that to everything that you download. So what did we do? Nothing fancy, right? We check a file in the directory every so often. We move the checked file, and we use dig to do a DNS lookup. I'll just go back if you missed that, right? So we used dig to do the lookup, which starts up here. And we're appending the name of the file that we picked up, and then we make the request, right? Plain and simple. So the next thing, what if how many people in this room used Splunk? So Splunk is a free download. You guys should like go get it, right? And it's I don't know, it's I'm biased. I've used Splunk for a long period of time, almost 10 years now. So you can download it. But if you have Splunk in your environment, and you want to integrate with something, you got a new tool, and you need to integrate it. Well, you can go and hire professional services, and you can do a whole bunch of other things and spend months trying to integrate it. And you can do a whole bunch of other figure that out. So let's figure out how we can shorten that time period in the spirit of being lazy. So the first thing that we want to do, as an example, Paul is going to talk at this venue later on this afternoon, I think. So he's working for a company, he started a company called Farsight. And Farsight has a lot of passive DNS information. So what if you want to integrate that passive DNS information with Splunk very quickly? Well, one of the things many people don't know is that Splunk has a CLI. You can run just about any command that you run on the Splunk web UI, you can run it from the CLI. So here's an example of looking at a particular set of logs from a firewall and then figuring out which ones are the top IP addresses and then looking those IP addresses up against the Farsight database. So plain and simple schedule again, right? It's just a for loop. So for anything I get, I'm going to run it from the Splunk server. So the Splunk search starts up here and it ends all the way down to here. This is the URL for the Splunk server. And then the results that come back, this is the Farsight script that you can download from Farsight. And then you can execute it. And so you get to know what happens, what's related to that particular IP address. If you did it on the command line, this is what it would look like. This is your output as a result of running that little, just that little snippet. So what capabilities did we use? Nothing fancy. We're connecting to a remote Splunk server. We're connecting to a remote Farsight server. We don't have any of these tools installed locally, right? Both things are remote. But we're connecting to both of these resources remotely. And then we're collecting the time stamps and storing it so we know when we check for something. Not bad, right? What do you guys think? Pretty simple? Yes? We can do this, right? So sometimes when you are doing response work, the results sometimes come back and say, well, why don't we just block it, right? Why don't we just block these things? We have a lot of confidence around what we're talking about. So let's stop whatever is going on. So how could you do that? If you're blocking IP addresses and making these types of configuration changes manually, man, that's, you're wasting a lot of time. Most of the firewalls today, most of the routers and switches, modern routers and switching equipment, they all have some sort of API that you can leverage. I'm going to use an example of a lot of the things that we're talking about here. So if you have a Palo Alto Networks firewall. Basically, if you have a Palo Alto Networks firewall in your environment and you get some threat intelligence from somewhere, you can use this little script called pan standalone change.py and it's on a GitHub repository. You can also get it from the Splunk app for Palo Alto Networks. And you can make modifications to your Palo Alto firewalls. And this is essentially what it looks like on the command line. So you can take some threat intel that somebody provided you. Maybe you're IAMing with one of your buddies and they say, hey, dude, these are five bad IP addresses. Why don't you go block them immediately or something, right? You put that in a file or you put them on the command line and you just cat it out. And then you can execute the script like so. So when you have that bad stuff file that we just saw in the previous screenshot, you cat that file and then you just pass that into the Palo Alto script that has the username and password of your Palo Alto config and it will update your Palo Alto configuration on the fly. So what did we use? We used a network API and we use some threat Intel that someone provided and we immediately made it actionable, right? So what would happen if you were to combine all three? So these are three very different examples, right? So let's review. So the first thing that we looked at is I downloaded something and then I checked for a hash against Team Cymru. Okay, interesting. The second thing that we did was what? Who was paying attention? What was the second technique that we used? We we integrated Splunk with farsight, right? Are you guys awake? Yeah! All right, you guys still asleep, it's alright. When the second thing we did was we integrated Splunk with Farsight, two applications that are very different that are enterprise applications but have reintegrated them on the fly, just on the command line. And then the third thing that we did was this automated blocking. So wouldn't it be cool if you could combine all those three techniques? How would you do that? Well, every time you download a file, you can look for a hash. If the hash matches something that's malware, you can then look back into the Farsight style of intelligence, whether it's Farsight or whatever it is that you use. Then you can know what were the different domains that were interacting with the same domain from where this file was downloaded from. And then you can block all of those domains automatically. So let me ask you a question. If you had to do that today, how long would that take you? It'd take you hours. And if you had to do that for every malicious file that you downloaded, you'll never catch up. But now I just gave you these three different pieces. You can line them up all together, one behind the other, and just pipe them through, and you're done. And you can do that for every single file that you downloaded. So let me ask you a question. How long would that take you? single thing that you download and you can do that automatically. So now that problem is solved. And if you're really paranoid and say, well, what if I block something that my people use all the time? You can match it. You can download the Alexa 1000 on a regular basis and you can diff it. You can just put that one pipe in the middle to diff it so it doesn't block something and then continue on with the rest of the pipe. Or if you're using Splunk, you can diff it with your own top 1000 or your own top 10,000 so that you return a Splunk search that's actually looking at all of those and then you can automate it in that fashion. So you're doing it responsibly. So we covered basically three different things across which we automated. We pulled data off the network, which was our little download example, right? And we looked at the endpoint, which was also our download example in some respects and the network example also with the Palo Alto that we're actually making changes. And then we also integrated that with thread intelligence. So the next time your boss says, can you integrate thread intelligence and network and endpoint information together? What are you going to tell him? What are you going to tell him? Yes, I can do that and I already did. So just a quick summary, right? Because we talked about some very specific things, I'm not endorsing any given product, right? All of you have different product mixes and you might use different technologies for any number of reasons. But abstractly speaking, these are the capabilities that we used. We did things on the command line. We didn't have to fight with somebody's gooey or we didn't have to struggle with things trying to do crazy things. We used a REST API or an API interaction, which was our Palo Alto example and also the API for Team Cummory using DIG and the API for Farsight using the Farsight Python script, it was already there. That script is already there, they just give it to you. So that's the second piece. And the third thing is just to keep because you don't have something doesn't mean that you can get access to something that is relevant. So as an example with the Splunk and Farsight integration, the Splunk install wasn't on our laptop in that example. Remember you had that URI? Let me back up. This one right? Nope, one more. This is a remote Splunk server. This is not what's installed on your laptop, on your desktop. So that's how you specify in Splunk that you're going to connect to a remote server. The DNS DB query from Farsight actually calls a remote Farsight server. So it's not even installed locally. You don't have these tools. The same thing is true for the Team Cymru example, right? You're just using the internet to help yourself do better. So that's the second piece that we use and we were able to do this enrichment with new intelligence that we received which was our threat Intel piece that somebody else is providing us. And we just use some Unix basics, right? Some Linux basics. We use Digg, we use Bash. And you can see those Bash strings are not super sophisticated. They're just very basic for loops with a little bit of catting or reading a file or reading from a particular search result. So I want to give a couple of shout outs. I want to thank Alan for Farsight for helping me get the Python DNS DB stuff and helping me understand how that works. Mark Benoit, he's one of the guys at Palo Alto Networks and he actually gave me a Palo Alto Firewall. to experiment with to test these kinds of things out. Lots of people use Palo Alto Firewalls. Of course, Team Cymru for making this stuff available for free for non-commercial uses. You can get commercial licenses from them. And of course, Splunk. And if you guys want to learn more about Splunk, there's a big Splunk booth back there. If you want to give a big shout out to my Splunk colleagues. Hey Splunkers, are you listening? Everybody wants to thank you. Say thank you, Splunk. Yeah! And of course, the Wall of Sheep family. I mean, without you guys and without all the Wall of Sheep organizers, this would not be possible. So my message to you is, let's go back to where we started. You should really aspire to do as little as possible, but do little with confidence so that you can do more. Thank you for your time.