1 00:00:00,000 --> 00:00:11,440 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. 2 00:00:12,200 --> 00:00:22,280 Monzi Mirza. Monzi have been, you know, from the humble roots of, you know, from the humble roots of, well, he's been everywhere. 3 00:00:22,280 --> 00:00:36,360 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. 4 00:00:36,980 --> 00:00:39,880 My pleasure to introduce to you, Monzi Mirza. 5 00:00:40,080 --> 00:00:40,700 That's it. 6 00:00:43,960 --> 00:00:44,900 Thank you, Ming. 7 00:00:45,020 --> 00:00:46,700 How are you guys doing? Can you hear me all right? 8 00:00:55,800 --> 00:00:57,580 Can you guys hear me okay now? Is this better? 9 00:00:57,840 --> 00:00:58,200 Yeah. 10 00:00:58,940 --> 00:00:59,700 Is this better? 11 00:01:00,120 --> 00:01:01,260 Yeah, all right. Good morning. 12 00:01:03,320 --> 00:01:05,280 So, thank you for the kind introduction, Ming. 13 00:01:05,300 --> 00:01:06,240 My name is Monzi Mirza. 14 00:01:06,280 --> 00:01:07,100 Our time is short. 15 00:01:07,200 --> 00:01:08,340 I'll get right to the point. 16 00:01:08,520 --> 00:01:11,900 I've done a bunch of things, and those are not important sometimes. 17 00:01:13,480 --> 00:01:17,760 But here's what I'd like to first thank Splunk for allowing me to be here. 18 00:01:17,900 --> 00:01:20,940 A lot of people work for a lot of organizations. 19 00:01:21,200 --> 00:01:22,260 I don't let them come to DevCon. 20 00:01:22,280 --> 00:01:24,140 I don't let them come to DevCon or Black Hat because they think it's a boondoggle. 21 00:01:25,360 --> 00:01:26,760 So, it's not a boondoggle. 22 00:01:26,860 --> 00:01:29,040 It's about making friends and learning from the community. 23 00:01:29,200 --> 00:01:33,700 So, I'm really grateful for Splunk for helping me do this. 24 00:01:34,000 --> 00:01:37,160 So, very quickly on the agenda, I basically want to cover four things today. 25 00:01:37,620 --> 00:01:41,300 First, I'll talk very briefly about what the motivations are for this kind of a discussion. 26 00:01:41,620 --> 00:01:43,840 Then we'll talk a very minimum set of requirements. 27 00:01:44,120 --> 00:01:45,580 Then we'll go over a couple of use cases. 28 00:01:45,740 --> 00:01:48,900 And then you'll see, because we'll use some specific technologies in our examples, 29 00:01:49,100 --> 00:01:52,140 then you can say, well, what if I don't have those sets? 30 00:01:52,280 --> 00:01:54,740 Stuff, technologies, what if I have something else, right? 31 00:01:56,020 --> 00:01:59,020 If you're thirsty, I have your solution here. 32 00:02:00,780 --> 00:02:04,960 So, you can get in the spirit of what's going on. 33 00:02:05,520 --> 00:02:05,920 Yeah. 34 00:02:08,620 --> 00:02:10,700 So, let's jump right into it. 35 00:02:10,880 --> 00:02:15,720 First thing, when you are looking at a network or an environment, 36 00:02:15,840 --> 00:02:17,940 when you show up to work every day in the morning, 37 00:02:18,000 --> 00:02:20,680 whether you're a sysadmin or whether you're a security analyst, 38 00:02:20,900 --> 00:02:22,040 and you come to work. 39 00:02:22,040 --> 00:02:26,220 work and it's your first day at work or your first week at work, you have to understand 40 00:02:26,220 --> 00:02:29,020 some things about your environment. Because you can't just get to work, right? There's 41 00:02:29,020 --> 00:02:34,080 no real sense of, oh, here's a piece of malware or here's an incident and so you're going 42 00:02:34,080 --> 00:02:37,740 to follow these steps. Some organizations are very mature. They have these things called 43 00:02:37,740 --> 00:02:43,680 runbooks. But I talk to hundreds of organizations a month and large majority of them do not 44 00:02:43,680 --> 00:02:47,760 have anything equivalent to what's a runbook. And for those of you who are not familiar 45 00:02:47,760 --> 00:02:52,440 with the term runbook, maybe you know it with other terms like playbooks. So the idea is 46 00:02:52,440 --> 00:02:55,560 that when you see an alert or when you see something interesting, you follow a certain 47 00:02:55,560 --> 00:03:00,720 set of processes. So what I want to do today is to talk a little bit about that in the 48 00:03:00,720 --> 00:03:06,460 context of a rapid response environment. The overall goal is what we want to do is really 49 00:03:06,460 --> 00:03:12,960 to reduce the cost of exploration. What do I mean by that? The thing is that when we 50 00:03:12,960 --> 00:03:17,420 see something bad, we all have a general sense, an intuitive sense of what to do about it. 51 00:03:17,760 --> 00:03:22,480 But maybe the tools that we're using or the environment that we're in, we can't actually 52 00:03:22,480 --> 00:03:26,960 execute those things. And so it takes a very long period of time to do any number of basic 53 00:03:26,960 --> 00:03:31,580 things. So I'm going to talk about some very simple things that can be aggregated together. 54 00:03:31,920 --> 00:03:36,080 None of this stuff is novel. I'm not the inventor of any of these techniques. But the 55 00:03:36,080 --> 00:03:41,160 thing is I see people burning lots and lots of time all the time. Whether they are just 56 00:03:41,160 --> 00:03:46,240 starting out in the security industry, whether they're IT guys, sysadmins, or if they're 57 00:03:46,240 --> 00:03:47,740 senior security guys who've been in the security industry for a long time, whether they're 58 00:03:47,760 --> 00:03:52,180 in the business for a long time, I see people burning a lot of time on the basics. And 59 00:03:52,180 --> 00:03:56,760 then ultimately what happens is people tend to give up and then you don't get value out 60 00:03:56,760 --> 00:04:00,820 of what's going on. So I want to go through a quick scenario. When you download a file 61 00:04:00,820 --> 00:04:05,960 somewhere, have you ever wondered maybe this is a bad file? And then what do you do? You 62 00:04:05,960 --> 00:04:09,900 try to figure out, like, has anyone seen it before? So maybe you upload it somewhere. 63 00:04:09,980 --> 00:04:14,340 Maybe you go to VirusTotal. Maybe you go somewhere else. And you try to figure out, well, no, 64 00:04:14,400 --> 00:04:17,600 my organization doesn't actually allow me to upload it, or I can't get to that 65 00:04:17,760 --> 00:04:23,220 web URL right now or something like that. And so ultimately you stop. You don't do that, 66 00:04:23,280 --> 00:04:27,300 right? How many people actually upload everything that they ever see to VirusTotal or something 67 00:04:27,300 --> 00:04:31,060 like that every time they get a download, right? There's like two people in the back. 68 00:04:31,740 --> 00:04:36,760 We don't because it's too expensive, because it takes too long. You have to make some 69 00:04:36,760 --> 00:04:42,080 choices. And if you take on the pain, then you have to work on it. If you tell someone, 70 00:04:42,220 --> 00:04:47,040 then you might end up being responsible for it. So you do nothing. And that's bogus. 71 00:04:47,760 --> 00:04:52,960 So my goal is to help you share a couple things with you so that you can aspire to do, in my 72 00:04:52,960 --> 00:04:58,380 mind, as little as possible, but do that with confidence so that you know where you're headed 73 00:04:58,380 --> 00:05:03,160 and what's going on. So let's take the last example, right? If you download a file from 74 00:05:03,160 --> 00:05:08,720 somewhere, and if you don't have a super awesome malware sandbox, no problem. Here's what you do. 75 00:05:09,700 --> 00:05:13,500 I'm going to go through sort of an ingredient section, and then I have a script at the end 76 00:05:13,500 --> 00:05:17,380 of this that's very simple that you can follow. So one of the things that you can use, 77 00:05:17,420 --> 00:05:17,740 you can download a file from somewhere, and if you don't have a super awesome malware sandbox, 78 00:05:17,760 --> 00:05:21,860 you can use the team comery. The team comery has a malware hash repository that you can interact 79 00:05:21,860 --> 00:05:27,640 with using DNS or Whois or even HTTP request. How many people are familiar with that? There's a 80 00:05:27,640 --> 00:05:33,000 few of you, right? And those of you who are not, you can use this. And so the URL is there. And 81 00:05:33,000 --> 00:05:37,640 then you can take whatever file you have, and you can run it through that, and you can get some 82 00:05:37,640 --> 00:05:42,980 results back, right? So here's a very basic example script of what that might look like. You 83 00:05:42,980 --> 00:05:47,740 might want to follow a directory, and for any file in that, so every time you're downloading a 84 00:05:47,740 --> 00:05:51,800 something, maybe it goes in a downloads directory, right? I think everybody sort of does that by 85 00:05:51,800 --> 00:05:56,560 default. And so what you can do is you can run a little job in bash that says any time something 86 00:05:56,940 --> 00:06:01,500 goes into that suspicious directory, I want to print the time stamp, and I want to make a 87 00:06:01,500 --> 00:06:06,660 request to team comery for this particular file. And then you can get the results back, and then 88 00:06:06,660 --> 00:06:10,600 you can move the file out of the suspicious directory into a directory that's called checked. 89 00:06:10,800 --> 00:06:13,720 Because you don't know whether this file is good or bad, but you know that you've checked it, 90 00:06:13,780 --> 00:06:17,720 right? So then it's done, so it's in that other directory. What team comery returns is a 91 00:06:17,720 --> 00:06:23,560 result. It's a very simple result that says it has a date and time stamp, which is what we 92 00:06:23,560 --> 00:06:28,460 printed, right? Because we echoed the date. And then team comery result is at the bottom of the 93 00:06:28,460 --> 00:06:34,560 screen here that's showing you a date, a last seen epoch time date, and the percentage of 94 00:06:35,440 --> 00:06:40,020 antiviruses that they have in their databases that actually detect that particular file as being 95 00:06:40,020 --> 00:06:45,400 malicious. So you may not have 15 different AV engines or 15 different analysis engines, but 96 00:06:45,400 --> 00:06:47,700 these guys probably have many, many. And so you can do a lot of different things with that. And 97 00:06:47,700 --> 00:06:52,180 you can take advantage of that very quickly. So very simple, very simple thing. You can attach 98 00:06:52,180 --> 00:06:58,540 that to everything that you download. So what did we do? Nothing fancy, right? We check a file in 99 00:06:58,540 --> 00:07:03,860 the directory every so often. We move the checked file, and we use dig to do a DNS lookup. I'll 100 00:07:03,860 --> 00:07:10,160 just go back if you missed that, right? So we used dig to do the lookup, which starts up here. And 101 00:07:10,160 --> 00:07:15,040 we're appending the name of the file that we picked up, and then we make the request, right? 102 00:07:15,040 --> 00:07:25,440 Plain and simple. So the next thing, what if how many people in this room used Splunk? So Splunk is a 103 00:07:25,440 --> 00:07:30,500 free download. You guys should like go get it, right? And it's I don't know, it's I'm biased. I've 104 00:07:30,500 --> 00:07:34,800 used Splunk for a long period of time, almost 10 years now. So you can download it. But if you have 105 00:07:34,800 --> 00:07:38,580 Splunk in your environment, and you want to integrate with something, you got a new tool, and 106 00:07:38,580 --> 00:07:43,420 you need to integrate it. Well, you can go and hire professional services, and you can do a whole 107 00:07:43,420 --> 00:07:45,020 bunch of other things and spend months trying to integrate it. And you can do a whole bunch of other 108 00:07:45,040 --> 00:07:49,040 figure that out. So let's figure out how we can shorten that time period in the spirit of being 109 00:07:49,040 --> 00:07:55,580 lazy. So the first thing that we want to do, as an example, Paul is going to talk at this venue 110 00:07:55,580 --> 00:07:59,940 later on this afternoon, I think. So he's working for a company, he started a company called 111 00:07:59,940 --> 00:08:04,260 Farsight. And Farsight has a lot of passive DNS information. So what if you want to integrate 112 00:08:04,260 --> 00:08:09,380 that passive DNS information with Splunk very quickly? Well, one of the things many people 113 00:08:09,380 --> 00:08:15,800 don't know is that Splunk has a CLI. You can run just about any command that you run on the 114 00:08:15,800 --> 00:08:22,340 Splunk web UI, you can run it from the CLI. So here's an example of looking at a particular set 115 00:08:22,340 --> 00:08:30,020 of logs from a firewall and then figuring out which ones are the top IP addresses and then 116 00:08:30,020 --> 00:08:35,700 looking those IP addresses up against the Farsight database. So plain and simple schedule 117 00:08:35,700 --> 00:08:39,360 again, right? It's just a for loop. So for anything I get, I'm going to run it from the 118 00:08:39,360 --> 00:08:44,240 Splunk server. So the Splunk search starts up here and it ends all the way down to here. 119 00:08:45,200 --> 00:08:50,460 This is the URL for the Splunk server. And then the results that come back, this is the 120 00:08:52,500 --> 00:08:56,960 Farsight script that you can download from Farsight. And then you can execute it. And so 121 00:08:56,960 --> 00:09:02,680 you get to know what happens, what's related to that particular IP address. If you did it on 122 00:09:02,680 --> 00:09:06,420 the command line, this is what it would look like. This is your output as a result of running 123 00:09:06,420 --> 00:09:08,580 that little, just that little snippet. 124 00:09:09,360 --> 00:09:14,660 So what capabilities did we use? Nothing fancy. We're connecting to a remote Splunk 125 00:09:14,660 --> 00:09:19,560 server. We're connecting to a remote Farsight server. We don't have any of these tools installed 126 00:09:19,560 --> 00:09:23,340 locally, right? Both things are remote. But we're connecting to both of these resources 127 00:09:23,340 --> 00:09:27,060 remotely. And then we're collecting the time stamps and storing it so we know when we 128 00:09:27,060 --> 00:09:32,040 check for something. Not bad, right? What do you guys think? Pretty simple? Yes? We 129 00:09:32,040 --> 00:09:39,120 can do this, right? So sometimes when you are doing response work, the results sometimes 130 00:09:39,360 --> 00:09:42,360 come back and say, well, why don't we just block it, right? Why don't we just block these 131 00:09:42,360 --> 00:09:46,660 things? We have a lot of confidence around what we're talking about. So let's stop whatever is 132 00:09:46,660 --> 00:09:54,040 going on. So how could you do that? If you're blocking IP addresses and making these types of 133 00:09:54,040 --> 00:10:00,300 configuration changes manually, man, that's, you're wasting a lot of time. Most of the firewalls 134 00:10:00,300 --> 00:10:05,780 today, most of the routers and switches, modern routers and switching equipment, they all have 135 00:10:05,780 --> 00:10:09,340 some sort of API that you can leverage. I'm going to use an example of a lot of the things that we're 136 00:10:09,360 --> 00:10:13,040 talking about here. So if you have a Palo Alto Networks firewall. Basically, if you have a 137 00:10:13,040 --> 00:10:16,700 Palo Alto Networks firewall in your environment and you get some threat intelligence from 138 00:10:16,700 --> 00:10:22,040 somewhere, you can use this little script called pan standalone change.py and it's on a GitHub 139 00:10:22,040 --> 00:10:26,680 repository. You can also get it from the Splunk app for Palo Alto Networks. And you can make 140 00:10:26,680 --> 00:10:31,200 modifications to your Palo Alto firewalls. And this is essentially what it looks like on the 141 00:10:31,200 --> 00:10:36,100 command line. So you can take some threat intel that somebody provided you. Maybe you're IAMing 142 00:10:36,100 --> 00:10:39,340 with one of your buddies and they say, hey, dude, these are five bad IP addresses. Why don't you go 143 00:10:39,360 --> 00:10:42,840 block them immediately or something, right? You put that in a file or you put them on the command 144 00:10:42,840 --> 00:10:51,000 line and you just cat it out. And then you can execute the script like so. So when you have that 145 00:10:51,000 --> 00:10:55,700 bad stuff file that we just saw in the previous screenshot, you cat that file and then you just 146 00:10:55,700 --> 00:11:01,600 pass that into the Palo Alto script that has the username and password of your Palo Alto config and 147 00:11:01,600 --> 00:11:08,200 it will update your Palo Alto configuration on the fly. So what did we use? We used a network API 148 00:11:08,200 --> 00:11:12,380 and we use some threat Intel that someone provided and we immediately made 149 00:11:12,380 --> 00:11:18,140 it actionable, right? So what would happen if you were to combine all three? So 150 00:11:18,140 --> 00:11:21,320 these are three very different examples, right? So let's review. So the first thing 151 00:11:21,320 --> 00:11:26,560 that we looked at is I downloaded something and then I checked for a hash 152 00:11:26,560 --> 00:11:31,400 against Team Cymru. Okay, interesting. The second thing that we did was what? Who was 153 00:11:31,400 --> 00:11:43,620 paying attention? What was the second technique that we used? We we integrated 154 00:11:43,620 --> 00:11:46,240 Splunk with farsight, right? Are you guys awake? 155 00:11:46,940 --> 00:11:54,100 Yeah! All right, you guys still asleep, it's alright. When the second thing we did 156 00:11:54,100 --> 00:11:59,120 was we integrated Splunk with Farsight, two applications that are very different 157 00:11:59,120 --> 00:12:01,380 that are enterprise applications but 158 00:12:01,380 --> 00:12:07,660 have reintegrated them on the fly, just on the command line. And then the third thing that we 159 00:12:07,660 --> 00:12:13,780 did was this automated blocking. So wouldn't it be cool if you could combine all those three 160 00:12:13,780 --> 00:12:19,240 techniques? How would you do that? Well, every time you download a file, you can look for a hash. 161 00:12:19,400 --> 00:12:25,820 If the hash matches something that's malware, you can then look back into the Farsight style 162 00:12:25,820 --> 00:12:31,020 of intelligence, whether it's Farsight or whatever it is that you use. Then you can know what were 163 00:12:31,020 --> 00:12:36,660 the different domains that were interacting with the same domain from where this file was 164 00:12:36,660 --> 00:12:42,080 downloaded from. And then you can block all of those domains automatically. So let me ask you 165 00:12:42,080 --> 00:12:47,900 a question. If you had to do that today, how long would that take you? It'd take you hours. And if 166 00:12:47,900 --> 00:12:53,660 you had to do that for every malicious file that you downloaded, you'll never catch up. But now I 167 00:12:53,660 --> 00:12:57,160 just gave you these three different pieces. You can line them up all together, one behind the 168 00:12:57,160 --> 00:13:00,720 other, and just pipe them through, and you're done. And you can do that for every 169 00:13:00,720 --> 00:13:01,000 single file that you downloaded. So let me ask you a question. How long would that take you? 170 00:13:01,000 --> 00:13:06,080 single thing that you download and you can do that automatically. So now that problem is solved. 171 00:13:06,760 --> 00:13:10,580 And if you're really paranoid and say, well, what if I block something that my people use all the 172 00:13:10,580 --> 00:13:16,680 time? You can match it. You can download the Alexa 1000 on a regular basis and you can diff it. You 173 00:13:16,680 --> 00:13:20,840 can just put that one pipe in the middle to diff it so it doesn't block something and then continue 174 00:13:20,840 --> 00:13:25,980 on with the rest of the pipe. Or if you're using Splunk, you can diff it with your own top 1000 175 00:13:25,980 --> 00:13:31,660 or your own top 10,000 so that you return a Splunk search that's actually looking at all of 176 00:13:31,660 --> 00:13:35,740 those and then you can automate it in that fashion. So you're doing it responsibly. So we 177 00:13:35,740 --> 00:13:41,220 covered basically three different things across which we automated. We pulled data off the 178 00:13:41,220 --> 00:13:48,460 network, which was our little download example, right? And we looked at the endpoint, which was 179 00:13:48,460 --> 00:13:52,500 also our download example in some respects and the network example also with the Palo Alto that 180 00:13:52,500 --> 00:13:55,900 we're actually making changes. And then we also integrated that with thread intelligence. 181 00:13:55,980 --> 00:14:00,080 So the next time your boss says, can you integrate thread intelligence and network and 182 00:14:00,080 --> 00:14:07,620 endpoint information together? What are you going to tell him? What are you going to tell him? Yes, 183 00:14:07,700 --> 00:14:16,580 I can do that and I already did. So just a quick summary, right? Because we talked about some 184 00:14:16,580 --> 00:14:21,420 very specific things, I'm not endorsing any given product, right? All of you have different 185 00:14:21,420 --> 00:14:25,020 product mixes and you might use different technologies for any number of reasons. 186 00:14:25,980 --> 00:14:32,300 But abstractly speaking, these are the capabilities that we used. We did things on the command line. 187 00:14:32,540 --> 00:14:36,440 We didn't have to fight with somebody's gooey or we didn't have to struggle with things trying to 188 00:14:36,440 --> 00:14:43,420 do crazy things. We used a REST API or an API interaction, which was our Palo Alto example and 189 00:14:43,420 --> 00:14:49,320 also the API for Team Cummory using DIG and the API for Farsight using the Farsight Python script, 190 00:14:49,400 --> 00:14:55,960 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 191 00:14:55,980 --> 00:14:58,640 because you don't have something doesn't mean that you can get access to 192 00:14:58,640 --> 00:15:02,980 something that is relevant. So as an example with the Splunk and Farsight 193 00:15:02,980 --> 00:15:06,900 integration, the Splunk install wasn't on our laptop in that example. Remember 194 00:15:06,900 --> 00:15:18,760 you had that URI? Let me back up. This one right? Nope, one more. This is a remote 195 00:15:18,760 --> 00:15:22,220 Splunk server. This is not what's installed on your laptop, on your desktop. 196 00:15:22,360 --> 00:15:24,880 So that's how you specify in Splunk that you're going to connect to a remote 197 00:15:24,880 --> 00:15:30,700 server. The DNS DB query from Farsight actually calls a remote Farsight server. 198 00:15:30,860 --> 00:15:33,640 So it's not even installed locally. You don't have these tools. The same thing is 199 00:15:33,640 --> 00:15:37,700 true for the Team Cymru example, right? You're just using the internet to help 200 00:15:37,700 --> 00:15:42,240 yourself do better. So that's the second piece that we use and we 201 00:15:42,740 --> 00:15:47,980 were able to do this enrichment with new intelligence that we received which was 202 00:15:47,980 --> 00:15:51,420 our threat Intel piece that somebody else is providing us. And we just use 203 00:15:51,420 --> 00:15:54,860 some Unix basics, right? Some Linux basics. We use Digg, we use 204 00:15:54,860 --> 00:16:00,020 Bash. And you can see those Bash strings are not super sophisticated. They're just very 205 00:16:00,020 --> 00:16:07,020 basic for loops with a little bit of catting or reading a file or reading from a particular 206 00:16:07,020 --> 00:16:13,140 search result. So I want to give a couple of shout outs. I want to thank Alan for Farsight 207 00:16:13,140 --> 00:16:19,100 for helping me get the Python DNS DB stuff and helping me understand how that works. Mark 208 00:16:19,100 --> 00:16:24,840 Benoit, he's one of the guys at Palo Alto Networks and he actually gave me a Palo Alto Firewall. 209 00:16:24,860 --> 00:16:28,420 to experiment with to test these kinds of things out. Lots of people use Palo Alto Firewalls. 210 00:16:28,580 --> 00:16:31,620 Of course, Team Cymru for making this stuff available for free for 211 00:16:32,920 --> 00:16:36,220 non-commercial uses. You can get commercial licenses from them. And of 212 00:16:36,220 --> 00:16:39,220 course, Splunk. And if you guys want to learn more about Splunk, there's a big 213 00:16:39,220 --> 00:16:42,260 Splunk booth back there. If you want to give a big shout out to my Splunk 214 00:16:42,260 --> 00:16:46,040 colleagues. Hey Splunkers, are you listening? Everybody wants to thank you. 215 00:16:46,060 --> 00:16:52,720 Say thank you, Splunk. Yeah! And of course, the Wall of Sheep family. I mean, without 216 00:16:52,720 --> 00:16:54,400 you guys and without all the Wall of Sheep 217 00:16:54,860 --> 00:17:00,160 organizers, this would not be possible. So my message to you is, let's go back to 218 00:17:00,160 --> 00:17:04,760 where we started. You should really aspire to do as little as possible, but do little 219 00:17:04,760 --> 00:17:08,960 with confidence so that you can do more. Thank you for your time.