WEBVTT

00:00:01.540 --> 00:00:02.550
In this demo,

00:00:02.760 --> 00:00:06.940
we're going to configure the Intelligence Framework to match on a URL.

00:00:06.940 --> 00:00:09.960
We'll use pluralsight.com, for example.

00:00:10.540 --> 00:00:14.510
Now in this demo, we're just going to use basic URL matching,

00:00:14.510 --> 00:00:18.760
and we'll be loading the Intel seen script to help with the handling.

00:00:19.640 --> 00:00:21.350
We'll look at some of those scripts first,

00:00:21.590 --> 00:00:25.200
then go in and configure ours and test it out to make sure that

00:00:25.200 --> 00:00:27.860
we get the data populated in the Intel log.

00:00:27.860 --> 00:00:29.260
Let's hop in.

00:00:30.640 --> 00:00:31.310
All right,

00:00:31.320 --> 00:00:34.680
and here we are in our lab environment or in the same

00:00:34.680 --> 00:00:36.460
Zeek box that we've been working in.

00:00:36.940 --> 00:00:40.470
And the first thing that I want to do is go ahead and just check

00:00:40.470 --> 00:00:43.330
out some of the Intel scripts that we have.

00:00:43.330 --> 00:00:45.000
And as I mentioned,

00:00:45.000 --> 00:00:49.630
we're going to look at the seen directory and see what we have here.

00:00:49.630 --> 00:00:52.480
And as you can see, there's a couple scripts in here.

00:00:52.490 --> 00:00:55.240
And the first one that I want to show is going to be the

00:00:55.240 --> 00:00:57.620
connection‑established.zeek script.

00:00:57.630 --> 00:00:59.410
It's a pretty simple script,

00:00:59.420 --> 00:01:03.340
pretty much just identifying the connection being established and

00:01:03.340 --> 00:01:06.990
ensuring that the TCP connection is established so that we can

00:01:06.990 --> 00:01:09.250
pass the connection information over.

00:01:10.140 --> 00:01:14.160
Let's go ahead and check out another one like the dns.zeek, for example.

00:01:14.940 --> 00:01:16.210
Now if you look at this one,

00:01:16.220 --> 00:01:21.330
we're doing a similar function where we're looking for a query and

00:01:21.330 --> 00:01:24.710
looking for a specific domain that we would put in our intelligence

00:01:24.710 --> 00:01:28.130
file that we might not want our users to go to.

00:01:28.130 --> 00:01:31.660
This is going to be similar to the URL matching that we'll do in this demo.

00:01:32.740 --> 00:01:35.530
And finally, let's do the http‑headers one.

00:01:35.540 --> 00:01:38.910
Now this one's a little bit bigger because we're looking for a little

00:01:38.910 --> 00:01:43.190
bit more specific information about the HTTP requests.

00:01:43.200 --> 00:01:44.440
And as you can see,

00:01:44.440 --> 00:01:49.270
we have some matching statements in the Intel seen indicator value here.

00:01:49.280 --> 00:01:50.660
So we're looking inside the header.

00:01:50.660 --> 00:01:52.660
We're looking at URLs.

00:01:52.660 --> 00:01:57.070
So this is going to be similar to what we're going to be using in this

00:01:57.070 --> 00:02:00.060
demo here since we're going to be using the URL matching.

00:02:01.240 --> 00:02:03.300
And if you're familiar with Zeek scripting,

00:02:03.310 --> 00:02:07.480
a lot of the syntax looks familiar with the exception of the

00:02:07.480 --> 00:02:11.360
actual Intel events and functions and the options and

00:02:11.360 --> 00:02:14.460
variables that are involved in it, like the indicators and stuff like that.

00:02:15.040 --> 00:02:17.080
And what's really cool is if you look here,

00:02:17.080 --> 00:02:20.430
because we're analyzing HTTP packets for example,

00:02:20.440 --> 00:02:25.600
we're able to use the user agent as a matching type as well.

00:02:25.600 --> 00:02:28.980
So if we didn't want users connecting with Firefox for example,

00:02:28.990 --> 00:02:33.360
we could go ahead and create an intelligence indicator in our intelligence

00:02:33.360 --> 00:02:37.060
files and use this script to be able to match on it.

00:02:38.340 --> 00:02:41.060
So let's go in, and let's create our test file.

00:02:41.840 --> 00:02:45.990
I'm going to hop over to my intelligence folder here in my Zeek home directory,

00:02:45.990 --> 00:02:50.060
and I'm just going to create a file called globo_intel.txt.

00:02:50.940 --> 00:02:51.720
So here,

00:02:51.730 --> 00:02:56.500
what we need to do is we need to make sure that our Intel file is tab‑delimited,

00:02:56.500 --> 00:03:00.150
and we have to make sure that we have the field values at the top.

00:03:01.340 --> 00:03:04.400
Now, if you remember from the Zeek script that we just saw,

00:03:04.410 --> 00:03:06.340
we have a couple of these here.

00:03:06.340 --> 00:03:09.980
We have the indicators and the indicator types similarly to what we

00:03:09.980 --> 00:03:12.220
saw in the scripts and what they're looking for.

00:03:12.220 --> 00:03:14.820
And remember, these have to be tab‑delimited.

00:03:14.830 --> 00:03:18.750
So after each field, we have to make sure that we press that Tab key.

00:03:20.040 --> 00:03:23.440
Now for the indicator and indicator_type,

00:03:23.450 --> 00:03:30.330
we have those designated as pluralsight.com and Intel URL.

00:03:30.330 --> 00:03:35.370
So what we're doing is we're looking for a URL intelligence,

00:03:35.370 --> 00:03:39.290
and the indicator itself is anybody going to pluralsight.com,

00:03:39.290 --> 00:03:40.520
for example.

00:03:40.820 --> 00:03:43.060
Now the meta source and the meta description,

00:03:43.840 --> 00:03:47.650
you can customize these however you want to in your environment.

00:03:47.660 --> 00:03:50.570
I'm just throwing these up here just to show some of the

00:03:50.570 --> 00:03:52.260
capabilities and the value that we can do.

00:03:53.040 --> 00:03:55.630
So let's go ahead and save this file and exit.

00:03:55.640 --> 00:03:56.200
And then,

00:03:56.210 --> 00:03:58.380
the last thing that we need to do before we can test it

00:03:58.380 --> 00:04:02.990
out is to modify our local.zeek file.

00:04:02.990 --> 00:04:06.780
And what I'm going to do is I'm going to skip all the way down

00:04:06.780 --> 00:04:09.390
to the bottom in my custom script section,

00:04:09.390 --> 00:04:13.650
and I'm going to go ahead and load the Intel seen framework.

00:04:13.650 --> 00:04:18.070
So I'm going to load all of those scripts that we saw in that intel/seen folder.

00:04:18.070 --> 00:04:19.300
And then,

00:04:19.300 --> 00:04:23.980
one more thing that I have to do is I have to create a redefinition statement in

00:04:23.980 --> 00:04:27.460
here telling Zeek where to read my intelligence file from.

00:04:28.340 --> 00:04:30.410
All right, and this is how it's supposed to be.

00:04:30.410 --> 00:04:35.460
We're calling the Intel read_files function and designating the

00:04:35.460 --> 00:04:38.410
directory and the file itself that we just had.

00:04:38.410 --> 00:04:40.360
So it's that globo_intel file.

00:04:41.140 --> 00:04:45.680
Now what you could also do is create a custom Zeek script

00:04:45.690 --> 00:04:48.260
where you're only calling that script in here,

00:04:48.260 --> 00:04:52.140
and you're loading the framework that you want and having all these

00:04:52.140 --> 00:04:55.120
redefinition statements in the script itself instead of having to

00:04:55.120 --> 00:04:56.830
list them all in this local script.

00:04:56.830 --> 00:04:58.180
That's fine as well.

00:04:58.190 --> 00:05:00.660
Either way, this has to be defined though.

00:05:01.140 --> 00:05:04.650
So let's go ahead and save this, and let's go ahead and deploy Zeek.

00:05:06.140 --> 00:05:10.460
All right, now that Zeek is redeployed with our new configurations,

00:05:10.840 --> 00:05:12.710
we need to generate that traffic.

00:05:12.720 --> 00:05:16.680
So what we're going to do is we're going to hop over to our domain controller,

00:05:16.680 --> 00:05:19.060
and we're going to navigate to pluralsight.com.

00:05:20.540 --> 00:05:24.510
Now just us navigating to this initial website should prompt

00:05:24.520 --> 00:05:28.560
the Intelligence Framework to spring into action and give us

00:05:28.570 --> 00:05:30.460
some information in the Intel log.

00:05:30.470 --> 00:05:31.550
So let's go look at it now.

00:05:33.440 --> 00:05:38.970
All right, and as you can see, after a couple refreshes of the log directory,

00:05:38.970 --> 00:05:40.760
we don't have anything in here.

00:05:41.140 --> 00:05:45.760
So let's go ahead and modify our Intel file again,

00:05:45.770 --> 00:05:48.460
and let's try to do something different.

00:05:48.460 --> 00:05:51.330
And I'm pretty sure I know what my mistake was

00:05:51.330 --> 00:05:53.450
because I'm trying to use a domain.

00:05:53.460 --> 00:05:57.710
So let's go ahead and do the domain and use the DNS requests that are

00:05:57.710 --> 00:06:00.900
getting sent across to be able to match on the Intel.

00:06:00.910 --> 00:06:03.150
So let's redeploy Zeek again,

00:06:03.150 --> 00:06:06.510
and then we'll go through and make sure that our

00:06:06.510 --> 00:06:08.940
host sends that DNS request again.

00:06:08.940 --> 00:06:13.100
Before we do so, we need to make sure that we go ahead and flush our DNS.

00:06:13.740 --> 00:06:16.740
All right, now that we've flushed our DNS cache,

00:06:16.750 --> 00:06:19.350
let's try to go to pluralsight.com again.

00:06:25.040 --> 00:06:28.590
Let's go ahead and try one more website and see if that can work.

00:06:28.600 --> 00:06:31.550
I think I'm having some DNS issues in my environment.

00:06:32.940 --> 00:06:37.020
So we're going to go ahead and try going to defendthenet.com instead

00:06:37.030 --> 00:06:39.650
since we haven't been there in our virtual machine yet,

00:06:39.650 --> 00:06:42.350
so it should send a DNS request.

00:06:42.350 --> 00:06:44.550
And here we are.

00:06:47.940 --> 00:06:50.660
And as you can see now, we have that intel.log.

00:06:51.740 --> 00:06:54.210
And when we go ahead and cat it with jq,

00:06:54.210 --> 00:06:57.910
as you can see here, we have our indicators.

00:06:57.910 --> 00:07:01.560
We have our seen indicator type, which is Intel DOMAIN.

00:07:01.940 --> 00:07:02.850
Where did we see it?

00:07:02.850 --> 00:07:04.190
We saw in the host header.

00:07:04.190 --> 00:07:08.230
So do you remember that HTTP script that we saw in the Intel seen

00:07:08.230 --> 00:07:12.020
folder that had the in‑host header statements in there?

00:07:12.030 --> 00:07:13.150
We saw it on Zeek.

00:07:13.150 --> 00:07:17.280
We have the IP address information, we have the port information,

00:07:17.280 --> 00:07:18.950
the timestamps, and everything.

00:07:19.640 --> 00:07:22.370
And then when we look at the matched type,

00:07:22.370 --> 00:07:23.870
we have the Intel DOMAIN again,

00:07:23.870 --> 00:07:27.030
and we have the test‑intel‑website that we labeled in

00:07:27.030 --> 00:07:31.550
our text file as the meta source, so that's why it's showing up as sources here.

00:07:32.540 --> 00:07:36.350
So that's using the Zeek Intelligence Framework to match on going to a

00:07:36.350 --> 00:07:39.760
specific domain using this simple text file that we created.

00:07:40.440 --> 00:07:44.120
Now you can get a lot more robust with how you create these

00:07:44.120 --> 00:07:46.320
indicators or how you use the indicators.

00:07:46.320 --> 00:07:47.250
And remember,

00:07:47.250 --> 00:07:51.660
you can always download other intelligence files and use those in here as well.

00:07:52.040 --> 00:07:55.360
So the capabilities can support many different use cases,

00:07:55.360 --> 00:07:59.250
and you can likely suit the Intelligence Framework to meet

00:07:59.250 --> 00:08:01.060
your specific needs in your environment.
