1 00:00:00,000 --> 00:00:01,440 We're here to talk to you all today. 2 00:00:01,440 --> 00:00:02,080 All right, there we go. 3 00:00:02,080 --> 00:00:03,940 We're starting off right nice. 4 00:00:04,180 --> 00:00:08,220 Now, we're here to talk to you all about data science up here in the Splunk field and what we do. 5 00:00:08,400 --> 00:00:11,720 Now, before we go much further... oh, there we go. 6 00:00:12,000 --> 00:00:12,720 Electricity. 7 00:00:12,840 --> 00:00:15,340 Before we go much further, I have one thing to say. 8 00:00:15,580 --> 00:00:20,220 We're not going to talk about anything here that requires you to purchase anything, which is good. 9 00:00:20,220 --> 00:00:23,940 But if I did, don't buy anything on what we say, because we lie often. 10 00:00:24,180 --> 00:00:26,940 Mostly about the capabilities of our math abilities. 11 00:00:26,940 --> 00:00:29,700 So, my name is Ryan Kovar. 12 00:00:29,700 --> 00:00:32,100 I'm a principal Splunk security strategist. 13 00:00:32,220 --> 00:00:34,140 I've been around doing this for a while. 14 00:00:34,140 --> 00:00:39,280 And for those of you in the audience who are good at math, we have 30 minutes to go through 81 slides. 15 00:00:39,560 --> 00:00:42,200 So, do the math and I'm going to quickly move on. 16 00:00:43,360 --> 00:00:45,300 But not do well for choreography. 17 00:00:45,320 --> 00:00:53,000 Hey guys, I'm Dave Harreld, also a security strategist at Splunk and been around also quite a while. 18 00:00:53,000 --> 00:00:54,280 Do a lot with SANS. 19 00:00:54,820 --> 00:01:03,200 Ryan and I and a bunch of other people up here, David and a bunch of people in the audience, work on this thing called Splunk Boss of the Sock, which we would love for you to check out sometime. 20 00:01:05,220 --> 00:01:07,020 And my name is also David. 21 00:01:07,020 --> 00:01:09,440 I'm also a principal security strategist for Splunk. 22 00:01:09,500 --> 00:01:12,140 And I also do a lot of the same things these guys did. 23 00:01:12,180 --> 00:01:14,360 And I'm doing my best to not talk about MITRE today. 24 00:01:14,360 --> 00:01:15,940 So, that's my personal growth goal. 25 00:01:18,280 --> 00:01:19,840 However , I did have a talk at Blackout. 26 00:01:19,840 --> 00:01:20,860 So, feel free to go back. 27 00:01:20,860 --> 00:01:22,760 So, we do a lot of things. 28 00:01:22,760 --> 00:01:24,020 We've been doing this for a long time. 29 00:01:24,020 --> 00:01:27,440 There's a lot of people up here who have experience doing plumbing for networking. 30 00:01:27,440 --> 00:01:30,780 We've done some science and data and some research and development. 31 00:01:30,820 --> 00:01:32,400 We are certainly not experts in the field. 32 00:01:32,400 --> 00:01:34,960 And that's exactly what this talk is about. 33 00:01:35,460 --> 00:01:39,720 What we're going to go briefly over are the things that we've tried in the world of data science. 34 00:01:39,720 --> 00:01:42,460 What it means to be a citizen data scientist. 35 00:01:42,460 --> 00:01:43,920 The things we're actually trying to do. 36 00:01:43,920 --> 00:01:47,560 And then we're going to go into the works in progress for some of our ongoing research. 37 00:01:49,260 --> 00:01:49,940 All right. 38 00:01:49,940 --> 00:02:02,620 So, as Ryan just mentioned, this talk is all about applying machine learning from the perspective of security practitioners, not from the perspective of someone who's trained in data science. 39 00:02:02,620 --> 00:02:06,720 A lot of these things we did to teach ourselves how to do machine learning. 40 00:02:07,240 --> 00:02:10,120 And how to think like a data scientist. 41 00:02:10,120 --> 00:02:16,100 We consider ourselves citizen data scientists, which is a term from Gartner, which we kind of like. 42 00:02:16,180 --> 00:02:22,960 We're going to talk about this called the MLTK, which is a toolkit that you can run on top of Splunk. 43 00:02:23,560 --> 00:02:28,900 We generally use Splunk because we work there and they pay for our kids to go to college and things like that. 44 00:02:28,900 --> 00:02:34,660 But these topics are generally applicable across a wide variety of different tool sets. 45 00:02:34,660 --> 00:02:36,920 So, don't get hung up on Splunk. 46 00:02:37,080 --> 00:02:40,080 MLTK is an add-on that you can install on top of Splunk. 47 00:02:40,080 --> 00:02:46,000 It's a toolkit that allows you to apply all kinds of different algorithms. 48 00:02:46,660 --> 00:02:51,000 It is a thin wrapper over some Python machine learning libraries. 49 00:02:51,000 --> 00:02:52,340 Super useful. 50 00:02:53,500 --> 00:02:56,700 There's a little bit of stuff that you can do in the MLTK. 51 00:02:56,700 --> 00:02:58,280 I'm not going to go over it all. 52 00:02:58,280 --> 00:03:07,020 But you can do things like numeric predictions and categorization and forecasting and outlier detection and a whole bunch of other cool stuff using this toolkit. 53 00:03:07,600 --> 00:03:09,880 And with that, Mr. 54 00:03:09,880 --> 00:03:18,620 Verve is going to go over some things that we can do with that toolkit and with some of the other pieces of Splunk or any other analytic toolkit. 55 00:03:20,340 --> 00:03:23,880 So, yeah, let's talk about some actual detections. 56 00:03:23,880 --> 00:03:30,780 So, a part of our day-to-day life is going out and talking with customers who want to be deploying security machine learning. 57 00:03:30,780 --> 00:03:38,200 And security machine learning is one of my favorite subjects to walk into a customer to talk about because most of the time, they don't really know what they're actually looking for. 58 00:03:38,380 --> 00:03:43,300 And so, I can talk about the magic of bespoke machine learning and how we can deploy all this type of stuff. 59 00:03:43,780 --> 00:03:52,360 And a lot of the time, what they actually want is really simple statistics, which I'm sure should resonate with everybody because this is the life of data science. 60 00:03:52,820 --> 00:04:04,020 Most of the time, inside of the land of security, the things we see people getting the greatest amount of value from are rarity detections, looking for things that are uncommon or first-time seen, like being able to detect the first time somebody goes to a domain, 61 00:04:04,020 --> 00:04:11,240 first time somebody launches a particular process, first time a particular process launches with this particular file hash, things like that. 62 00:04:11,320 --> 00:04:16,380 Or time series spikes, being able to track something that happens more than it typically does. 63 00:04:16,620 --> 00:04:20,240 A lot of this can be done with simple things like standard deviation. 64 00:04:20,260 --> 00:04:28,900 And we really like to describe this concept to end consumers because in that idea of the citizen data scientist, it's not something that takes a PhD. 65 00:04:29,060 --> 00:04:35,300 We can have the conversation about different types of distributions and whether standard deviation is a fair thing. 66 00:04:35,340 --> 00:04:40,260 And Kovar loves to talk about IQR versus standard deviation. 67 00:04:40,260 --> 00:04:46,580 But at the end of the day, what we want to be able to do is give people a ton of different content that's very straightforward for them to deploy. 68 00:04:46,700 --> 00:04:49,640 And I'm sure you're all sitting here reading through each item in that slide deck. 69 00:04:50,140 --> 00:05:00,180 You have to look at all of them because functionally, when we look at these kind of simple categories, where we see people driving tremendous value with the ease of customization for it. 70 00:05:00,480 --> 00:05:02,760 So for example, take this detection here. 71 00:05:02,780 --> 00:05:08,980 This looks for new error codes being generated by users in AWS data. 72 00:05:09,640 --> 00:05:19,420 And the way that it's doing it is looking at a corpus of AWS data and it's saying give me the first time and the last time that this error occurred for this particular user. 73 00:05:19,420 --> 00:05:28,820 And we look for if the first time is in the last day or if you're running on an hourly basis in the last hour or if you want to get fancy, you can say since last time I ran it or things like that. 74 00:05:28,820 --> 00:05:31,440 But functionally, it's a pretty straightforward type of detection. 75 00:05:31,920 --> 00:05:40,960 And the great thing about it is if you want to spin this around in a different direction, all you have to do is change the data source and what fields you're looking at. 76 00:05:40,960 --> 00:05:46,720 So instead of looking at error codes generated by users, which is, you know, casually interesting. 77 00:05:46,720 --> 00:05:52,100 One of my favorite ones is looking at the first time a particular user generates a particular or hits a particular API. 78 00:05:52,100 --> 00:05:58,600 If I've never created an instance before, I should have a record of David all of a sudden created a bunch of instances. 79 00:05:58,600 --> 00:06:06,020 If I've never interacted with a particular region and all of a sudden I start spinning a bunch of instances in a particular region , that's also really useful information. 80 00:06:07,120 --> 00:06:10,100 So these are the things we talk about in a high level . 81 00:06:10,180 --> 00:06:11,600 But how do we actually go apply that? 82 00:06:11,600 --> 00:06:14,660 How does that really work in the real world? 83 00:06:15,160 --> 00:06:17,640 And you'll note, this is customized for Las Vegas. 84 00:06:18,100 --> 00:06:19,160 Polish here. 85 00:06:19,360 --> 00:06:23,420 So this is one of the things that we've actually seen customers deploy to a great extent. 86 00:06:23,420 --> 00:06:26,800 And my favorite example of all can talk at great length about it. 87 00:06:26,840 --> 00:06:29,780 But as we mentioned, 81 slides, 30 minutes, no time for great length. 88 00:06:29,780 --> 00:06:32,500 My favorite example is from JP Morgan Chase. 89 00:06:32,500 --> 00:06:34,700 They presented at our user conference in 2017. 90 00:06:34,700 --> 00:06:38,780 And I have happily stolen this slide from them. 91 00:06:38,780 --> 00:06:44,860 And they built a system for monitoring all types of their critical users. 92 00:06:44,860 --> 00:06:55,280 So whether it's an exec or a sysadmin or somebody who can send a lot of money someplace, they want to track extra detail or put extra attention on those types of users. 93 00:06:55,320 --> 00:06:59,700 And so what they have done is deployed a bunch of different first-time scene detections. 94 00:06:59,820 --> 00:07:02,360 So we've got first time that an email comes in from an address. 95 00:07:02,360 --> 00:07:04,780 First time a particular domain sends an email. 96 00:07:04,780 --> 00:07:06,360 First time they get an attachment type. 97 00:07:06,360 --> 00:07:10,600 They get a PDF for the first time or a CR file or whatever. 98 00:07:10,720 --> 00:07:12,420 First time a service gets installed. 99 00:07:12,420 --> 00:07:14,440 First time the registry gets modified, et cetera, et cetera, et cetera. 100 00:07:14,440 --> 00:07:19,100 And again, this is in the Splunk nomenclature, we use SPL for our search language. 101 00:07:19,100 --> 00:07:24,240 It's the same search language that gets applied for each one of these and you just change the fields and change the data source. 102 00:07:24,240 --> 00:07:27,800 The same thing applies for all other types of data analytics platforms as well. 103 00:07:28,360 --> 00:07:37,860 And what they do is they then aggregate all of these risky events or new events and then look for activities that are occurring across multiple different, in this case, phases of the kill chain. 104 00:07:37,860 --> 00:07:40,480 Because they presented this in 2017 before MITRE. 105 00:07:40,620 --> 00:07:41,740 I broke my rule. 106 00:07:41,740 --> 00:07:42,820 I wasn't going to say MITRE. 107 00:07:43,260 --> 00:07:45,940 Before MITRE became the buzzword du jour. 108 00:07:45,940 --> 00:07:59,420 But this functional idea of saying if we see a user has a new sending address and a new process created and a new connection and new attempted access, like, that's a lot of suspicious things that we can now say this should be analyzed immediately. 109 00:07:59,640 --> 00:08:00,740 And it's really useful. 110 00:08:01,260 --> 00:08:05,840 But of course, we're presenting at AI Village, so we like machine learning, too. 111 00:08:05,880 --> 00:08:08,820 And everything we're going to talk about for the rest of this presentation is actual machine learning. 112 00:08:09,020 --> 00:08:20,940 My favorite, because it was my first, machine learning detection, which I worked with our data scientists at Splunk to build out, was this great, it's a buzzword bingo of descriptions that uses standard deviation and IQR so it can make Kovar happy. 113 00:08:20,980 --> 00:08:35,880 It uses K-means clustering, it uses PCA, lots of different fun things in here to be able to look at anomalies in Salesforce data, which in this case was me, because I pulled, like, 38 million results out of our Salesforce data, looking at, like, opportunities and things like that, 114 00:08:35,880 --> 00:08:38,120 because I didn't know how to use Tableau. 115 00:08:38,120 --> 00:08:39,160 But it was great. 116 00:08:39,160 --> 00:08:45,660 It was a good use case, and we're actually able to find bad things of users who are acting anomalously in a multivariate way in Salesforce data. 117 00:08:46,000 --> 00:08:52,020 I felt particularly great about it, because I had 110 million audit events from 90,000 different users. 118 00:08:52,200 --> 00:09:00,040 I found, kind of, scoped my IQR down to 291 outliers, and 291 outliers over the course of 90 days is three outliers a day. 119 00:09:00,040 --> 00:09:01,280 That is a decent number. 120 00:09:01,280 --> 00:09:03,820 That is something I can actually give to a SOC analyst. 121 00:09:03,820 --> 00:09:05,580 It's not going to overwhelm them with noise. 122 00:09:05,580 --> 00:09:06,400 I felt great. 123 00:09:06,400 --> 00:09:07,560 I felt super happy. 124 00:09:07,560 --> 00:09:15,940 And then I actually looked at what I'd be sending to a SOC analyst, and it's a bunch of z-scores of how many standard deviations somebody was away from their particular average on that particular day. 125 00:09:15,960 --> 00:09:18,840 And no SOC analyst will use this. 126 00:09:18,840 --> 00:09:27,920 They will see it, and they'll say, that's fun, and throw it aside and go deal with a vulnerability scan or something else that is also terrible to deal with, but less complicated. 127 00:09:27,960 --> 00:09:31,220 So we said, okay, wait, why don't we make something a little bit simpler? 128 00:09:31,600 --> 00:09:36,680 And when we're looking at simplicity, my favorite of these is kernel density. 129 00:09:37,320 --> 00:09:40,420 Not just because this meme makes me extraordinarily happy. 130 00:09:41,260 --> 00:09:46,740 Kernel density, for those who don't know, is a lot of machine learning that allows us to detect randomness. 131 00:09:46,740 --> 00:09:52,020 And frankly, I don't care about the details of the machine learning, because I'm the citizen data scientist. 132 00:09:52,020 --> 00:09:53,920 I'm not the actual data scientist. 133 00:09:54,200 --> 00:10:16,120 What I really care about is the ability to put a single piece of SPL up on the screen that works and allows me to build a baseline, and then add one more command to invoke Splunk's machine learning toolkit to be able to look at anomalies in the amount of data being sent out inside of our own firewall logs. 134 00:10:16,120 --> 00:10:35,900 And to test this out, to validate that this actually worked, this was back in the day before GDPR hit and we actually had access to some internal data, I tracked users who were exfiltrating data from or sending out data from Splunk's own environment and found one user who uploaded 130 gigs of data to Dropbox on a Friday afternoon, 135 00:10:35,900 --> 00:10:39,280 blowing out all of the per hour baselines established. 136 00:10:40,380 --> 00:10:41,820 It's totally legit. 137 00:10:41,820 --> 00:10:47,360 You can ask anybody, Dropbox is for sure a customer that we use, or a product that we use. 138 00:10:47,360 --> 00:10:52,920 Definitely not something that is not a Splunk product, so you don't have to be any concerned at all about that, it's fine. 139 00:10:53,160 --> 00:10:55,240 But this is a great result. 140 00:10:55,240 --> 00:11:04,580 It's clearly valuable, it's clearly understandable for an analyst, and literally it's adding one extra line of SPL into a query that I already used. 141 00:11:04,780 --> 00:11:12,000 So this is kind of the power of being able to expose these types of capabilities to the citizen data scientist to make it very easy to do. 142 00:11:12,480 --> 00:11:15,900 But of course, in our team, we also like to do research. 143 00:11:16,220 --> 00:11:18,680 So let's talk about the research. 144 00:11:21,270 --> 00:11:22,050 All right. 145 00:11:22,050 --> 00:11:34,210 So this is a short overview of a talk that we did a couple years ago, Ryan and I did at the Threat Intelligence Summit, I guess a year and a half ago. 146 00:11:34,470 --> 00:11:41,150 And so you might want to check out that talk if you're interested in what we're about to kind of give just a little bit of a taste of here. 147 00:11:42,510 --> 00:11:52,530 First thing, kind of the inspiration for this, there's a gentleman Mark Parsons, if you don't follow him, he's an amazing researcher, Threat Intelligence Analyst, works at Microsoft. 148 00:11:52,890 --> 00:12:10,130 And he had been doing a lot of work on analyzing SSL certificates and using them sort of as a new way to track adversaries and to track behaviors, especially considering that most of the traffic that we see today now on our networks, when we look at wire data is encrypted. 149 00:12:10,130 --> 00:12:12,610 And so that takes away a lot of visibility. 150 00:12:12,610 --> 00:12:15,590 But one thing that's left are the SSL certificates themselves. 151 00:12:15,590 --> 00:12:24,250 He's done an awesome amount of work on this topic and kind of inspired us to do some similar things in our tool set. 152 00:12:24,350 --> 00:12:40,620 So obviously, everybody knows, I think, what an SSL certificate is, but it's basically an artifact that allows you to assign a crypto key to some information in the subject of the certificate. 153 00:12:40,840 --> 00:12:43,980 And it's super important, obviously, for SSL. 154 00:12:43,980 --> 00:12:47,640 And we have visibility to it when we look at network data. 155 00:12:48,140 --> 00:12:57,880 We thought it'd be interesting to teach ourselves a little bit about machine learning and maybe do something that's useful with this huge data set. 156 00:12:57,880 --> 00:13:06,060 And so we asked a very simple research question, which is, can we build a model that would predict inclusion on an SSL blacklist? 157 00:13:06,140 --> 00:13:11,680 And so we have an SSL blacklist that comes from abuse.ch. 158 00:13:11,680 --> 00:13:17,860 And we have a huge corpus of SSL certificates that come from the Rapid7 project Sonar. 159 00:13:17,860 --> 00:13:25,140 You should check out both of those projects, especially the Sonar project is extremely interesting if you're looking for a big data set. 160 00:13:25,740 --> 00:13:36,400 And so we took that and we said, hey, we essentially have some labeled data in that we have data that's either on this list or not, and we have a huge corpus. 161 00:13:36,400 --> 00:13:43,620 And so we thought this would be an interesting first foray into supervised machine learning. 162 00:13:45,080 --> 00:13:48,920 Started off down the trail of feature selection. 163 00:13:48,940 --> 00:13:59,860 And in Splunk, at least, it's nice because you can look at data like on the left, which is gives you sort of a view that's easily consumed by humans. 164 00:13:59,860 --> 00:14:09,020 And on the right, something that tabular view that we can feed into our machine learning model and use for as features. 165 00:14:09,100 --> 00:14:11,580 And we just did some simple, very simple things. 166 00:14:11,580 --> 00:14:13,000 We started off simple, right? 167 00:14:13,500 --> 00:14:19,080 Number of certificate extensions, number of issuer elements, number of subject elements, et cetera. 168 00:14:19,080 --> 00:14:20,100 You can read those off. 169 00:14:20,100 --> 00:14:25,900 A very simple list of quantitative features that we began to use. 170 00:14:25,900 --> 00:14:28,400 And we really didn't modify this too much, honestly. 171 00:14:28,500 --> 00:14:32,440 We got actually a lot of mileage out of this, which I was surprised by. 172 00:14:33,860 --> 00:14:36,160 Put that into... and we used our machine learning toolkit. 173 00:14:36,160 --> 00:14:46,260 We did some PCA, which I don't have a slide up here for, but principal component analysis to kind of figure out which of those features actually had an impact on the data. 174 00:14:46,280 --> 00:14:51,940 And then we fed that into a whole bunch of different machine learning algorithms. 175 00:14:51,940 --> 00:14:58,080 And honestly, I'm a citizen data scientist, so I don't know the ins and outs of every single one of these. 176 00:14:58,080 --> 00:15:01,980 But I can tell how they look, how they perform, right? 177 00:15:02,100 --> 00:15:03,240 Against one another. 178 00:15:03,240 --> 00:15:14,660 So I can say obviously this support vector machine showed up as high accuracy rate with a low false positive rate, which was super cool. 179 00:15:16,060 --> 00:15:17,540 We built this model. 180 00:15:18,000 --> 00:15:19,080 It didn't take too long. 181 00:15:19,080 --> 00:15:23,220 It took a long time to load all that certificate data that I mentioned earlier. 182 00:15:23,220 --> 00:15:25,420 It didn't take too long to build the model. 183 00:15:26,020 --> 00:15:27,040 Applied it. 184 00:15:27,040 --> 00:15:31,240 This is the things that you can do very simply with SPL. 185 00:15:31,240 --> 00:15:33,360 There's SPL shown there. 186 00:15:33,360 --> 00:15:39,660 It doesn't look too simple, maybe, but if you read through it, it's actually not too complicated. 187 00:15:39,660 --> 00:15:40,840 It's quite repetitive. 188 00:15:41,180 --> 00:15:44,240 There's not too much there as far as complexity. 189 00:15:45,080 --> 00:15:49,040 And the cool thing was we found tons and tons of these certificates, right? 190 00:15:49,040 --> 00:15:54,160 Which we predicted that would be on the blacklist and that actually were. 191 00:15:54,620 --> 00:15:57,040 And this was very useful, right? 192 00:15:58,420 --> 00:16:02,160 It was useful because it could add context to something, right? 193 00:16:02,360 --> 00:16:12,420 Remember that we had that 4% false positive rate, which if you're running this across the corpus of millions and millions of millions of certificates, that's not that useful, right? 194 00:16:12,420 --> 00:16:15,780 Because 4% of a giant number is still a giant number. 195 00:16:15,860 --> 00:16:19,160 However, it's super useful for adding context. 196 00:16:19,160 --> 00:16:29,740 And so, in our day jobs, what we're trying to do is help customers see an alert and understand if that alert is something that they can ignore or if it's something that they need to investigate more. 197 00:16:29,820 --> 00:16:33,540 And in order to do that, you do a lot of enrichment. 198 00:16:33,720 --> 00:16:35,960 This is a great way to enrich data. 199 00:16:36,520 --> 00:16:38,340 So, you can say, oh, I see this alert. 200 00:16:38,920 --> 00:16:40,580 It has certain characteristics. 201 00:16:40,580 --> 00:16:43,600 I'm trying to determine, you know, is this important to me or not? 202 00:16:44,000 --> 00:16:46,140 And also, I can say, well, you know what? 203 00:16:46,140 --> 00:16:54,580 That certificate is not on a blacklist because it would have triggered probably a filter that, you know, some sort of a match if it were. 204 00:16:54,640 --> 00:16:56,060 But we can also say, you know what? 205 00:16:56,060 --> 00:17:00,420 That shares a lot of characteristics with other certificates that are on that blacklist. 206 00:17:00,420 --> 00:17:07,620 And that might give us a little bit of extra context to be able to be a little quicker in how we triage that event. 207 00:17:09,080 --> 00:17:16,000 That was... yeah, that's right. 208 00:17:17,760 --> 00:17:20,780 So, that was an extremely fast overview of that. 209 00:17:20,780 --> 00:17:27,300 Again, if you want to see a lot more detail about that process, definitely check out the talk that we referenced earlier. 210 00:17:27,300 --> 00:17:28,420 And we have a link to here. 211 00:17:28,420 --> 00:17:34,380 And I'm going to let Ryan talk a little bit now about... So, the whole goal of this, right? 212 00:17:34,380 --> 00:17:37,320 Everything we're doing is to reduce your data set. 213 00:17:37,320 --> 00:17:41,380 Because I don't know the hell that Dave was just talking about for five minutes for PCA. 214 00:17:41,380 --> 00:17:42,500 I can't do any of that. 215 00:17:42,500 --> 00:17:44,860 But I can read a computer screen and look through it. 216 00:17:44,860 --> 00:17:49,460 And what we're trying to do is really find the bears in your network, right? 217 00:17:49,520 --> 00:17:58,160 Because when you start off with tens of millions of events, but you can find the things that sort of match, that's where you start getting the real return on investment for machine learning across a real data set. 218 00:17:58,160 --> 00:18:06,820 So, what we learned was, it sure as hell doesn't solve cyber, but it can really help you add context and actually bubble up the things that matter in your alerts or whatever else you're looking for. 219 00:18:06,820 --> 00:18:08,320 So, we have this going on. 220 00:18:08,320 --> 00:18:09,000 We tried it. 221 00:18:09,000 --> 00:18:10,060 We had a lot of good success. 222 00:18:10,060 --> 00:18:16,480 Because remember, the whole goal of this exercise for Dave and I was just to learn, could we actually do data science? 223 00:18:16,480 --> 00:18:18,020 Could we actually take machine learning? 224 00:18:18,020 --> 00:18:20,780 I am literally someone who failed math in first grade. 225 00:18:20,980 --> 00:18:22,720 So, for me, this was a real challenge. 226 00:18:22,720 --> 00:18:24,100 And I found it was actually doable. 227 00:18:24,100 --> 00:18:29,500 And we had results at work compared to the bullshit marketing stuff that we've all seen, so this was pretty exciting. 228 00:18:29,900 --> 00:18:33,400 So, we said, all right, next ML challenge, where's Glass Joe? 229 00:18:34,120 --> 00:18:36,900 So, we said, cool, let's go back in history a little bit. 230 00:18:36,900 --> 00:18:38,720 We have a little bit of a theme here with bears. 231 00:18:39,800 --> 00:18:40,160 Mr. 232 00:18:40,160 --> 00:18:41,660 Podesta once received an email. 233 00:18:41,660 --> 00:18:43,080 It looked just like this. 234 00:18:44,160 --> 00:18:46,720 And then there's another email that looks just like this. 235 00:18:46,960 --> 00:18:54,000 Now, there's a big difference between these two emails, one of which has a bitly link to get his Gmail account changed, and the other goes to Google mail. 236 00:18:54,360 --> 00:19:00,940 There's virtually no other difference in the legitimacy of this email other than you have a bitly link and you have a Gmail link. 237 00:19:01,260 --> 00:19:06,500 If you have a junior analyst who's never maybe seen this before, you're going to have some problems, right? 238 00:19:06,500 --> 00:19:08,520 Because they are so closely identified. 239 00:19:08,520 --> 00:19:09,800 I've been doing this for 20 years. 240 00:19:09,800 --> 00:19:13,220 I can look at an email and something just feels weird, right? 241 00:19:13,220 --> 00:19:23,480 When I realize I'm mentally running through these models and I'm literally looking through that and I'm finding the deepfake difference, which we didn't know we were doing deepfakes this week, but this is the original deepfake we all grew up with, right? 242 00:19:23,480 --> 00:19:24,920 You have to find the difference. 243 00:19:25,000 --> 00:19:27,440 And the difference sometimes can just be a little sliver. 244 00:19:27,820 --> 00:19:31,620 It's really hard for a junior analyst or a senior analyst to look at that and know. 245 00:19:32,080 --> 00:19:33,380 So we came up with an idea. 246 00:19:33,400 --> 00:19:40,260 Let's keep applying this research, and we're still in the middle of doing some of this, but we wanted to see if we could predict a model to predict APT emails. 247 00:19:40,580 --> 00:19:43,380 And I'm not going to go over the nation state or commodity or anything like this. 248 00:19:43,380 --> 00:19:52,180 The idea is just, can we predict things that look different than just like, you know, porn links coming in or church emails or whatever it is that has those links that all get through your spam filters? 249 00:19:52,780 --> 00:19:55,140 So here's the plan of action. 250 00:19:55,780 --> 00:19:58,320 We're going to go ahead and we're going to look at these emails. 251 00:19:58,320 --> 00:20:03,120 We're going to look at these headers because the SMTP headers are just a hell of a corpus of information, right? 252 00:20:03,120 --> 00:20:10,480 And what I did is I got a whole bunch of senior analysts, a little drunk and a whiteboard, and we just went through and said, what makes it, what gets your hinky filter going? 253 00:20:10,480 --> 00:20:13,700 What makes something kind of click for you about being weird in email? 254 00:20:13,860 --> 00:20:16,920 And that was my method of feature selection, right? 255 00:20:16,920 --> 00:20:26,900 So we went through and these are all the features that I've had some really senior badass analysts in the world look at and identify as things that they have normally seen APT emails use, have modified, look different. 256 00:20:27,020 --> 00:20:39,360 If you've ever seen some of these emails come in, you'll notice, for example, if someone sends it through a legitimate Outlook client on their desktop in a corporation, and it goes through a legitimate desktop in another corporation, you're going to see proof point headers from one org, 257 00:20:39,360 --> 00:20:45,640 if you're a certain age, Postini, you're going to see a code through Gmail, it's going to come back down, it's going to have all these awesome headers. 258 00:20:45,760 --> 00:20:53,380 But if they send it from a droplet in DigitalOcean from a Python script, it might have five different lines of headers and that's it. 259 00:20:53,460 --> 00:20:57,520 Because SMTP headers, that protocol is the sluttiest protocol that exists. 260 00:20:57,640 --> 00:21:02,140 You can just about say, hey, y'all, you want to email, chuck it on over, there it goes. 261 00:21:02,260 --> 00:21:07,920 So there's a lot of variations there, which is awesome for ML because now we can actually select features that are interesting. 262 00:21:08,480 --> 00:21:14,460 So then we went through and we started working on this, and here's some things that we identified from an Office 365 corpus. 263 00:21:14,460 --> 00:21:18,180 We weren't really happy with all the data we could get out of there, so we kept looking. 264 00:21:18,560 --> 00:21:22,880 Then we compared it to the real things that we wanted to focus on from Office 365. 265 00:21:22,920 --> 00:21:25,500 I'm going to throw this in just because I get angry at Office 365. 266 00:21:26,440 --> 00:21:28,660 And I had to go like this, right? 267 00:21:28,660 --> 00:21:31,120 Old man Kovar yells at Microsoft Cloud. 268 00:21:31,120 --> 00:21:35,760 The reason being, they get rid of all those headers if you're trying to bring it into your network. 269 00:21:35,760 --> 00:21:38,460 You have to do a lot of work to try to get that information. 270 00:21:38,640 --> 00:21:40,560 And for network defenders, I need that data. 271 00:21:40,940 --> 00:21:42,560 So we turned to something called Stoke. 272 00:21:42,560 --> 00:21:45,360 If you're not familiar with Stoke, we have a lot of presentations on this. 273 00:21:45,360 --> 00:21:46,960 It's a file analysis framework. 274 00:21:46,960 --> 00:21:53,640 One of the things it does really, really well is take data off the network and rip it out and turn it into a beautiful JSON blob. 275 00:21:54,120 --> 00:21:59,320 That JSON blob looks a little bit like this, because at the end of the day, email is just a key value, right? 276 00:21:59,340 --> 00:22:02,760 From value to value. 277 00:22:02,760 --> 00:22:03,500 That's all it is. 278 00:22:03,500 --> 00:22:04,960 So it's beautiful for JSON. 279 00:22:05,160 --> 00:22:07,020 And remember before, I have all those headers. 280 00:22:07,040 --> 00:22:09,360 Well, those just become values in an extensible format. 281 00:22:09,360 --> 00:22:10,700 So we keep going through this. 282 00:22:10,700 --> 00:22:22,580 And suddenly I found, when I looked at email from Stoke, the exact same data set, I had 131 different fields in that SMTP that I could actually do feature extraction on versus Office 365. 283 00:22:22,940 --> 00:22:24,660 So like we said, this is our work in progress. 284 00:22:24,660 --> 00:22:27,300 We're kind of literally walking you through as we're doing our research. 285 00:22:27,400 --> 00:22:29,180 So we decided to go with Stoke. 286 00:22:29,760 --> 00:22:35,540 The idea here, we're going to take good emails that we know are good, maybe from our personal accounts or things that we're actually sending. 287 00:22:35,860 --> 00:22:38,240 And then we want to find a corpus of APT BAT. 288 00:22:38,400 --> 00:22:40,100 There's various different ways to do that. 289 00:22:40,100 --> 00:22:44,720 One of which is that we're looking at going into VirusTotal and actually just looking for people who have identified it. 290 00:22:44,720 --> 00:22:48,380 We pulled something like 7,000 items out of there, looking for IOCs. 291 00:22:48,960 --> 00:22:52,500 Side note, please stop uploading your emails into VirusTotal. 292 00:22:53,200 --> 00:22:54,080 I'm not joking. 293 00:22:54,080 --> 00:22:56,520 People are doing this in an automated method, right? 294 00:22:56,520 --> 00:22:58,440 So stop doing that if you're in the audience and doing it. 295 00:22:58,440 --> 00:23:00,980 However, it's great for me because I get some real data. 296 00:23:00,980 --> 00:23:02,540 So, going on. 297 00:23:02,840 --> 00:23:05,200 Problems that we've experienced doing this. 298 00:23:06,460 --> 00:23:08,860 Am I just recreating a goddamn spam filter? 299 00:23:09,240 --> 00:23:10,280 Yes, I am. 300 00:23:10,280 --> 00:23:11,840 But it's my spam filter. 301 00:23:11,860 --> 00:23:15,560 And I get to tune it how I want to look for things that I care about for my org. 302 00:23:15,560 --> 00:23:17,240 And that's really important to me. 303 00:23:17,580 --> 00:23:19,860 Second, I speak English pretty poorly. 304 00:23:19,900 --> 00:23:25,280 So all the work I'm going to do is actually going to be inherently biased to American English for an American organization. 305 00:23:25,360 --> 00:23:26,980 But that goes back to this. 306 00:23:26,980 --> 00:23:30,340 It's my spam filter, and I'm tuning it for me, right? 307 00:23:30,380 --> 00:23:35,240 If you're a Spanish speaker, if you're Czech, if you're Polish, whatever it be, all these are going to apply as well. 308 00:23:35,240 --> 00:23:41,900 Most of the languages, the tool sets we use, NLTK, everything like that, Natural Language Toolkit, they have these different plugins. 309 00:23:42,620 --> 00:23:45,360 As we said, we need a labeled corpora of data. 310 00:23:45,360 --> 00:23:46,360 We've kind of come over that. 311 00:23:46,360 --> 00:23:48,520 We figured out a solution for that with some of the VirusTotal. 312 00:23:48,520 --> 00:23:55,300 However, for those of you who've done real research in this, I'm not really sure if my labeled corpus of data is going to be great. 313 00:23:55,300 --> 00:24:03,240 What I want is for someone to take the research that we're doing, who is at a giant organization who has a labeled corpora, and then try it out and see if it works, right? 314 00:24:04,240 --> 00:24:11,140 Second, in terms of at least for Office 365 stuff, I'm having a real problem keeping up on documentation. 315 00:24:11,140 --> 00:24:12,540 The same thing for Google Mail. 316 00:24:12,540 --> 00:24:17,620 When you start trying to put this in production to get these headers out of information, you're going to run into problems. 317 00:24:17,620 --> 00:24:25,600 I've already had my research break twice because of changes on API from both Google Cloud Mail and Office 365. 318 00:24:25,700 --> 00:24:27,360 So keep that in mind as you're going through. 319 00:24:27,360 --> 00:24:29,700 As we said, this is a little bit of a work in progress. 320 00:24:30,460 --> 00:24:38,640 The other part is, as Isaac Newton once said, cloud data at rest tends to stay at rest, and it can be very expensive to pull it out of the cloud, or it can be very difficult. 321 00:24:38,780 --> 00:24:46,900 Exciting things like if you're using Google Mail, there's a 24-hour delay to pull it out of the cloud, which is not exactly great for network defenders. 322 00:24:46,900 --> 00:24:48,860 It gives them 24 hours before you can find them. 323 00:24:49,880 --> 00:24:51,680 And we also have day jobs. 324 00:24:51,680 --> 00:24:55,380 This isn't our full-time day job, so we're a little bit behind on some of the research we want to get to. 325 00:24:55,600 --> 00:24:58,040 However, we have had some initial successes. 326 00:24:58,220 --> 00:25:00,620 I call this the Texas Ghanaian dataset. 327 00:25:01,940 --> 00:25:13,640 We set up a little, I don't want to say honey pots, but we put out some email addresses all over the place and started getting a whole bunch of spam in, and I started reading through it, and the two major things I saw were Texas churches, and they made significant spam, 328 00:25:13,640 --> 00:25:15,400 and then Ghanian hackers. 329 00:25:15,680 --> 00:25:16,960 I have no clue why. 330 00:25:16,960 --> 00:25:29,260 But we started to run some of our ideas around this for Ngrams and kind of break apart things in the emails, in the headers that might be of interest, and immediately we found things that were pretty interesting, like Receive, Liberty Capital, Ghana Holding, 331 00:25:29,260 --> 00:25:32,980 which I'm not really sure what that is, Talk, Contact, and Message. 332 00:25:32,980 --> 00:25:39,480 Because the key part of this, when you start doing NLTK, is every spear-phishing email has certain things that are identical. 333 00:25:39,820 --> 00:25:51,960 ASAP, as soon as possible, Click, Execute, Run, Download, Unzip, Zip, Password, Immediate, Invoice.pdf, Invoice.pdf, so many invoices and pdfs, right? 334 00:25:51,960 --> 00:25:55,980 So when you look at these, these should be statistically different than things you're sending over. 335 00:25:55,980 --> 00:26:02,460 You can start analyzing that grammar, you can look for forced verbs, you can look for weird conjugations, you can look for left-adjusted. 336 00:26:02,460 --> 00:26:11,120 Depending if you're over 35, you probably learned to do Dear Orion, Carriage Return, Tab, try doing that in a Python script for email, right? 337 00:26:11,120 --> 00:26:19,320 Those are various things that you can pick up on that I notice, as an analyst, that are almost impossible to do without having some sort of machine learning tool kit. 338 00:26:19,380 --> 00:26:29,800 So, in conclusion, on slide 76 of our 27 minutes so far talking, we are simple country data scientists. 339 00:26:29,920 --> 00:26:31,540 We are network defenders. 340 00:26:31,660 --> 00:26:33,380 We are not data scientists. 341 00:26:33,520 --> 00:26:35,820 None of us have a math degree, specifically. 342 00:26:35,980 --> 00:26:44,580 This is all something people in this room, if you're not a data scientist, if you're a network defender who wants to learn how to apply math, everything we've talked about today from Splunk, at least, is free. 343 00:26:44,660 --> 00:26:53,080 You can go ahead and download the Splunk for free, you can do the MLTK install app for free, you can put a giant dataset into Splunk and then start doing it for your own personal research. 344 00:26:53,320 --> 00:26:54,100 Everything's out there. 345 00:26:54,100 --> 00:27:10,440 I'm going to be talking about that later today here, taking our Capture the Flag datasets that we've open sourced that are 6 gigs and 20 gigs worth of network trap data, doing analysis against that, take the DARPA dataset that came out in 1999, the NFS dataset that came out in 2009, 346 00:27:10,440 --> 00:27:13,720 the MACCDC dataset that came out in 2012. 347 00:27:13,860 --> 00:27:20,340 There's a lot of datasets out there for you to start learning how to do this machine learning against data that should look very similar to yours. 348 00:27:20,760 --> 00:27:31,840 So, these are the things when people talk about, I want to do machine learning or I want to have AI in my network, what they really are talking about is they want to do statistics. 349 00:27:32,020 --> 00:27:33,080 Honest to God. 350 00:27:33,500 --> 00:27:35,540 They also don't know what their data is. 351 00:27:35,540 --> 00:27:38,880 So, that's why you're angry about IQR versus standard deviation, right? 352 00:27:38,880 --> 00:27:40,460 Very simple thing to learn. 353 00:27:41,920 --> 00:27:44,100 Multivariate predictions versus seasonality. 354 00:27:44,180 --> 00:27:55,440 I used to love this because for various reasons, I used to get to take a break every February when I worked for the Department of Defense because for some reason, something happens in the middle of February that I just didn't get spearfished. 355 00:27:56,020 --> 00:27:57,860 Look at that, right? 356 00:27:58,060 --> 00:28:00,100 Second, just apply a little bit of magic. 357 00:28:00,100 --> 00:28:01,460 That magic might be your machine learning. 358 00:28:01,460 --> 00:28:02,660 That might be something else. 359 00:28:02,660 --> 00:28:04,660 We haven't really figured it out, but it's all there. 360 00:28:05,880 --> 00:28:09,820 Takeaways, you can absolutely do this because these three Joes, we did it, right? 361 00:28:09,820 --> 00:28:15,780 So, if you have a network and you can put together tools and you can write Python at all, this is all achievable, right? 362 00:28:15,780 --> 00:28:16,920 Data is everywhere. 363 00:28:16,920 --> 00:28:17,760 It wants to be free. 364 00:28:17,760 --> 00:28:20,280 It wants you to run things against it and draw conclusions. 365 00:28:20,480 --> 00:28:21,700 Why not go for it? 366 00:28:21,700 --> 00:28:23,300 I'll do a call out for Splunk. 367 00:28:23,300 --> 00:28:24,860 I'll do a call out for every other vendor. 368 00:28:25,540 --> 00:28:33,040 You need to standardize shit and you need to make it available and possible for everyone to do this because that's the only way we're going to win these battles and actually help people do their networks, right? 369 00:28:33,040 --> 00:28:34,120 So, think about that. 370 00:28:34,120 --> 00:28:40,940 If you're in a vendor space, if you're going to affect change, go yell at your vendors, but we should be standardizing output of logs so that we can actually do better analysis. 371 00:28:41,060 --> 00:28:50,740 So, instead of having to spend all of our damn time doing processing and forming of data, actually draw conclusions and just come in as it should be so that we can run these analysis and actually defend our network. 372 00:28:50,860 --> 00:29:07,000 So, special thanks to a lot of different people who informed this talk, especially Ben Parsons, James Cole and James Elliott, a special group I love, IKBD, Rapid7, Census, if you're not familiar with Census, they have awesome data, um, John Landcow, Marcus LaFerrera and Lauren Deason at PunchCyber, 373 00:29:07,000 --> 00:29:10,320 Philip Drager and of course Splunk for letting us do fun stuff like this at home. 374 00:29:10,620 --> 00:29:11,780 I'm Ryan. 375 00:29:11,780 --> 00:29:12,700 I'm David. 376 00:29:12,700 --> 00:29:13,300 Dave. 377 00:29:13,300 --> 00:29:14,220 Thank you. 378 00:29:15,200 --> 00:29:17,360 81 slides, 44 minutes.