WEBVTT

00:00:01.240 --> 00:00:05.650
Alright, let's hop into the lab and explore a few of these defaults that we have.

00:00:06.440 --> 00:00:09.140
We'll take this time to check out what the scripts and directories

00:00:09.140 --> 00:00:11.750
within the base and policy directory can do for us.

00:00:12.740 --> 00:00:15.720
We'll take a look at those and then dive into the local.zeek script

00:00:15.720 --> 00:00:18.560
again to see where and how we can modify that.

00:00:21.040 --> 00:00:23.390
Alright, and here we are back into the lab.

00:00:23.400 --> 00:00:25.860
We're back into our local site folder.

00:00:25.870 --> 00:00:29.940
But before we get started and look at the actual local.zeek file,

00:00:29.940 --> 00:00:32.950
let's look at that init‑bare script real quick.

00:00:34.140 --> 00:00:36.910
So I'm going to go ahead and use more and then go navigate to

00:00:36.910 --> 00:00:39.720
the script directory where that's being held,

00:00:39.730 --> 00:00:41.460
which is the base directory.

00:00:42.940 --> 00:00:45.990
And as you can see, we have a few different options here to choose from.

00:00:45.990 --> 00:00:49.330
So we're going to go ahead and just do that init‑bare script.

00:00:49.330 --> 00:00:50.930
And here we are.

00:00:50.940 --> 00:00:54.950
So, by default, this loads the BiF constants and the BiF types.

00:00:55.340 --> 00:00:56.490
And then it goes through,

00:00:56.490 --> 00:01:01.880
and it has a bunch of declarations for sets of strings and addresses,

00:01:01.890 --> 00:01:09.500
vectors, subnets, 509 opaques, just a whole bunch of different type definitions.

00:01:09.500 --> 00:01:14.620
Scrolling down a little bit more, it has some constants that are defined as well.

00:01:14.630 --> 00:01:18.530
So we have thresholds for checking for close connections

00:01:18.530 --> 00:01:21.260
and checking for undelivered signatures.

00:01:22.340 --> 00:01:25.730
So this is where a lot of the built‑in constants and global

00:01:25.740 --> 00:01:29.330
functions that Zeek has and uses are defined.

00:01:29.330 --> 00:01:31.570
Scrolling down a little bit more,

00:01:31.570 --> 00:01:34.050
we have some functions that are defined as well.

00:01:35.840 --> 00:01:37.660
We have records that are defined.

00:01:37.660 --> 00:01:40.420
We have global messages that are defined as well.

00:01:40.420 --> 00:01:41.800
So, like I said,

00:01:41.800 --> 00:01:46.990
this script right here is the bare‑bone script that really drives Zeek's

00:01:46.990 --> 00:01:51.540
functionality and all of the functionality that it loads when we're trying

00:01:51.540 --> 00:01:53.660
to use it just from the basic perspective,

00:01:53.940 --> 00:01:57.450
not even counting all the protocol analyzers and everything like that.

00:01:58.440 --> 00:02:01.350
And speaking of those protocol analyzers and everything,

00:02:01.940 --> 00:02:04.660
the next script that I wanted to look at is the defaults one.

00:02:05.440 --> 00:02:08.750
And this is where Zeek loads all of those things.

00:02:08.759 --> 00:02:13.280
So, this is where we're loading all of our utilities for file checking,

00:02:13.280 --> 00:02:14.860
and URL, and time.

00:02:14.870 --> 00:02:17.420
This is where we're loading the different frameworks that we have,

00:02:17.420 --> 00:02:19.840
so our signature frameworks loaded by default,

00:02:19.840 --> 00:02:22.750
our notice frameworks loaded up by default,

00:02:23.140 --> 00:02:24.550
the intel framework.

00:02:24.550 --> 00:02:28.660
And then all of the protocol analyzers are also loaded by default,

00:02:28.660 --> 00:02:32.010
so we have FTP, NTP, POP3, RADIUS.

00:02:32.020 --> 00:02:34.500
All of these protocols that are built into the base

00:02:34.500 --> 00:02:37.760
directory are loaded via this default script.

00:02:38.340 --> 00:02:43.260
And remember, this one is not loaded if we're using that zeek‑b command.

00:02:43.260 --> 00:02:46.250
We're only going to load that previous one with all of the

00:02:46.250 --> 00:02:48.490
object and type and constant definitions,

00:02:48.490 --> 00:02:50.360
all the global definitions.

00:02:50.370 --> 00:02:55.460
So the init‑bare script loads the Zeek infrastructure for it to use,

00:02:55.640 --> 00:02:59.660
and then this one loads the various scripts for analysis and how it's

00:02:59.660 --> 00:03:03.400
actually going to ingest and analyze the traffic.

00:03:03.400 --> 00:03:06.890
Before we hop into that local.zeek script,

00:03:06.900 --> 00:03:09.600
we'll go and check out the tuning folder.

00:03:09.610 --> 00:03:10.960
And as you can see here,

00:03:10.960 --> 00:03:13.770
we have two scripts that we'll cover a little bit later on in

00:03:13.770 --> 00:03:16.140
this module in the default folder here.

00:03:16.150 --> 00:03:22.200
But essentially, this folder right here is where we can stick our tuning scripts,

00:03:22.320 --> 00:03:26.480
and Zeek comes with about five of them built in to modify the various

00:03:26.480 --> 00:03:29.660
parameters within the ecosystem that we want to just modify.

00:03:30.240 --> 00:03:32.660
And like I said, we'll cover this one in a little bit.

00:03:33.840 --> 00:03:36.660
So now let's take a look at that local.zeek script.

00:03:37.340 --> 00:03:41.260
Now we've seen this throughout this course so far in each of the other modules,

00:03:41.260 --> 00:03:43.060
but what does it actually have in it?

00:03:43.940 --> 00:03:46.900
Well, we have all of our miscellaneous scripts that are loaded.

00:03:46.910 --> 00:03:50.370
We're actually loading some of the tuning scripts in that tuning folder,

00:03:50.370 --> 00:03:53.220
just the default one, so there's three of them that are in there.

00:03:53.220 --> 00:03:56.520
We're loading scripts for capture loss per stats.

00:03:56.530 --> 00:03:59.620
We have that TCP scanning script that we mentioned

00:03:59.620 --> 00:04:02.060
earlier in the course that's not loaded.

00:04:02.440 --> 00:04:05.260
We're not loading the detecting traceroute activity.

00:04:05.840 --> 00:04:08.890
We are loading some protocol frameworks as well.

00:04:08.960 --> 00:04:12.670
We are loading some scripts that help us detect software within certain

00:04:12.670 --> 00:04:17.000
protocols and when we're using external names in DNS.

00:04:17.000 --> 00:04:20.160
When we're talking about customizing the Zeek system,

00:04:20.839 --> 00:04:24.920
we can comment out any of these that we don't want Zeek to load

00:04:24.930 --> 00:04:27.460
and that we don't want Zeek to actually use.

00:04:28.440 --> 00:04:31.410
So if we're not interested in detecting brute force over SSH,

00:04:31.410 --> 00:04:32.550
we can just comment that one out.

00:04:33.140 --> 00:04:36.790
And when we're customizing this, this file does not get overwritten

00:04:36.790 --> 00:04:38.930
with the updates, and patches, and stuff like that,

00:04:38.930 --> 00:04:40.900
like I mentioned previously in the course.

00:04:40.910 --> 00:04:46.050
So this is a great way for us to build our own sections like I did in the

00:04:46.050 --> 00:04:50.770
previous modules where we have this signature framework loaded, and we

00:04:50.770 --> 00:04:52.960
have our specific signatures that are here.

00:04:53.240 --> 00:04:57.470
So build your sections in the local.zeek script to invoke the

00:04:57.470 --> 00:04:59.820
scripts that you want it to run all of the time,

00:04:59.830 --> 00:05:03.260
and also comment out all of the ones that you don't want it to run.
