WEBVTT

00:00:01.140 --> 00:00:05.300
All right, now that we were able to see the Intel framework in action,

00:00:05.370 --> 00:00:08.160
let's pivot a little bit and talk about JA3.

00:00:08.940 --> 00:00:12.140
Now before we get into how we can use that information,

00:00:12.400 --> 00:00:16.050
we need to understand what it is, what tools also use it,

00:00:16.050 --> 00:00:19.030
and how we can make it available in Zeek.

00:00:19.030 --> 00:00:22.060
Let's break down what JA3 really is.

00:00:22.840 --> 00:00:25.590
We have two different things or methods that give us

00:00:25.590 --> 00:00:28.430
hashes for SSL and TLS connections.

00:00:28.740 --> 00:00:33.160
The first one is JA3, and the second is actually JA3S.

00:00:33.740 --> 00:00:36.860
JA3 is a method that's very common in the industry,

00:00:36.860 --> 00:00:39.950
and it's used for fingerprinting the client connections.

00:00:40.740 --> 00:00:44.250
This uses the fields in the client hello messages to the server.

00:00:45.140 --> 00:00:48.760
This process was created by a few Salesforce engineers.

00:00:49.540 --> 00:00:52.260
It helps us identify applications and libraries,

00:00:52.840 --> 00:00:56.910
but we're able to use it for our security processes as well,

00:00:56.920 --> 00:00:59.460
helping us identify malicious applications.

00:01:00.540 --> 00:01:02.800
JA3S is similar in capabilities,

00:01:02.800 --> 00:01:08.260
but looks at the server side of the conversation to create a hash or a JA3

00:01:08.260 --> 00:01:13.100
server profile for the server or application on the server's end.

00:01:13.100 --> 00:01:17.960
Here's an example of a JA3 hash from a client server connection.

00:01:18.540 --> 00:01:23.550
There's nothing special about these except that their hash is in MD5 format.

00:01:24.640 --> 00:01:28.570
We get the hashes for these and compare them to known JA3 or,

00:01:28.570 --> 00:01:33.780
if we're using JA3S, JA3S hash databases that are available.

00:01:33.780 --> 00:01:37.360
And we can match on the malicious activity based on that.

00:01:37.360 --> 00:01:38.860
The theory around this,

00:01:39.100 --> 00:01:42.050
and the practical application of using a feature like this,

00:01:42.440 --> 00:01:45.720
is that the creation and communication of a unique malware

00:01:45.720 --> 00:01:48.360
executable will have its own hashes.

00:01:48.360 --> 00:01:50.940
As we see new malware in our networks,

00:01:51.110 --> 00:01:54.790
we can grab the JA3 hash and use that as an indicator of

00:01:54.790 --> 00:01:57.650
compromise to identify the malware more easily.

00:01:58.440 --> 00:02:00.750
Since the focus for this course is on Zeek,

00:02:01.340 --> 00:02:04.160
how can we use JA3 in our Zeek environment?

00:02:04.840 --> 00:02:06.600
Well, there's an app for that.

00:02:06.600 --> 00:02:07.560
Just kidding.

00:02:07.940 --> 00:02:10.160
But there really is a Zeek package for that.

00:02:11.140 --> 00:02:12.030
This is it.

00:02:12.030 --> 00:02:14.890
The path is salesforce/ja3,

00:02:14.890 --> 00:02:20.560
and we'll be using this in the coming demo to see it actually working for us.

00:02:21.240 --> 00:02:22.190
As you can see,

00:02:22.190 --> 00:02:25.460
it's supported by a lot of different applications that we use in

00:02:25.460 --> 00:02:29.410
cyber operations and a couple of the tools and platforms that we've

00:02:29.420 --> 00:02:31.360
already discussed here in this module.

00:02:32.540 --> 00:02:36.150
We have things like Suricata, Packetbeat from the Elastic Stack,

00:02:36.150 --> 00:02:39.880
Splunk, NetWitness, Security Onion, RockNSM.

00:02:39.880 --> 00:02:41.460
All of these use it.

00:02:42.340 --> 00:02:48.640
Are you able to think of any other uses for JA3 or JA3S hashes besides

00:02:48.640 --> 00:02:51.390
matching against potentially malicious communications?

00:02:51.390 --> 00:02:56.840
Let me know via social media or in the course comments if so.

00:02:56.840 --> 00:02:59.450
So here's what we're going to do.

00:03:00.040 --> 00:03:03.620
We'll use the Salesforce package to get the hashes from our secure

00:03:03.620 --> 00:03:07.760
communications and look at the data that we get from the conversation.

00:03:07.760 --> 00:03:11.790
We'll take a look at the configurations and the README for them,

00:03:11.790 --> 00:03:13.620
then see it in action.

00:03:13.620 --> 00:03:18.170
After we're done with that, we'll get ready to close out the course.

00:03:18.170 --> 00:03:20.050
Let's hop into the lab.

00:03:21.740 --> 00:03:25.530
All right, and here we are back in the lab exactly where we left off.

00:03:25.530 --> 00:03:28.560
I'm going to go ahead and clear my screen to give us some room to work with.

00:03:29.240 --> 00:03:32.860
So the first thing that I'm going to do is install the Salesforce package.

00:03:33.940 --> 00:03:37.260
Now I'm just using the Zeek Package Manager to install it.

00:03:37.260 --> 00:03:39.960
And now that that's good, it already loaded it.

00:03:40.840 --> 00:03:43.750
Before we get into demonstrating how to use it,

00:03:43.750 --> 00:03:47.160
let's go ahead and look at a few of the configurations for it.

00:03:48.640 --> 00:03:50.970
Now as you can see, we have a couple files here.

00:03:50.970 --> 00:03:51.910
We have the README.

00:03:51.910 --> 00:03:54.260
We have the load file.

00:03:54.260 --> 00:03:57.040
Of course, we have an Intel file for JA3.

00:03:57.040 --> 00:04:00.960
We have the JA3 file and then the JA3S script.

00:04:01.640 --> 00:04:04.760
So let's go ahead and look at a couple of these and see what they're doing.

00:04:05.140 --> 00:04:07.200
So the first one, let's do the README.

00:04:07.200 --> 00:04:11.850
Now I'm always a big fan of looking at what the scripts are doing

00:04:11.850 --> 00:04:15.140
before I add them to my Zeek instance just to make sure that I fully

00:04:15.140 --> 00:04:17.209
understand how it's affecting the system,

00:04:17.209 --> 00:04:21.410
how it's affecting my network, and exactly what I'm getting from it.

00:04:21.410 --> 00:04:22.150
And then also,

00:04:22.150 --> 00:04:26.160
it's helpful so you can make any modifications that you think you might want.

00:04:27.140 --> 00:04:30.880
So looking at the README file, it's describing the features that we have.

00:04:30.880 --> 00:04:34.960
So we have the JA3 field being added to the ssl.log.

00:04:35.840 --> 00:04:40.810
We have the Intel file that adds the JA3 information into the Intel framework,

00:04:40.810 --> 00:04:44.150
which gives us the ability to use it for matching

00:04:44.640 --> 00:04:46.810
and then the same for the JA3S.

00:04:46.820 --> 00:04:49.760
We have those added to the ssl.log as well.

00:04:51.140 --> 00:04:55.140
Let's look at the Intel file and see how it's handling these events.

00:04:55.150 --> 00:05:00.060
So as you can see, what we're looking for is the ssl_client_hello,

00:05:00.440 --> 00:05:04.900
and we're grabbing all of this information from that connection and

00:05:04.900 --> 00:05:09.220
passing it over to the Intel framework as an indicator.

00:05:09.220 --> 00:05:14.360
And the indicator type is being defined as Intel JA3,

00:05:14.370 --> 00:05:17.330
which is different than the initial list that we have.

00:05:17.330 --> 00:05:19.960
So we're actually adding new indicator types in here.

00:05:21.440 --> 00:05:23.930
All right, so let's modify the JA3 file,

00:05:23.930 --> 00:05:27.890
and we're looking at the different fields and creating the

00:05:27.890 --> 00:05:30.590
record type for the TLS conversation.

00:05:30.600 --> 00:05:33.490
We have the fields that we'll go ahead and uncomment so

00:05:33.490 --> 00:05:35.050
we can get those extra ones in there.

00:05:36.040 --> 00:05:40.200
And then, as you can see, we have our event definitions like normal,

00:05:40.200 --> 00:05:43.150
and we have the if/then statements or if/else statements

00:05:43.160 --> 00:05:46.720
telling Zeek how to handle these connections and the

00:05:46.720 --> 00:05:48.630
information that it gets from them.

00:05:48.630 --> 00:05:52.890
And there's a lot of information here about the actual SSL and TLS

00:05:52.890 --> 00:05:55.660
connections and the ciphers and formats that we need.

00:05:56.340 --> 00:06:00.690
So let's go ahead and nano this and make sure that we uncomment

00:06:00.700 --> 00:06:05.200
all of the values that we want and then scroll down to the end

00:06:05.200 --> 00:06:07.300
of the script and do the same.

00:06:07.300 --> 00:06:12.070
And then we'll redeploy Zeek since we have that new configuration.

00:06:12.070 --> 00:06:15.660
And now that it's started, we need to generate some traffic.

00:06:16.740 --> 00:06:19.800
So let's go ahead and navigate over to pluralsight.com now so we

00:06:19.800 --> 00:06:23.570
can generate that SSL conversation and hop back over and see

00:06:23.570 --> 00:06:26.160
what the logs say. And look at this.

00:06:26.540 --> 00:06:33.020
We have a lot of information here in the JA3 fields and even the JA3S fields.

00:06:33.030 --> 00:06:37.190
So we have the ciphers, the extensions, the formats,

00:06:37.190 --> 00:06:41.350
the JA3S hash, and the JA3 hash.

00:06:42.240 --> 00:06:46.260
So these two hashes are what we see in the conversation between the two

00:06:46.260 --> 00:06:52.110
hosts. And remember, like we saw in the slides, we can use these hashes to

00:06:52.110 --> 00:06:56.740
match against known malware signatures or known malware hashes based on the

00:06:56.740 --> 00:07:02.010
communication. So we can match this according to the JA3 database and see if

00:07:02.010 --> 00:07:07.450
we have Trickbot or Emotet or other known malwares that have JA3 hashes that

00:07:07.450 --> 00:07:08.410
are already known.

00:07:08.420 --> 00:07:09.850
We can match against those.

00:07:09.860 --> 00:07:14.310
We can download the database itself and use it within Zeek to see if

00:07:14.310 --> 00:07:16.730
we have malicious activity going on in the network.

00:07:16.730 --> 00:07:21.250
So these hashes are extremely useful in helping us find new indicators of

00:07:21.250 --> 00:07:25.940
compromise and matching against already known indicators. And that's really

00:07:25.940 --> 00:07:30.180
it for the JA3 data. You can dive a little bit more into the scripts and

00:07:30.180 --> 00:07:34.250
customize them to handle the traffic a little bit differently if you want or

00:07:34.260 --> 00:07:38.030
add additional fields if you're interested in trying to find new helpful

00:07:38.030 --> 00:07:42.210
fields or convert some of these fields to other formats. That's all possible

00:07:42.220 --> 00:07:43.160
in these scripts.

00:07:43.540 --> 00:07:44.890
But even just out of the box,

00:07:44.890 --> 00:07:48.760
this package is awesome because it gives us this super useful information.
