WEBVTT

00:00:00.940 --> 00:00:02.410
All right, now that that's installed,

00:00:02.410 --> 00:00:06.840
we can go ahead and validate that the plugin's ready to use.

00:00:06.840 --> 00:00:08.560
We can use this command to do so.

00:00:10.340 --> 00:00:14.880
And since that returned the support for Spicy parsers and the

00:00:14.880 --> 00:00:18.920
different types of files that it'll take, that shows that

00:00:18.920 --> 00:00:21.460
Spicy is installed and ready to go.

00:00:22.040 --> 00:00:27.650
So now let's go ahead and create that simple Spicy script to print Hi, I'm Joe!

00:00:29.440 --> 00:00:31.060
All right, I'm going to go ahead and save it.

00:00:32.640 --> 00:00:36.120
And as you can see , we have that new joe.spicy

00:00:36.120 --> 00:00:37.980
script that we just created here.

00:00:37.980 --> 00:00:42.270
And now to demonstrate the compiler on the fly capabilities of it,

00:00:42.270 --> 00:00:47.780
I'm going to use the command spicyc, followed by a ‑j,

00:00:47.790 --> 00:00:49.060
and then the name of the script.

00:00:49.640 --> 00:00:51.880
I have the wrong syntax.

00:00:51.880 --> 00:00:55.880
And again I have the wrong syntax.

00:00:55.880 --> 00:00:59.620
Might help if I had the last semicolon in there.

00:00:59.630 --> 00:01:00.760
All right, here we go.

00:01:02.040 --> 00:01:03.130
And as you can see,

00:01:03.140 --> 00:01:07.440
it's taking it's time to compile the simple code that I just did,

00:01:07.450 --> 00:01:11.160
and it spits it out, it prints it out on the terminal for me.

00:01:12.140 --> 00:01:14.600
All right, so let me go ahead and believe that,

00:01:14.600 --> 00:01:19.180
and let's get into seeing the Spicy analyzer and the scripts

00:01:19.180 --> 00:01:21.460
that we're using to test out the rest of it.

00:01:21.940 --> 00:01:23.580
So the first one I'm going to look at is my

00:01:23.580 --> 00:01:28.860
joe_http.spicy analyzer that was created.

00:01:28.870 --> 00:01:31.230
This is the same one that's in the Zeek documentation.

00:01:31.240 --> 00:01:34.660
So you can go ahead and copy/paste that into here as well

00:01:34.670 --> 00:01:36.300
and experiment with it on your own.

00:01:36.310 --> 00:01:39.030
But essentially, it's defining some constants for us,

00:01:39.030 --> 00:01:41.330
it's showing us the types and the units,

00:01:41.330 --> 00:01:42.400
what to look for.

00:01:42.400 --> 00:01:48.000
And then we have our definitions of what the fields are going to be essentially.

00:01:48.000 --> 00:01:51.670
The next one that we're going to do is the actual event,

00:01:51.670 --> 00:01:57.590
so this is us creating an event using that protocol analyzer,

00:01:57.600 --> 00:01:58.970
joe_http.

00:01:58.970 --> 00:02:03.450
And so this is essentially creating an event for Zeek to

00:02:03.460 --> 00:02:07.280
use in relation to this Spicy analyzer.

00:02:07.280 --> 00:02:12.760
And then finally, the one that we're going to use to call the Spicy parser,

00:02:13.240 --> 00:02:17.390
the Spicy analyzer, and the event is going to be the Zeek script.

00:02:17.390 --> 00:02:21.130
And we went over Zeek scripting in my course, Writing Zeek

00:02:21.130 --> 00:02:22.990
Rules and Scripts here at Pluralsight,

00:02:22.990 --> 00:02:27.030
so you can check that out if you want to get a better idea of the scripts.

00:02:27.030 --> 00:02:30.360
But as you can see, it has the event that we predefined,

00:02:30.740 --> 00:02:32.560
joe_http,

00:02:32.940 --> 00:02:38.490
and then it's telling us what to print as a result of that event being called.

00:02:38.500 --> 00:02:42.650
So we have the Spicy analyzer that analyzes the packets coming in,

00:02:42.650 --> 00:02:44.690
or the pcap, in our case,

00:02:44.700 --> 00:02:48.840
we have the event that defines an event to create

00:02:48.840 --> 00:02:50.940
based on the traffic that it analyzed,

00:02:50.950 --> 00:02:55.820
and then we have this Zeek script that calls the event and gives us an output.

00:02:55.820 --> 00:03:01.550
In this case, it's going to print Zeek saw something happen from this host,

00:03:01.560 --> 00:03:03.840
using this method, so on and so forth.

00:03:03.840 --> 00:03:07.430
Now what we need to do is check out the Zeek plugin

00:03:07.430 --> 00:03:10.330
or the analyzer that we're using, and as you can see,

00:03:10.330 --> 00:03:11.700
Spicy in there.

00:03:11.700 --> 00:03:16.920
So now let's go ahead and put it all together and run an independent instance

00:03:16.930 --> 00:03:21.860
of Zeek real quick in here just to analyze this http.pcap.

00:03:22.740 --> 00:03:25.590
And so with this command we're telling Zeek to run

00:03:25.590 --> 00:03:28.760
Zeek using our Spicy HTTP script,

00:03:29.240 --> 00:03:32.450
and we're going to run it against this HTTP pcap,

00:03:32.940 --> 00:03:36.860
and we're adding in the new HTTP event in there as well.

00:03:37.340 --> 00:03:40.990
So we have the pcap, the Spicy analyzer,

00:03:41.050 --> 00:03:44.520
the event, and the Zeek script all in this code right here.

00:03:44.530 --> 00:03:45.110
And remember,

00:03:45.110 --> 00:03:47.940
you can call these inside of actual Zeek scripts as

00:03:47.940 --> 00:03:49.490
well to have it run automatically.

00:03:49.490 --> 00:03:51.800
But since we're just testing this against this pcap,

00:03:51.810 --> 00:03:54.760
we'll be able to see everything in action.

00:03:54.760 --> 00:03:59.130
And as Zeek's doing its thing, it's analyzing that pcap,

00:03:59.140 --> 00:04:02.650
it's pulling the HTTP information out of the initial header,

00:04:03.040 --> 00:04:06.850
and it's actually using the analyzer to create an event

00:04:06.850 --> 00:04:08.810
based off of the information that it sees.

00:04:08.810 --> 00:04:12.340
And then we should get our print output from the Zeek script.

00:04:12.340 --> 00:04:18.490
And as you can see, Zeek saw from our local address a GET request for index.html.

00:04:18.490 --> 00:04:22.070
And that was what was in the pcap itself.

00:04:22.070 --> 00:04:26.180
And now if I look here, and since we ran the script locally,

00:04:26.190 --> 00:04:28.590
outside of the automated Zeek deployment,

00:04:28.600 --> 00:04:32.150
we have all of our logs in the local folder that we're in,

00:04:32.150 --> 00:04:33.830
or the present working directory that we're in.

00:04:33.830 --> 00:04:36.140
That's because we initiated Zeek here.

00:04:36.140 --> 00:04:43.070
So we have our conn.log, the http.log, and the packet_filter.log in here.

00:04:43.080 --> 00:04:48.090
And so based on that pcap, we have connection events in here that were created,

00:04:48.100 --> 00:04:51.550
and we can use the JQ tool as well.

00:04:51.550 --> 00:04:54.770
And it looks like I have to fix my JQ tool.

00:04:54.770 --> 00:04:59.310
But you can see that we have the conn.log events in here and

00:04:59.310 --> 00:05:03.530
then let's look at the http.log events as well.

00:05:03.530 --> 00:05:07.610
And you can see that we have information from the pcap,

00:05:07.620 --> 00:05:10.660
just based on the information from the HTTP header.

00:05:12.040 --> 00:05:16.370
We were able to look at the pre‑created Spicy HTTP analyzer,

00:05:16.370 --> 00:05:21.340
we were able to look at the event that we created specifically for that,

00:05:21.350 --> 00:05:26.020
and then show you how to use a Zeek script to instantiate Zeek locally

00:05:26.030 --> 00:05:29.860
just to look at the pcap and using those Spicy parsers.

00:05:30.840 --> 00:05:34.560
Now let's get ready to close out this module and move on to the next one.

00:05:37.640 --> 00:05:38.960
All right, that was cool.

00:05:39.640 --> 00:05:42.300
The upcoming modules in this course will focus more on

00:05:42.300 --> 00:05:44.460
the integration piece with other tools,

00:05:44.840 --> 00:05:47.520
but this was a great way to kick off the conversation.

00:05:47.520 --> 00:05:51.380
We were able to talk in detail about adding onto Zeek's

00:05:51.380 --> 00:05:54.750
capabilities without integrating with other technologies.

00:05:54.750 --> 00:05:58.650
We talked about extensions, packages, and projects,

00:05:59.040 --> 00:06:00.610
additional add‑on scripts,

00:06:00.750 --> 00:06:05.560
and some more of the frameworks that we can use to get more data in or

00:06:05.560 --> 00:06:07.980
manipulate the data that we have already coming in.

00:06:09.540 --> 00:06:13.260
Now that you have an idea of some of the expanded capabilities of Zeek,

00:06:13.740 --> 00:06:17.160
we need to move on and get it integrated with other security tools.

00:06:18.240 --> 00:06:20.760
We're going to be spending the next module talking all

00:06:20.760 --> 00:06:23.660
about how Zeek is used with Security Onion.

00:06:24.340 --> 00:06:27.160
We'll also explore the Security Onion implementation of

00:06:27.160 --> 00:06:30.410
Zeek so we can see some specifics around how the data's

00:06:30.410 --> 00:06:31.860
used and how the scripts are built.

00:06:32.340 --> 00:06:33.260
Join me there.
