[00:00.000 --> 00:04.300] We're here to talk to you all today. All right, there we go. We're starting off right nice. Now, [00:04.300 --> 00:08.220] we're here to talk to you all about data science up here in the Splunk field and what we do. [00:08.400 --> 00:13.980] Now, before we go much further... oh, there we go. Electricity. Before we go much further, [00:13.980 --> 00:18.020] I have one thing to say. We're not going to talk about anything here that requires [00:18.020 --> 00:22.820] you to purchase anything, which is good. But if I did, don't buy anything on what we say, [00:22.820 --> 00:27.980] because we lie often. Mostly about the capabilities of our math abilities. So, [00:28.460 --> 00:33.100] my name is Ryan Kovar. I'm a principal Splunk security strategist. I've been around doing [00:33.100 --> 00:37.540] this for a while. And for those of you in the audience who are good at math, we have 30 minutes [00:37.540 --> 00:44.300] to go through 81 slides. So, do the math and I'm going to quickly move on. But not do well [00:44.300 --> 00:51.560] for choreography. Hey guys, I'm Dave Harreld, also a security strategist at Splunk and been around [00:51.560 --> 00:57.240] also quite a while. Do a lot with SANS. Ryan and I and a bunch of other people up here, [00:57.240 --> 01:01.080] David and a bunch of people in the audience, work on this thing called Splunk Boss of the [01:01.080 --> 01:07.900] Sock, which we would love for you to check out sometime. And my name is also David. I'm also a [01:07.900 --> 01:12.420] principal security strategist for Splunk. And I also do a lot of the same things these guys did. [01:12.420 --> 01:18.600] And I'm doing my best to not talk about MITRE today. So, that's my personal growth goal. [01:18.600 --> 01:21.960] However, I did have a talk at Blackout. So, feel free to go back. So, [01:21.960 --> 01:25.200] we do a lot of things. We've been doing this for a long time. There's a lot of people up here who [01:25.200 --> 01:29.200] have experience doing plumbing for networking. We've done some science and data and some [01:29.200 --> 01:33.460] research and development. We are certainly not experts in the field. And that's exactly what [01:33.460 --> 01:38.040] this talk is about. What we're going to go briefly over are the things that we've tried [01:38.040 --> 01:42.900] in the world of data science. What it means to be a citizen data scientist. The things we're [01:42.900 --> 01:46.340] actually trying to do. And then we're going to go into the works in progress for some of our [01:46.340 --> 01:53.940] ongoing research. All right. So, as Ryan just mentioned, this talk is all about [01:54.500 --> 02:00.180] applying machine learning from the perspective of security practitioners, not from the perspective [02:00.180 --> 02:05.580] of someone who's trained in data science. A lot of these things we did to teach ourselves how to do [02:05.580 --> 02:11.740] machine learning. And how to think like a data scientist. We consider ourselves citizen data [02:11.740 --> 02:17.340] scientists, which is a term from Gartner, which we kind of like. We're going to talk about this [02:18.180 --> 02:25.080] called the MLTK, which is a toolkit that you can run on top of Splunk. We generally use Splunk [02:25.080 --> 02:29.120] because we work there and they pay for our kids to go to college and things like that. But [02:29.120 --> 02:34.880] these topics are generally applicable across a wide variety of different tool sets. So, [02:34.880 --> 02:40.240] don't get hung up on Splunk. MLTK is an add-on that you can install on top of Splunk. It's a [02:40.560 --> 02:48.620] toolkit that allows you to apply all kinds of different algorithms. It is a thin wrapper over [02:48.620 --> 02:54.740] some Python machine learning libraries. Super useful. There's a little bit of stuff that you [02:54.740 --> 03:00.300] can do in the MLTK. I'm not going to go over it all. But you can do things like numeric predictions [03:00.300 --> 03:05.380] and categorization and forecasting and outlier detection and a whole bunch of other cool stuff [03:05.380 --> 03:12.860] using this toolkit. And with that, Mr. Verve is going to go over some things that we can do with [03:12.860 --> 03:18.620] that toolkit and with some of the other pieces of Splunk or any other analytic toolkit. [03:20.340 --> 03:26.500] So, yeah, let's talk about some actual detections. So, a part of our day-to-day life is going out [03:26.500 --> 03:30.880] and talking with customers who want to be deploying security machine learning. And [03:30.880 --> 03:34.740] security machine learning is one of my favorite subjects to walk into a customer to talk about [03:34.740 --> 03:38.700] because most of the time, they don't really know what they're actually looking for. And so, [03:38.700 --> 03:42.640] I can talk about the magic of bespoke machine learning and how we can deploy all this type of [03:42.640 --> 03:48.880] stuff. And a lot of the time, what they actually want is really simple statistics, which I'm sure [03:48.880 --> 03:54.140] should resonate with everybody because this is the life of data science. Most of the time, inside of [03:54.140 --> 03:57.860] the land of security, the things we see people getting the greatest amount of value from are [03:57.860 --> 04:01.820] rarity detections, looking for things that are uncommon or first-time seen, like being able to [04:01.820 --> 04:07.080] detect the first time somebody goes to a domain, first time somebody launches a particular process, [04:07.080 --> 04:11.240] first time a particular process launches with this particular file hash, things like that. [04:11.320 --> 04:16.380] Or time series spikes, being able to track something that happens more than it typically does. [04:16.620 --> 04:21.880] A lot of this can be done with simple things like standard deviation. And we really like to describe [04:21.880 --> 04:27.460] this concept to end consumers because in that idea of the citizen data scientist, it's not [04:27.460 --> 04:32.940] something that takes a PhD. We can have the conversation about different types of distributions [04:32.940 --> 04:39.540] and whether standard deviation is a fair thing. And Kovar loves to talk about IQR versus standard [04:39.540 --> 04:43.580] deviation. But at the end of the day, what we want to be able to do is give people a ton of different [04:43.580 --> 04:47.640] content that's very straightforward for them to deploy. And I'm sure you're all sitting here [04:47.640 --> 04:53.240] reading through each item in that slide deck. You have to look at all of them because functionally, [04:53.240 --> 04:57.020] when we look at these kind of simple categories, where we see people driving tremendous value [04:57.020 --> 05:03.780] with the ease of customization for it. So for example, take this detection here. This looks for [05:03.780 --> 05:11.160] new error codes being generated by users in AWS data. And the way that it's doing it is looking [05:11.160 --> 05:17.560] at a corpus of AWS data and it's saying give me the first time and the last time that this error [05:17.560 --> 05:22.720] occurred for this particular user. And we look for if the first time is in the last day or if [05:22.720 --> 05:26.260] you're running on an hourly basis in the last hour or if you want to get fancy, you can say [05:26.260 --> 05:30.280] since last time I ran it or things like that. But functionally, it's a pretty straightforward [05:30.280 --> 05:35.340] type of detection. And the great thing about it is if you want to spin this around in a different [05:35.340 --> 05:41.100] direction, all you have to do is change the data source and what fields you're looking at. So [05:41.100 --> 05:46.720] instead of looking at error codes generated by users, which is, you know, casually interesting. [05:46.720 --> 05:50.200] One of my favorite ones is looking at the first time a particular user generates a particular [05:50.200 --> 05:56.160] or hits a particular API. If I've never created an instance before, I should have a record of [05:56.260 --> 06:00.300] David all of a sudden created a bunch of instances. If I've never interacted with a [06:00.300 --> 06:03.360] particular region and all of a sudden I start spinning a bunch of instances in a particular [06:03.360 --> 06:09.700] region, that's also really useful information. So these are the things we talk about in a high [06:09.700 --> 06:15.400] level. But how do we actually go apply that? How does that really work in the real world? [06:15.400 --> 06:20.720] And you'll note, this is customized for Las Vegas. Polish here. So this is one of the things [06:20.720 --> 06:24.600] that we've actually seen customers deploy to a great extent. And my favorite example of all [06:24.600 --> 06:28.940] can talk at great length about it. But as we mentioned, 81 slides, 30 minutes, no time for [06:28.940 --> 06:34.220] great length. My favorite example is from JP Morgan Chase. They presented at our user conference in [06:34.220 --> 06:41.040] 2017. And I have happily stolen this slide from them. And they built a system for monitoring [06:42.440 --> 06:48.180] all types of their critical users. So whether it's an exec or a sysadmin or somebody who can [06:48.760 --> 06:53.820] send a lot of money someplace, they want to track extra detail or put extra attention [06:53.820 --> 06:58.060] on those types of users. And so what they have done is deployed a bunch of different [06:58.060 --> 07:02.480] first-time scene detections. So we've got first time that an email comes in from an address. First [07:02.480 --> 07:07.260] time a particular domain sends an email. First time they get an attachment type. They get a PDF [07:07.260 --> 07:12.720] for the first time or a CR file or whatever. First time a service gets installed. First time the [07:12.720 --> 07:16.440] registry gets modified, et cetera, et cetera, et cetera. And again, this is in the Splunk [07:16.440 --> 07:20.900] nomenclature, we use SPL for our search language. It's the same search language that gets applied [07:20.900 --> 07:24.780] for each one of these and you just change the fields and change the data source. The same thing [07:24.780 --> 07:28.960] applies for all other types of data analytics platforms as well. And what they do is they [07:28.960 --> 07:34.560] then aggregate all of these risky events or new events and then look for activities that are [07:34.560 --> 07:38.200] occurring across multiple different, in this case, phases of the kill chain. Because they [07:38.200 --> 07:43.920] presented this in 2017 before MITRE. I broke my rule. I wasn't going to say MITRE. Before MITRE [07:43.920 --> 07:48.700] became the buzzword du jour. But this functional idea of saying if we see a user has a new sending [07:48.700 --> 07:54.200] address and a new process created and a new connection and new attempted access, like, that's [07:54.320 --> 07:59.880] a lot of suspicious things that we can now say this should be analyzed immediately. And it's [07:59.880 --> 08:05.840] really useful. But of course, we're presenting at AI Village, so we like machine learning, too. [08:05.880 --> 08:08.180] And everything we're going to talk about for the rest of this presentation is actual machine [08:08.180 --> 08:12.640] learning. My favorite, because it was my first, machine learning detection, which I worked with [08:12.640 --> 08:17.340] our data scientists at Splunk to build out, was this great, it's a buzzword bingo of descriptions [08:17.340 --> 08:22.440] that uses standard deviation and IQR so it can make Kovar happy. It uses K-means clustering, [08:22.440 --> 08:29.660] it uses PCA, lots of different fun things in here to be able to look at anomalies in Salesforce data, [08:29.660 --> 08:33.640] which in this case was me, because I pulled, like, 38 million results out of our Salesforce data, [08:33.640 --> 08:38.120] looking at, like, opportunities and things like that, because I didn't know how to use Tableau. [08:38.120 --> 08:41.640] But it was great. It was a good use case, and we're actually able to find bad things of users [08:41.640 --> 08:47.160] who are acting anomalously in a multivariate way in Salesforce data. I felt particularly [08:47.160 --> 08:52.980] great about it, because I had 110 million audit events from 90,000 different users. I found, [08:52.980 --> 08:58.860] kind of, scoped my IQR down to 291 outliers, and 291 outliers over the course of 90 days is [08:58.860 --> 09:03.200] three outliers a day. That is a decent number. That is something I can actually give to a SOC [09:03.200 --> 09:07.780] analyst. It's not going to overwhelm them with noise. I felt great. I felt super happy. And then [09:07.780 --> 09:11.780] I actually looked at what I'd be sending to a SOC analyst, and it's a bunch of z-scores of how many [09:11.780 --> 09:16.780] standard deviations somebody was away from their particular average on that particular day. And no [09:16.780 --> 09:22.060] SOC analyst will use this. They will see it, and they'll say, that's fun, and throw it aside and [09:22.060 --> 09:27.020] go deal with a vulnerability scan or something else that is also terrible to deal with, but less [09:27.020 --> 09:32.420] complicated. So we said, okay, wait, why don't we make something a little bit simpler? And when [09:32.420 --> 09:38.680] we're looking at simplicity, my favorite of these is kernel density. Not just because this meme [09:38.680 --> 09:44.580] makes me extraordinarily happy. Kernel density, for those who don't know, is a lot of machine [09:44.580 --> 09:49.200] learning that allows us to detect randomness. And frankly, I don't care about the details of [09:49.200 --> 09:53.920] the machine learning, because I'm the citizen data scientist. I'm not the actual data scientist. [09:54.200 --> 10:01.700] What I really care about is the ability to put a single piece of SPL up on the screen that works [10:01.700 --> 10:07.980] and allows me to build a baseline, and then add one more command to invoke Splunk's machine [10:07.980 --> 10:13.460] learning toolkit to be able to look at anomalies in the amount of data being sent out inside of [10:13.460 --> 10:18.980] our own firewall logs. And to test this out, to validate that this actually worked, [10:18.980 --> 10:25.040] this was back in the day before GDPR hit and we actually had access to some internal data, [10:25.040 --> 10:30.100] I tracked users who were exfiltrating data from or sending out data from Splunk's own environment [10:30.100 --> 10:35.900] and found one user who uploaded 130 gigs of data to Dropbox on a Friday afternoon, [10:35.900 --> 10:42.620] blowing out all of the per hour baselines established. It's totally legit. You can ask [10:42.620 --> 10:47.960] anybody, Dropbox is for sure a customer that we use, or a product that we use. Definitely not [10:47.960 --> 10:52.100] something that is not a Splunk product, so you don't have to be any concerned at all about that, [10:52.100 --> 10:57.840] it's fine. But this is a great result. It's clearly valuable, it's clearly understandable [10:57.840 --> 11:04.580] for an analyst, and literally it's adding one extra line of SPL into a query that I already used. [11:04.780 --> 11:09.580] So this is kind of the power of being able to expose these types of capabilities to the citizen [11:09.580 --> 11:15.900] data scientist to make it very easy to do. But of course, in our team, we also like to do research. [11:16.220 --> 11:28.430] So let's talk about the research. All right. So this is a short overview of a talk that we [11:28.430 --> 11:33.290] did a couple years ago, Ryan and I did at the Threat Intelligence Summit, I guess a year and [11:33.350 --> 11:38.370] a half ago. And so you might want to check out that talk if you're interested in what we're about [11:38.370 --> 11:44.150] to kind of give just a little bit of a taste of here. First thing, kind of the inspiration for [11:44.150 --> 11:50.590] this, there's a gentleman Mark Parsons, if you don't follow him, he's an amazing researcher, [11:50.590 --> 11:56.270] Threat Intelligence Analyst, works at Microsoft. And he had been doing a lot of work on analyzing [11:56.270 --> 12:02.890] SSL certificates and using them sort of as a new way to track adversaries and to track behaviors, [12:02.890 --> 12:08.190] especially considering that most of the traffic that we see today now on our networks, when we [12:08.190 --> 12:13.310] look at wire data is encrypted. And so that takes away a lot of visibility. But one thing that's [12:13.310 --> 12:18.390] left are the SSL certificates themselves. He's done an awesome amount of work on this topic and [12:18.390 --> 12:25.990] kind of inspired us to do some similar things in our tool set. So obviously, everybody knows, [12:25.990 --> 12:31.100] I think, what an SSL certificate is, but it's basically an artifact that allows you to [12:32.480 --> 12:40.620] assign a crypto key to some information in the subject of the certificate. [12:40.840 --> 12:46.300] And it's super important, obviously, for SSL. And we have visibility to it when we look at [12:46.300 --> 12:53.540] network data. We thought it'd be interesting to teach ourselves a little bit about machine [12:53.540 --> 12:59.060] learning and maybe do something that's useful with this huge data set. And so we asked a very [12:59.060 --> 13:04.840] simple research question, which is, can we build a model that would predict inclusion on an SSL [13:04.840 --> 13:13.860] blacklist? And so we have an SSL blacklist that comes from abuse.ch. And we have a huge corpus of [13:13.860 --> 13:20.080] SSL certificates that come from the Rapid7 project Sonar. You should check out both of those projects, [13:20.080 --> 13:25.140] especially the Sonar project is extremely interesting if you're looking for a big data set. [13:25.740 --> 13:31.960] And so we took that and we said, hey, we essentially have some labeled data in that we have [13:31.960 --> 13:37.020] data that's either on this list or not, and we have a huge corpus. And so we thought this [13:37.020 --> 13:43.620] would be an interesting first foray into supervised machine learning. [13:45.080 --> 13:51.680] Started off down the trail of feature selection. And in Splunk, at least, it's nice because you [13:51.680 --> 13:59.260] can look at data like on the left, which is gives you sort of a view that's easily consumed by [13:59.260 --> 14:05.920] humans. And on the right, something that tabular view that we can feed into our machine learning [14:05.920 --> 14:12.160] model and use for as features. And we just did some simple, very simple things. We started off [14:12.160 --> 14:17.980] simple, right? Number of certificate extensions, number of issuer elements, number of subject [14:17.980 --> 14:24.000] elements, et cetera. You can read those off. A very simple list of quantitative features that we [14:24.000 --> 14:29.900] began to use. And we really didn't modify this too much, honestly. We got actually a lot of mileage [14:29.900 --> 14:35.700] out of this, which I was surprised by. Put that into... and we used our machine learning [14:35.700 --> 14:40.780] toolkit. We did some PCA, which I don't have a slide up here for, but principal component analysis [14:40.780 --> 14:46.900] to kind of figure out which of those features actually had an impact on the data. And then we [14:46.900 --> 14:52.720] fed that into a whole bunch of different machine learning algorithms. And honestly, [14:52.720 --> 14:58.080] I'm a citizen data scientist, so I don't know the ins and outs of every single one of these. [14:58.080 --> 15:03.880] But I can tell how they look, how they perform, right? Against one another. So I can say [15:04.820 --> 15:11.640] obviously this support vector machine showed up as high accuracy rate with a low false positive [15:11.640 --> 15:19.980] rate, which was super cool. We built this model. It didn't take too long. It took a long time to [15:19.980 --> 15:24.680] load all that certificate data that I mentioned earlier. It didn't take too long to build the [15:24.680 --> 15:32.760] model. Applied it. This is the things that you can do very simply with SPL. There's SPL shown [15:32.760 --> 15:38.860] there. It doesn't look too simple, maybe, but if you read through it, it's actually not too [15:38.860 --> 15:45.540] complicated. It's quite repetitive. There's not too much there as far as complexity. And the cool [15:45.540 --> 15:51.500] thing was we found tons and tons of these certificates, right? Which we predicted that [15:51.500 --> 15:57.040] would be on the blacklist and that actually were. And this was very useful, right? [15:58.420 --> 16:04.180] It was useful because it could add context to something, right? Remember that we had that 4% [16:04.180 --> 16:09.160] false positive rate, which if you're running this across the corpus of millions and millions [16:09.160 --> 16:14.200] of millions of certificates, that's not that useful, right? Because 4% of a giant number is [16:14.200 --> 16:21.040] still a giant number. However, it's super useful for adding context. And so, in our day jobs, what [16:21.040 --> 16:25.940] we're trying to do is help customers see an alert and understand if that alert is something that [16:25.940 --> 16:31.060] they can ignore or if it's something that they need to investigate more. And in order to do that, [16:31.060 --> 16:37.580] you do a lot of enrichment. This is a great way to enrich data. So, you can say, oh, I see this [16:37.580 --> 16:42.820] alert. It has certain characteristics. I'm trying to determine, you know, is this important to me [16:42.820 --> 16:48.740] or not? And also, I can say, well, you know what? That certificate is not on a blacklist because it [16:48.740 --> 16:55.180] would have triggered probably a filter that, you know, some sort of a match if it were. But we can [16:55.180 --> 16:59.400] also say, you know what? That shares a lot of characteristics with other certificates that are [16:59.400 --> 17:03.880] on that blacklist. And that might give us a little bit of extra context to be able to be a little [17:03.880 --> 17:19.860] quicker in how we triage that event. That was... yeah, that's right. So, that was an extremely fast [17:19.860 --> 17:24.760] overview of that. Again, if you want to see a lot more detail about that process, definitely check [17:24.760 --> 17:29.260] out the talk that we referenced earlier. And we have a link to here. And I'm going to let Ryan [17:29.260 --> 17:36.560] talk a little bit now about... So, the whole goal of this, right? Everything we're doing is to reduce [17:36.560 --> 17:40.600] your data set. Because I don't know the hell that Dave was just talking about for five minutes for [17:40.600 --> 17:45.020] PCA. I can't do any of that. But I can read a computer screen and look through it. And what [17:45.020 --> 17:50.580] we're trying to do is really find the bears in your network, right? Because when you start off [17:50.580 --> 17:53.960] with tens of millions of events, but you can find the things that sort of match, that's where you [17:53.960 --> 17:58.160] start getting the real return on investment for machine learning across a real data set. [17:58.160 --> 18:02.460] So, what we learned was, it sure as hell doesn't solve cyber, but it can really help you add [18:02.460 --> 18:06.180] context and actually bubble up the things that matter in your alerts or whatever else you're [18:06.180 --> 18:10.560] looking for. So, we have this going on. We tried it. We had a lot of good success. Because remember, [18:10.560 --> 18:14.800] the whole goal of this exercise for Dave and I was just to learn, could we actually do [18:15.700 --> 18:19.840] data science? Could we actually take machine learning? I am literally someone who failed math [18:19.840 --> 18:24.100] in first grade. So, for me, this was a real challenge. And I found it was actually doable. [18:24.100 --> 18:27.820] And we had results at work compared to the bullshit marketing stuff that we've all seen, [18:27.820 --> 18:33.400] so this was pretty exciting. So, we said, all right, next ML challenge, where's Glass Joe? [18:34.120 --> 18:37.920] So, we said, cool, let's go back in history a little bit. We have a little bit of a theme here [18:37.920 --> 18:44.960] with bears. Mr. Podesta once received an email. It looked just like this. And then there's another [18:44.960 --> 18:48.920] email that looks just like this. Now, there's a big difference between these two emails, [18:49.480 --> 18:53.340] one of which has a bitly link to get his Gmail account changed, and the other goes to Google [18:53.340 --> 18:58.480] mail. There's virtually no other difference in the legitimacy of this email other than you have [18:58.580 --> 19:03.620] a bitly link and you have a Gmail link. If you have a junior analyst who's never maybe seen this [19:03.620 --> 19:08.520] before, you're going to have some problems, right? Because they are so closely identified. [19:08.520 --> 19:13.220] I've been doing this for 20 years. I can look at an email and something just feels weird, right? [19:13.220 --> 19:16.920] When I realize I'm mentally running through these models and I'm literally looking through that and [19:16.920 --> 19:20.500] I'm finding the deepfake difference, which we didn't know we were doing deepfakes this week, [19:20.500 --> 19:24.920] but this is the original deepfake we all grew up with, right? You have to find the difference. [19:25.000 --> 19:29.000] And the difference sometimes can just be a little sliver. It's really hard for a junior [19:29.000 --> 19:33.900] analyst or a senior analyst to look at that and know. So we came up with an idea. Let's keep [19:33.900 --> 19:37.320] applying this research, and we're still in the middle of doing some of this, but we wanted to [19:37.320 --> 19:41.780] see if we could predict a model to predict APT emails. And I'm not going to go over the nation [19:41.780 --> 19:45.480] state or commodity or anything like this. The idea is just, can we predict things that look different [19:45.480 --> 19:50.360] than just like, you know, porn links coming in or church emails or whatever it is that has those [19:50.360 --> 19:56.600] links that all get through your spam filters? So here's the plan of action. We're going to go ahead [19:56.600 --> 20:00.380] and we're going to look at these emails. We're going to look at these headers because the SMTP [20:00.380 --> 20:04.780] headers are just a hell of a corpus of information, right? And what I did is I got a whole bunch of [20:04.780 --> 20:08.740] senior analysts, a little drunk and a whiteboard, and we just went through and said, what makes it, [20:08.740 --> 20:12.920] what gets your hinky filter going? What makes something kind of click for you about being weird [20:12.920 --> 20:17.660] in email? And that was my method of feature selection, right? So we went through and these [20:17.660 --> 20:21.200] are all the features that I've had some really senior badass analysts in the world look at [20:21.200 --> 20:26.900] and identify as things that they have normally seen APT emails use, have modified, look different. [20:27.020 --> 20:30.880] If you've ever seen some of these emails come in, you'll notice, for example, if someone sends it [20:30.880 --> 20:34.940] through a legitimate Outlook client on their desktop in a corporation, and it goes through [20:35.080 --> 20:39.360] a legitimate desktop in another corporation, you're going to see proof point headers from one org, [20:39.360 --> 20:43.320] if you're a certain age, Postini, you're going to see a code through Gmail, it's going to come [20:43.320 --> 20:47.840] back down, it's going to have all these awesome headers. But if they send it from a droplet in [20:47.840 --> 20:53.380] DigitalOcean from a Python script, it might have five different lines of headers and that's it. [20:53.460 --> 20:58.220] Because SMTP headers, that protocol is the sluttiest protocol that exists. You can just [20:58.220 --> 21:03.300] about say, hey, y'all, you want to email, chuck it on over, there it goes. So there's a lot of [21:03.300 --> 21:07.280] variations there, which is awesome for ML because now we can actually select features that are [21:07.280 --> 21:11.440] interesting. So then we went through and we started working on this, and here's some things [21:11.440 --> 21:16.160] that we identified from an Office 365 corpus. We weren't really happy with all the data we could [21:16.160 --> 21:20.500] get out of there, so we kept looking. Then we compared it to the real things that we wanted [21:20.500 --> 21:25.500] to focus on from Office 365. I'm going to throw this in just because I get angry at Office 365. [21:26.440 --> 21:32.460] And I had to go like this, right? Old man Kovar yells at Microsoft Cloud. The reason being, [21:32.460 --> 21:36.360] they get rid of all those headers if you're trying to bring it into your network. You have to do a [21:36.360 --> 21:40.560] lot of work to try to get that information. And for network defenders, I need that data. [21:40.940 --> 21:44.240] So we turned to something called Stoke. If you're not familiar with Stoke, we have a lot of [21:44.240 --> 21:48.180] presentations on this. It's a file analysis framework. One of the things it does really, [21:48.180 --> 21:53.640] really well is take data off the network and rip it out and turn it into a beautiful JSON blob. [21:54.120 --> 21:57.960] That JSON blob looks a little bit like this, because at the end of the day, email is just a [21:57.960 --> 22:05.380] key value, right? From value to value. That's all it is. So it's beautiful for JSON. And remember [22:05.380 --> 22:09.360] before, I have all those headers. Well, those just become values in an extensible format. [22:09.360 --> 22:13.340] So we keep going through this. And suddenly I found, when I looked at email from Stoke, [22:13.340 --> 22:19.820] the exact same data set, I had 131 different fields in that SMTP that I could actually do [22:19.820 --> 22:24.860] feature extraction on versus Office 365. So like we said, this is our work in progress. We're kind [22:24.860 --> 22:29.180] of literally walking you through as we're doing our research. So we decided to go with Stoke. [22:29.760 --> 22:33.720] The idea here, we're going to take good emails that we know are good, maybe from our personal [22:33.720 --> 22:38.240] accounts or things that we're actually sending. And then we want to find a corpus of APT BAT. [22:38.400 --> 22:41.360] There's various different ways to do that. One of which is that we're looking at going [22:41.360 --> 22:45.400] into VirusTotal and actually just looking for people who have identified it. We pulled something [22:45.400 --> 22:51.540] like 7,000 items out of there, looking for IOCs. Side note, please stop uploading your emails into [22:51.540 --> 22:57.320] VirusTotal. I'm not joking. People are doing this in an automated method, right? So stop doing that [22:57.320 --> 23:00.980] if you're in the audience and doing it. However, it's great for me because I get some real data. [23:00.980 --> 23:05.200] So, going on. Problems that we've experienced doing this. [23:06.460 --> 23:12.660] Am I just recreating a goddamn spam filter? Yes, I am. But it's my spam filter. And I get to tune [23:12.660 --> 23:17.240] it how I want to look for things that I care about for my org. And that's really important to me. [23:17.580 --> 23:21.940] Second, I speak English pretty poorly. So all the work I'm going to do is actually going to [23:21.940 --> 23:26.980] be inherently biased to American English for an American organization. But that goes back to this. [23:26.980 --> 23:31.920] It's my spam filter, and I'm tuning it for me, right? If you're a Spanish speaker, if you're [23:31.920 --> 23:36.160] Czech, if you're Polish, whatever it be, all these are going to apply as well. Most of the languages, [23:36.160 --> 23:40.980] the tool sets we use, NLTK, everything like that, Natural Language Toolkit, they have these [23:40.980 --> 23:46.360] different plugins. As we said, we need a labeled corpora of data. We've kind of come over that. [23:46.360 --> 23:49.640] We figured out a solution for that with some of the VirusTotal. However, for those of you who've [23:49.640 --> 23:55.300] done real research in this, I'm not really sure if my labeled corpus of data is going to be great. [23:55.300 --> 23:59.120] What I want is for someone to take the research that we're doing, who is at a giant organization [23:59.120 --> 24:04.720] who has a labeled corpora, and then try it out and see if it works, right? Second, [24:06.200 --> 24:11.140] in terms of at least for Office 365 stuff, I'm having a real problem keeping up on documentation. [24:11.140 --> 24:14.660] The same thing for Google Mail. When you start trying to put this in production to get these [24:14.660 --> 24:18.980] headers out of information, you're going to run into problems. I've already had my research break [24:18.980 --> 24:26.480] twice because of changes on API from both Google Cloud Mail and Office 365. So keep that in mind [24:26.480 --> 24:31.120] as you're going through. As we said, this is a little bit of a work in progress. The other part [24:31.120 --> 24:36.080] is, as Isaac Newton once said, cloud data at rest tends to stay at rest, and it can be very expensive [24:36.080 --> 24:40.160] to pull it out of the cloud, or it can be very difficult. Exciting things like if you're using [24:40.160 --> 24:45.900] Google Mail, there's a 24-hour delay to pull it out of the cloud, which is not exactly great for [24:45.900 --> 24:51.840] network defenders. It gives them 24 hours before you can find them. And we also have day jobs. This [24:51.840 --> 24:55.380] isn't our full-time day job, so we're a little bit behind on some of the research we want to get to. [24:55.600 --> 25:00.620] However, we have had some initial successes. I call this the Texas Ghanaian dataset. [25:01.940 --> 25:05.500] We set up a little, I don't want to say honey pots, but we put out some email addresses all [25:05.500 --> 25:09.180] over the place and started getting a whole bunch of spam in, and I started reading through it, [25:09.180 --> 25:13.640] and the two major things I saw were Texas churches, and they made significant spam, [25:13.640 --> 25:18.940] and then Ghanian hackers. I have no clue why. But we started to run some of our ideas around this [25:18.940 --> 25:23.640] for Ngrams and kind of break apart things in the emails, in the headers that might be of interest, [25:23.640 --> 25:28.520] and immediately we found things that were pretty interesting, like Receive, Liberty Capital, [25:28.520 --> 25:33.600] Ghana Holding, which I'm not really sure what that is, Talk, Contact, and Message. Because the key [25:33.600 --> 25:38.540] part of this, when you start doing NLTK, is every spear-phishing email has certain things that are [25:38.540 --> 25:46.680] identical. ASAP, as soon as possible, Click, Execute, Run, Download, Unzip, Zip, Password, [25:46.680 --> 25:52.940] Immediate, Invoice.pdf, Invoice.pdf, so many invoices and pdfs, right? So when you look at [25:52.940 --> 25:56.340] these, these should be statistically different than things you're sending over. You can start [25:56.340 --> 26:00.540] analyzing that grammar, you can look for forced verbs, you can look for weird conjugations, you [26:00.540 --> 26:06.280] can look for left-adjusted. Depending if you're over 35, you probably learned to do Dear Orion, [26:06.280 --> 26:12.080] Carriage Return, Tab, try doing that in a Python script for email, right? Those are various things [26:12.080 --> 26:16.740] that you can pick up on that I notice, as an analyst, that are almost impossible to do without [26:16.740 --> 26:23.800] having some sort of machine learning tool kit. So, in conclusion, on slide 76 of our 27 minutes [26:23.800 --> 26:32.120] so far talking, we are simple country data scientists. We are network defenders. We are [26:32.120 --> 26:36.920] not data scientists. None of us have a math degree, specifically. This is all something people [26:36.920 --> 26:40.360] in this room, if you're not a data scientist, if you're a network defender who wants to learn how [26:40.360 --> 26:45.340] to apply math, everything we've talked about today from Splunk, at least, is free. You can go ahead [26:45.340 --> 26:49.760] and download the Splunk for free, you can do the MLTK install app for free, you can put a giant [26:49.760 --> 26:54.100] dataset into Splunk and then start doing it for your own personal research. Everything's out there. [26:54.100 --> 26:57.940] I'm going to be talking about that later today here, taking our Capture the Flag datasets that [26:57.940 --> 27:03.680] we've open sourced that are 6 gigs and 20 gigs worth of network trap data, doing analysis against [27:03.680 --> 27:10.440] that, take the DARPA dataset that came out in 1999, the NFS dataset that came out in 2009, [27:10.440 --> 27:15.860] the MACCDC dataset that came out in 2012. There's a lot of datasets out there for you to start [27:15.860 --> 27:20.340] learning how to do this machine learning against data that should look very similar to yours. [27:20.760 --> 27:27.220] So, these are the things when people talk about, I want to do machine learning or I want to have [27:27.220 --> 27:32.480] AI in my network, what they really are talking about is they want to do statistics. Honest to [27:32.480 --> 27:37.560] God. They also don't know what their data is. So, that's why you're angry about IQR versus standard [27:37.560 --> 27:44.100] deviation, right? Very simple thing to learn. Multivariate predictions versus seasonality. [27:44.180 --> 27:49.100] I used to love this because for various reasons, I used to get to take a break every February when [27:49.100 --> 27:52.800] I worked for the Department of Defense because for some reason, something happens in the middle [27:52.800 --> 27:59.440] of February that I just didn't get spearfished. Look at that, right? Second, just apply a little [27:59.440 --> 28:02.980] bit of magic. That magic might be your machine learning. That might be something else. We haven't [28:02.980 --> 28:07.920] really figured it out, but it's all there. Takeaways, you can absolutely do this because [28:07.920 --> 28:12.520] these three Joes, we did it, right? So, if you have a network and you can put together tools [28:12.520 --> 28:17.220] and you can write Python at all, this is all achievable, right? Data is everywhere. It wants [28:17.220 --> 28:21.700] to be free. It wants you to run things against it and draw conclusions. Why not go for it? [28:21.700 --> 28:24.860] I'll do a call out for Splunk. I'll do a call out for every other vendor. [28:25.540 --> 28:29.480] You need to standardize shit and you need to make it available and possible for everyone to do this [28:29.480 --> 28:32.180] because that's the only way we're going to win these battles and actually help people do their [28:32.180 --> 28:36.060] networks, right? So, think about that. If you're in a vendor space, if you're going to affect change, [28:36.060 --> 28:39.460] go yell at your vendors, but we should be standardizing output of logs so that we can [28:39.460 --> 28:44.140] actually do better analysis. So, instead of having to spend all of our damn time doing processing and [28:44.140 --> 28:48.640] forming of data, actually draw conclusions and just come in as it should be so that we can run [28:48.640 --> 28:53.280] these analysis and actually defend our network. So, special thanks to a lot of different people [28:53.280 --> 28:58.000] who informed this talk, especially Ben Parsons, James Cole and James Elliott, a special group I [28:58.000 --> 29:04.020] love, IKBD, Rapid7, Census, if you're not familiar with Census, they have awesome data, um, John [29:04.020 --> 29:08.220] Landcow, Marcus LaFerrera and Lauren Deason at PunchCyber, Philip Drager and of course Splunk [29:08.220 --> 29:16.280] for letting us do fun stuff like this at home. I'm Ryan. I'm David. Dave. Thank you. 81 slides, [29:16.280 --> 29:17.360] 44 minutes.