WEBVTT

00:00.000 --> 00:01.440
We're here to talk to you all today.

00:01.440 --> 00:02.080
All right, there we go.

00:02.080 --> 00:03.940
We're starting off right nice.

00:04.180 --> 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.

00:08.400 --> 00:11.720
Now, before we go much further... oh, there we go.

00:12.000 --> 00:12.720
Electricity.

00:12.840 --> 00:15.340
Before we go much further, I have one thing to say.

00:15.580 --> 00:20.220
We're not going to talk about anything here that requires you to purchase anything, which is good.

00:20.220 --> 00:23.940
But if I did, don't buy anything on what we say, because we lie often.

00:24.180 --> 00:26.940
Mostly about the capabilities of our math abilities.

00:26.940 --> 00:29.700
So, my name is Ryan Kovar.

00:29.700 --> 00:32.100
I'm a principal Splunk security strategist.

00:32.220 --> 00:34.140
I've been around doing this for a while.

00:34.140 --> 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.

00:39.560 --> 00:42.200
So, do the math and I'm going to quickly move on.

00:43.360 --> 00:45.300
But not do well for choreography.

00:45.320 --> 00:53.000
Hey guys, I'm Dave Harreld, also a security strategist at Splunk and been around also quite a while.

00:53.000 --> 00:54.280
Do a lot with SANS.

00:54.820 --> 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.

01:05.220 --> 01:07.020
And my name is also David.

01:07.020 --> 01:09.440
I'm also a principal security strategist for Splunk.

01:09.500 --> 01:12.140
And I also do a lot of the same things these guys did.

01:12.180 --> 01:14.360
And I'm doing my best to not talk about MITRE today.

01:14.360 --> 01:15.940
So, that's my personal growth goal.

01:18.280 --> 01:19.840
However , I did have a talk at Blackout.

01:19.840 --> 01:20.860
So, feel free to go back.

01:20.860 --> 01:22.760
So, we do a lot of things.

01:22.760 --> 01:24.020
We've been doing this for a long time.

01:24.020 --> 01:27.440
There's a lot of people up here who have experience doing plumbing for networking.

01:27.440 --> 01:30.780
We've done some science and data and some research and development.

01:30.820 --> 01:32.400
We are certainly not experts in the field.

01:32.400 --> 01:34.960
And that's exactly what this talk is about.

01:35.460 --> 01:39.720
What we're going to go briefly over are the things that we've tried in the world of data science.

01:39.720 --> 01:42.460
What it means to be a citizen data scientist.

01:42.460 --> 01:43.920
The things we're actually trying to do.

01:43.920 --> 01:47.560
And then we're going to go into the works in progress for some of our ongoing research.

01:49.260 --> 01:49.940
All right.

01:49.940 --> 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.

02:02.620 --> 02:06.720
A lot of these things we did to teach ourselves how to do machine learning.

02:07.240 --> 02:10.120
And how to think like a data scientist.

02:10.120 --> 02:16.100
We consider ourselves citizen data scientists, which is a term from Gartner, which we kind of like.

02:16.180 --> 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.

02:23.560 --> 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.

02:28.900 --> 02:34.660
But these topics are generally applicable across a wide variety of different tool sets.

02:34.660 --> 02:36.920
So, don't get hung up on Splunk.

02:37.080 --> 02:40.080
MLTK is an add-on that you can install on top of Splunk.

02:40.080 --> 02:46.000
It's a toolkit that allows you to apply all kinds of different algorithms.

02:46.660 --> 02:51.000
It is a thin wrapper over some Python machine learning libraries.

02:51.000 --> 02:52.340
Super useful.

02:53.500 --> 02:56.700
There's a little bit of stuff that you can do in the MLTK.

02:56.700 --> 02:58.280
I'm not going to go over it all.

02:58.280 --> 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.

03:07.600 --> 03:09.880
And with that, Mr.

03:09.880 --> 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.

03:20.340 --> 03:23.880
So, yeah, let's talk about some actual detections.

03:23.880 --> 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.

03:30.780 --> 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.

03:38.380 --> 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.

03:43.780 --> 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.

03:52.820 --> 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,

04:04.020 --> 04:11.240
first time somebody launches a particular process, 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:20.240
A lot of this can be done with simple things like standard deviation.

04:20.260 --> 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.

04:29.060 --> 04:35.300
We can have the conversation about different types of distributions and whether standard deviation is a fair thing.

04:35.340 --> 04:40.260
And Kovar loves to talk about IQR versus standard deviation.

04:40.260 --> 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.

04:46.700 --> 04:49.640
And I'm sure you're all sitting here reading through each item in that slide deck.

04:50.140 --> 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.

05:00.480 --> 05:02.760
So for example, take this detection here.

05:02.780 --> 05:08.980
This looks for new error codes being generated by users in AWS data.

05:09.640 --> 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.

05:19.420 --> 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.

05:28.820 --> 05:31.440
But functionally, it's a pretty straightforward type of detection.

05:31.920 --> 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.

05:40.960 --> 05:46.720
So instead of looking at error codes generated by users, which is, you know, casually interesting.

05:46.720 --> 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.

05:52.100 --> 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.

05:58.600 --> 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.

06:07.120 --> 06:10.100
So these are the things we talk about in a high level .

06:10.180 --> 06:11.600
But how do we actually go apply that?

06:11.600 --> 06:14.660
How does that really work in the real world?

06:15.160 --> 06:17.640
And you'll note, this is customized for Las Vegas.

06:18.100 --> 06:19.160
Polish here.

06:19.360 --> 06:23.420
So this is one of the things that we've actually seen customers deploy to a great extent.

06:23.420 --> 06:26.800
And my favorite example of all can talk at great length about it.

06:26.840 --> 06:29.780
But as we mentioned, 81 slides, 30 minutes, no time for great length.

06:29.780 --> 06:32.500
My favorite example is from JP Morgan Chase.

06:32.500 --> 06:34.700
They presented at our user conference in 2017.

06:34.700 --> 06:38.780
And I have happily stolen this slide from them.

06:38.780 --> 06:44.860
And they built a system for monitoring all types of their critical users.

06:44.860 --> 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.

06:55.320 --> 06:59.700
And so what they have done is deployed a bunch of different first-time scene detections.

06:59.820 --> 07:02.360
So we've got first time that an email comes in from an address.

07:02.360 --> 07:04.780
First time a particular domain sends an email.

07:04.780 --> 07:06.360
First time they get an attachment type.

07:06.360 --> 07:10.600
They get a PDF for the first time or a CR file or whatever.

07:10.720 --> 07:12.420
First time a service gets installed.

07:12.420 --> 07:14.440
First time the registry gets modified, et cetera, et cetera, et cetera.

07:14.440 --> 07:19.100
And again, this is in the Splunk nomenclature, we use SPL for our search language.

07:19.100 --> 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.

07:24.240 --> 07:27.800
The same thing applies for all other types of data analytics platforms as well.

07:28.360 --> 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.

07:37.860 --> 07:40.480
Because they presented this in 2017 before MITRE.

07:40.620 --> 07:41.740
I broke my rule.

07:41.740 --> 07:42.820
I wasn't going to say MITRE.

07:43.260 --> 07:45.940
Before MITRE became the buzzword du jour.

07:45.940 --> 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.

07:59.640 --> 08:00.740
And it's really useful.

08:01.260 --> 08:05.840
But of course, we're presenting at AI Village, so we like machine learning, too.

08:05.880 --> 08:08.820
And everything we're going to talk about for the rest of this presentation is actual machine learning.

08:09.020 --> 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.

08:20.980 --> 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,

08:35.880 --> 08:38.120
because I didn't know how to use Tableau.

08:38.120 --> 08:39.160
But it was great.

08:39.160 --> 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.

08:46.000 --> 08:52.020
I felt particularly great about it, because I had 110 million audit events from 90,000 different users.

08:52.200 --> 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.

09:00.040 --> 09:01.280
That is a decent number.

09:01.280 --> 09:03.820
That is something I can actually give to a SOC analyst.

09:03.820 --> 09:05.580
It's not going to overwhelm them with noise.

09:05.580 --> 09:06.400
I felt great.

09:06.400 --> 09:07.560
I felt super happy.

09:07.560 --> 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.

09:15.960 --> 09:18.840
And no SOC analyst will use this.

09:18.840 --> 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.

09:27.960 --> 09:31.220
So we said, okay, wait, why don't we make something a little bit simpler?

09:31.600 --> 09:36.680
And when we're looking at simplicity, my favorite of these is kernel density.

09:37.320 --> 09:40.420
Not just because this meme makes me extraordinarily happy.

09:41.260 --> 09:46.740
Kernel density, for those who don't know, is a lot of machine learning that allows us to detect randomness.

09:46.740 --> 09:52.020
And frankly, I don't care about the details of the machine learning, because I'm the citizen data scientist.

09:52.020 --> 09:53.920
I'm not the actual data scientist.

09:54.200 --> 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.

10:16.120 --> 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,

10:35.900 --> 10:39.280
blowing out all of the per hour baselines established.

10:40.380 --> 10:41.820
It's totally legit.

10:41.820 --> 10:47.360
You can ask anybody, Dropbox is for sure a customer that we use, or a product that we use.

10:47.360 --> 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.

10:53.160 --> 10:55.240
But this is a great result.

10:55.240 --> 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.

11:04.780 --> 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.

11:12.480 --> 11:15.900
But of course, in our team, we also like to do research.

11:16.220 --> 11:18.680
So let's talk about the research.

11:21.270 --> 11:22.050
All right.

11:22.050 --> 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.

11:34.470 --> 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.

11:42.510 --> 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.

11:52.890 --> 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.

12:10.130 --> 12:12.610
And so that takes away a lot of visibility.

12:12.610 --> 12:15.590
But one thing that's left are the SSL certificates themselves.

12:15.590 --> 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.

12:24.350 --> 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.

12:40.840 --> 12:43.980
And it's super important, obviously, for SSL.

12:43.980 --> 12:47.640
And we have visibility to it when we look at network data.

12:48.140 --> 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.

12:57.880 --> 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?

13:06.140 --> 13:11.680
And so we have an SSL blacklist that comes from abuse.ch.

13:11.680 --> 13:17.860
And we have a huge corpus of SSL certificates that come from the Rapid7 project Sonar.

13:17.860 --> 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.

13:25.740 --> 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.

13:36.400 --> 13:43.620
And so we thought this would be an interesting first foray into supervised machine learning.

13:45.080 --> 13:48.920
Started off down the trail of feature selection.

13:48.940 --> 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.

13:59.860 --> 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.

14:09.100 --> 14:11.580
And we just did some simple, very simple things.

14:11.580 --> 14:13.000
We started off simple, right?

14:13.500 --> 14:19.080
Number of certificate extensions, number of issuer elements, number of subject elements, et cetera.

14:19.080 --> 14:20.100
You can read those off.

14:20.100 --> 14:25.900
A very simple list of quantitative features that we began to use.

14:25.900 --> 14:28.400
And we really didn't modify this too much, honestly.

14:28.500 --> 14:32.440
We got actually a lot of mileage out of this, which I was surprised by.

14:33.860 --> 14:36.160
Put that into... and we used our machine learning toolkit.

14:36.160 --> 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.

14:46.280 --> 14:51.940
And then we fed that into a whole bunch of different machine learning algorithms.

14:51.940 --> 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.

14:58.080 --> 15:01.980
But I can tell how they look, how they perform, right?

15:02.100 --> 15:03.240
Against one another.

15:03.240 --> 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.

15:16.060 --> 15:17.540
We built this model.

15:18.000 --> 15:19.080
It didn't take too long.

15:19.080 --> 15:23.220
It took a long time to load all that certificate data that I mentioned earlier.

15:23.220 --> 15:25.420
It didn't take too long to build the model.

15:26.020 --> 15:27.040
Applied it.

15:27.040 --> 15:31.240
This is the things that you can do very simply with SPL.

15:31.240 --> 15:33.360
There's SPL shown there.

15:33.360 --> 15:39.660
It doesn't look too simple, maybe, but if you read through it, it's actually not too complicated.

15:39.660 --> 15:40.840
It's quite repetitive.

15:41.180 --> 15:44.240
There's not too much there as far as complexity.

15:45.080 --> 15:49.040
And the cool thing was we found tons and tons of these certificates, right?

15:49.040 --> 15:54.160
Which we predicted that would be on the blacklist and that actually were.

15:54.620 --> 15:57.040
And this was very useful, right?

15:58.420 --> 16:02.160
It was useful because it could add context to something, right?

16:02.360 --> 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?

16:12.420 --> 16:15.780
Because 4% of a giant number is still a giant number.

16:15.860 --> 16:19.160
However, it's super useful for adding context.

16:19.160 --> 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.

16:29.820 --> 16:33.540
And in order to do that, you do a lot of enrichment.

16:33.720 --> 16:35.960
This is a great way to enrich data.

16:36.520 --> 16:38.340
So, you can say, oh, I see this alert.

16:38.920 --> 16:40.580
It has certain characteristics.

16:40.580 --> 16:43.600
I'm trying to determine, you know, is this important to me or not?

16:44.000 --> 16:46.140
And also, I can say, well, you know what?

16:46.140 --> 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.

16:54.640 --> 16:56.060
But we can also say, you know what?

16:56.060 --> 17:00.420
That shares a lot of characteristics with other certificates that are on that blacklist.

17:00.420 --> 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.

17:09.080 --> 17:16.000
That was... yeah, that's right.

17:17.760 --> 17:20.780
So, that was an extremely fast overview of that.

17:20.780 --> 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.

17:27.300 --> 17:28.420
And we have a link to here.

17:28.420 --> 17:34.380
And I'm going to let Ryan talk a little bit now about... So, the whole goal of this, right?

17:34.380 --> 17:37.320
Everything we're doing is to reduce your data set.

17:37.320 --> 17:41.380
Because I don't know the hell that Dave was just talking about for five minutes for PCA.

17:41.380 --> 17:42.500
I can't do any of that.

17:42.500 --> 17:44.860
But I can read a computer screen and look through it.

17:44.860 --> 17:49.460
And what we're trying to do is really find the bears in your network, right?

17:49.520 --> 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.

17:58.160 --> 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.

18:06.820 --> 18:08.320
So, we have this going on.

18:08.320 --> 18:09.000
We tried it.

18:09.000 --> 18:10.060
We had a lot of good success.

18:10.060 --> 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?

18:16.480 --> 18:18.020
Could we actually take machine learning?

18:18.020 --> 18:20.780
I am literally someone who failed math in first grade.

18:20.980 --> 18:22.720
So, for me, this was a real challenge.

18:22.720 --> 18:24.100
And I found it was actually doable.

18:24.100 --> 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.

18:29.900 --> 18:33.400
So, we said, all right, next ML challenge, where's Glass Joe?

18:34.120 --> 18:36.900
So, we said, cool, let's go back in history a little bit.

18:36.900 --> 18:38.720
We have a little bit of a theme here with bears.

18:39.800 --> 18:40.160
Mr.

18:40.160 --> 18:41.660
Podesta once received an email.

18:41.660 --> 18:43.080
It looked just like this.

18:44.160 --> 18:46.720
And then there's another email that looks just like this.

18:46.960 --> 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.

18:54.360 --> 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.

19:01.260 --> 19:06.500
If you have a junior analyst who's never maybe seen this before, you're going to have some problems, right?

19:06.500 --> 19:08.520
Because they are so closely identified.

19:08.520 --> 19:09.800
I've been doing this for 20 years.

19:09.800 --> 19:13.220
I can look at an email and something just feels weird, right?

19:13.220 --> 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?

19:23.480 --> 19:24.920
You have to find the difference.

19:25.000 --> 19:27.440
And the difference sometimes can just be a little sliver.

19:27.820 --> 19:31.620
It's really hard for a junior analyst or a senior analyst to look at that and know.

19:32.080 --> 19:33.380
So we came up with an idea.

19:33.400 --> 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.

19:40.580 --> 19:43.380
And I'm not going to go over the nation state or commodity or anything like this.

19:43.380 --> 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?

19:52.780 --> 19:55.140
So here's the plan of action.

19:55.780 --> 19:58.320
We're going to go ahead and we're going to look at these emails.

19:58.320 --> 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?

20:03.120 --> 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?

20:10.480 --> 20:13.700
What makes something kind of click for you about being weird in email?

20:13.860 --> 20:16.920
And that was my method of feature selection, right?

20:16.920 --> 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.

20:27.020 --> 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,

20:39.360 --> 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.

20:45.760 --> 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.

20:53.460 --> 20:57.520
Because SMTP headers, that protocol is the sluttiest protocol that exists.

20:57.640 --> 21:02.140
You can just about say, hey, y'all, you want to email, chuck it on over, there it goes.

21:02.260 --> 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.

21:08.480 --> 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.

21:14.460 --> 21:18.180
We weren't really happy with all the data we could get out of there, so we kept looking.

21:18.560 --> 21:22.880
Then we compared it to the real things that we wanted to focus on from Office 365.

21:22.920 --> 21:25.500
I'm going to throw this in just because I get angry at Office 365.

21:26.440 --> 21:28.660
And I had to go like this, right?

21:28.660 --> 21:31.120
Old man Kovar yells at Microsoft Cloud.

21:31.120 --> 21:35.760
The reason being, they get rid of all those headers if you're trying to bring it into your network.

21:35.760 --> 21:38.460
You have to do a lot of work to try to get that information.

21:38.640 --> 21:40.560
And for network defenders, I need that data.

21:40.940 --> 21:42.560
So we turned to something called Stoke.

21:42.560 --> 21:45.360
If you're not familiar with Stoke, we have a lot of presentations on this.

21:45.360 --> 21:46.960
It's a file analysis framework.

21:46.960 --> 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.

21:54.120 --> 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?

21:59.340 --> 22:02.760
From value to value.

22:02.760 --> 22:03.500
That's all it is.

22:03.500 --> 22:04.960
So it's beautiful for JSON.

22:05.160 --> 22:07.020
And remember before, I have all those headers.

22:07.040 --> 22:09.360
Well, those just become values in an extensible format.

22:09.360 --> 22:10.700
So we keep going through this.

22:10.700 --> 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.

22:22.940 --> 22:24.660
So like we said, this is our work in progress.

22:24.660 --> 22:27.300
We're kind of literally walking you through as we're doing our research.

22:27.400 --> 22:29.180
So we decided to go with Stoke.

22:29.760 --> 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.

22:35.860 --> 22:38.240
And then we want to find a corpus of APT BAT.

22:38.400 --> 22:40.100
There's various different ways to do that.

22:40.100 --> 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.

22:44.720 --> 22:48.380
We pulled something like 7,000 items out of there, looking for IOCs.

22:48.960 --> 22:52.500
Side note, please stop uploading your emails into VirusTotal.

22:53.200 --> 22:54.080
I'm not joking.

22:54.080 --> 22:56.520
People are doing this in an automated method, right?

22:56.520 --> 22:58.440
So stop doing that if you're in the audience and doing it.

22:58.440 --> 23:00.980
However, it's great for me because I get some real data.

23:00.980 --> 23:02.540
So, going on.

23:02.840 --> 23:05.200
Problems that we've experienced doing this.

23:06.460 --> 23:08.860
Am I just recreating a goddamn spam filter?

23:09.240 --> 23:10.280
Yes, I am.

23:10.280 --> 23:11.840
But it's my spam filter.

23:11.860 --> 23:15.560
And I get to tune it how I want to look for things that I care about for my org.

23:15.560 --> 23:17.240
And that's really important to me.

23:17.580 --> 23:19.860
Second, I speak English pretty poorly.

23:19.900 --> 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.

23:25.360 --> 23:26.980
But that goes back to this.

23:26.980 --> 23:30.340
It's my spam filter, and I'm tuning it for me, right?

23:30.380 --> 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.

23:35.240 --> 23:41.900
Most of the languages, the tool sets we use, NLTK, everything like that, Natural Language Toolkit, they have these different plugins.

23:42.620 --> 23:45.360
As we said, we need a labeled corpora of data.

23:45.360 --> 23:46.360
We've kind of come over that.

23:46.360 --> 23:48.520
We figured out a solution for that with some of the VirusTotal.

23:48.520 --> 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.

23:55.300 --> 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?

24:04.240 --> 24:11.140
Second, in terms of at least for Office 365 stuff, I'm having a real problem keeping up on documentation.

24:11.140 --> 24:12.540
The same thing for Google Mail.

24:12.540 --> 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.

24:17.620 --> 24:25.600
I've already had my research break twice because of changes on API from both Google Cloud Mail and Office 365.

24:25.700 --> 24:27.360
So keep that in mind as you're going through.

24:27.360 --> 24:29.700
As we said, this is a little bit of a work in progress.

24:30.460 --> 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.

24:38.780 --> 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.

24:46.900 --> 24:48.860
It gives them 24 hours before you can find them.

24:49.880 --> 24:51.680
And we also have day jobs.

24:51.680 --> 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.

24:55.600 --> 24:58.040
However, we have had some initial successes.

24:58.220 --> 25:00.620
I call this the Texas Ghanaian dataset.

25:01.940 --> 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,

25:13.640 --> 25:15.400
and then Ghanian hackers.

25:15.680 --> 25:16.960
I have no clue why.

25:16.960 --> 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,

25:29.260 --> 25:32.980
which I'm not really sure what that is, Talk, Contact, and Message.

25:32.980 --> 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.

25:39.820 --> 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?

25:51.960 --> 25:55.980
So when you look at these, these should be statistically different than things you're sending over.

25:55.980 --> 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.

26:02.460 --> 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?

26:11.120 --> 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.

26:19.380 --> 26:29.800
So, in conclusion, on slide 76 of our 27 minutes so far talking, we are simple country data scientists.

26:29.920 --> 26:31.540
We are network defenders.

26:31.660 --> 26:33.380
We are not data scientists.

26:33.520 --> 26:35.820
None of us have a math degree, specifically.

26:35.980 --> 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.

26:44.660 --> 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.

26:53.320 --> 26:54.100
Everything's out there.

26:54.100 --> 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,

27:10.440 --> 27:13.720
the MACCDC dataset that came out in 2012.

27:13.860 --> 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.

27:20.760 --> 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.

27:32.020 --> 27:33.080
Honest to God.

27:33.500 --> 27:35.540
They also don't know what their data is.

27:35.540 --> 27:38.880
So, that's why you're angry about IQR versus standard deviation, right?

27:38.880 --> 27:40.460
Very simple thing to learn.

27:41.920 --> 27:44.100
Multivariate predictions versus seasonality.

27:44.180 --> 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.

27:56.020 --> 27:57.860
Look at that, right?

27:58.060 --> 28:00.100
Second, just apply a little bit of magic.

28:00.100 --> 28:01.460
That magic might be your machine learning.

28:01.460 --> 28:02.660
That might be something else.

28:02.660 --> 28:04.660
We haven't really figured it out, but it's all there.

28:05.880 --> 28:09.820
Takeaways, you can absolutely do this because these three Joes, we did it, right?

28:09.820 --> 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?

28:15.780 --> 28:16.920
Data is everywhere.

28:16.920 --> 28:17.760
It wants to be free.

28:17.760 --> 28:20.280
It wants you to run things against it and draw conclusions.

28:20.480 --> 28:21.700
Why not go for it?

28:21.700 --> 28:23.300
I'll do a call out for Splunk.

28:23.300 --> 28:24.860
I'll do a call out for every other vendor.

28:25.540 --> 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?

28:33.040 --> 28:34.120
So, think about that.

28:34.120 --> 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.

28:41.060 --> 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.

28:50.860 --> 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,

29:07.000 --> 29:10.320
Philip Drager and of course Splunk for letting us do fun stuff like this at home.

29:10.620 --> 29:11.780
I'm Ryan.

29:11.780 --> 29:12.700
I'm David.

29:12.700 --> 29:13.300
Dave.

29:13.300 --> 29:14.220
Thank you.

29:15.200 --> 29:17.360
81 slides, 44 minutes.

