WEBVTT

00:00:00.440 --> 00:00:02.300
Hello there, and welcome back.

00:00:02.540 --> 00:00:03.750
So kicking things off,

00:00:03.750 --> 00:00:07.340
let's quickly go over our setup here and what is expected that you have in

00:00:07.340 --> 00:00:10.660
place at a minimum before being able to install Packetbeat.

00:00:10.990 --> 00:00:13.300
So first we have our ELK instance,

00:00:13.310 --> 00:00:16.680
which is set up using the Docker method of install.

00:00:16.680 --> 00:00:20.530
Currently in our ELK Stack setup, we have Winlogbeat,

00:00:20.530 --> 00:00:22.290
as well as Sysmon configured.

00:00:22.790 --> 00:00:23.970
This is not required,

00:00:23.970 --> 00:00:27.190
but can help provide some additional context in the security

00:00:27.190 --> 00:00:29.380
use cases that we'll cover in a later demo.

00:00:29.880 --> 00:00:33.030
I will be going over the manual method of installation,

00:00:33.260 --> 00:00:38.060
but there's also a centralized method that can be configured within ELK itself.

00:00:38.790 --> 00:00:39.420
All right,

00:00:39.430 --> 00:00:44.340
so the first thing we need to do is ensure that we have Npcap or

00:00:44.340 --> 00:00:47.680
WinPcap installed and running on our Windows host.

00:00:47.980 --> 00:00:52.430
This allows us to grab the traffic that is spanning over its network interface,

00:00:52.600 --> 00:00:55.330
thus giving Packetbeat something to read from.

00:00:55.360 --> 00:01:00.330
So the first thing we're going to do here is pull up an internet browser here,

00:01:01.340 --> 00:01:05.310
and we're going to go navigate to the Npcap website.

00:01:06.170 --> 00:01:09.520
And you're just going to click on the Downloads tab,

00:01:09.530 --> 00:01:15.340
which is at the top of the page, and select the latest installer.

00:01:15.350 --> 00:01:18.560
This one is the 1.70.

00:01:18.570 --> 00:01:22.180
It'll start the download of the EXE, and once downloaded,

00:01:22.180 --> 00:01:24.350
go ahead and launch it.

00:01:24.350 --> 00:01:26.750
Now I already have it installed,

00:01:26.760 --> 00:01:30.800
but I will reinstall it so I can show you the features here.

00:01:30.810 --> 00:01:32.840
Accept the copyright.

00:01:33.420 --> 00:01:34.440
And this is important.

00:01:34.440 --> 00:01:37.070
You're going to want to select these bottom two checkboxes,

00:01:37.080 --> 00:01:38.960
which supports wireless adapters,

00:01:38.970 --> 00:01:45.420
as well as install Npcap and WinPcap compatible mode.

00:01:45.430 --> 00:01:48.940
This ensures that no matter your setup,

00:01:48.950 --> 00:01:54.270
the Packetbeat and the Nmap Pcap will be able to effectively

00:01:54.270 --> 00:01:57.000
gather the logs required and utilize them.

00:01:57.000 --> 00:01:59.170
So then you'll go ahead and click Install.

00:01:59.170 --> 00:02:03.420
Now this will only take a minute, and then you'll click,

00:02:03.430 --> 00:02:07.050
I believe it's Next and Finish once completed.

00:02:07.070 --> 00:02:11.980
Okay, now that installation is complete, we'll click Next and Finish.

00:02:11.980 --> 00:02:13.400
Now you're all set.

00:02:13.400 --> 00:02:15.530
Npcap is installed and running.

00:02:15.530 --> 00:02:16.370
So next,

00:02:16.380 --> 00:02:18.880
we will download the Packetbeat Windows ZIP file

00:02:18.880 --> 00:02:20.780
from the Downloads page in Elastic,

00:02:20.980 --> 00:02:24.630
and then we'll extract these contents of the ZIP file into the C

00:02:24.630 --> 00:02:28.810
Program Files location and rename it to Packetbeat.

00:02:28.820 --> 00:02:33.840
So just navigate on over to the Downloads page from Elastic,

00:02:33.850 --> 00:02:37.710
you select your versioning, for this we just used the Windows ZIP,

00:02:37.720 --> 00:02:41.150
you download it, and then once it's fully downloaded,

00:02:41.160 --> 00:02:44.150
on the right side of my screen here you'll see you're going to

00:02:44.150 --> 00:02:47.250
want to extract it to the Program Files location,

00:02:48.870 --> 00:02:53.900
and then go ahead and rename it to Packetbeat with a capital P.

00:02:53.900 --> 00:02:54.740
And as you see,

00:02:54.740 --> 00:02:58.570
we'll click in there and we'll see all the files that we have downloaded.

00:02:58.570 --> 00:03:00.850
Now that we have everything downloaded,

00:03:00.850 --> 00:03:03.960
we actually need to install Packetbeat on this host.

00:03:04.310 --> 00:03:05.410
So what you're going to want to do,

00:03:05.410 --> 00:03:08.180
on the left side of my screen you'll see we have our our

00:03:08.180 --> 00:03:11.360
Windows PowerShell open in administrative mode.

00:03:11.360 --> 00:03:14.540
You do that by right‑clicking on the PowerShell icon and then select Run

00:03:14.540 --> 00:03:17.050
as administrator and this prompt will come up here.

00:03:17.050 --> 00:03:22.010
You're going to want to navigate to that Program Files Packetbeat folder,

00:03:22.020 --> 00:03:31.080
and then simply you're going to run this .\install‑service‑packetbeat‑ps1.

00:03:31.090 --> 00:03:35.300
Go ahead and click Enter, and we'll see, there we go.

00:03:35.310 --> 00:03:38.760
Okay, so this indicates a successful installation.

00:03:38.770 --> 00:03:42.540
As you see, the status is marked as Stopped.

00:03:42.550 --> 00:03:46.700
That means the service is not running, but it is installed correctly.

00:03:46.710 --> 00:03:49.320
Now if you get any red error messages here,

00:03:49.330 --> 00:03:52.660
most likely it's probably the script execution error,

00:03:52.720 --> 00:03:56.540
which would occur if this is the first time you've run

00:03:56.540 --> 00:03:58.340
scripts in PowerShell on this host.

00:03:58.350 --> 00:04:01.220
So if you do get the script execution is disabled,

00:04:01.230 --> 00:04:05.030
you'll need to set the execution policy to allow script enablement.

00:04:05.040 --> 00:04:05.540
So,

00:04:05.550 --> 00:04:07.590
per the command you could add a

00:04:07.600 --> 00:04:12.100
‑ExecutionPolicyUnrestricted and then the file name,

00:04:12.110 --> 00:04:18.380
or if you wanted to do it globally, just run Set‑ExecutionPolicy to bypass.

00:04:18.380 --> 00:04:19.410
That way,

00:04:19.420 --> 00:04:22.600
moving forward any scripts that you run on this host in

00:04:22.600 --> 00:04:25.880
administrative mode you won't be prompted for that error.

00:04:25.900 --> 00:04:30.760
So next, we'll have to ensure our host can communicate with the ELK instance.

00:04:30.780 --> 00:04:33.350
So what we're going to actually do is go over to the

00:04:33.350 --> 00:04:36.740
right side of our screen here, and we're going to open the Packetbeat.

00:04:36.740 --> 00:04:40.470
You can open it in any file solution that you would like.

00:04:40.470 --> 00:04:43.730
I'm just going to use Notepad for simplicity's sake.

00:04:43.740 --> 00:04:46.990
So the first thing we're actually going to do is we have to set

00:04:46.990 --> 00:04:50.920
where the Elasticsearch installation is at and set the username

00:04:50.920 --> 00:04:54.060
and password as well so it's authorized to set up and ingest

00:04:54.060 --> 00:04:55.200
the Packetbeat logging.

00:04:55.210 --> 00:04:58.740
So within the YAML file under a section called output

00:04:58.750 --> 00:05:01.490
Elasticsearch is where we can find that.

00:05:01.490 --> 00:05:08.850
So we're going to scroll down to the section that is labeled output for Elastic.

00:05:08.860 --> 00:05:11.500
You see Kibana, which we'll come back to.

00:05:11.510 --> 00:05:13.480
Elasticsearch Output.

00:05:13.480 --> 00:05:17.550
And as you can see here, we have this hosts section,

00:05:17.560 --> 00:05:20.500
which is set to our destination IP address,

00:05:20.510 --> 00:05:22.190
and the port.

00:05:22.200 --> 00:05:26.130
So the only thing you'll have to do in a default policy is change this IP

00:05:26.130 --> 00:05:30.400
address to the one that is hosting your ELK instance,

00:05:30.410 --> 00:05:34.980
and then also make sure you remove the hash there.

00:05:34.980 --> 00:05:37.200
And then also you're going to want to come down here,

00:05:37.430 --> 00:05:42.310
and if you're using an API key you'll unhash this value and add in your API key,

00:05:42.320 --> 00:05:45.020
or if you just want to use username and password,

00:05:45.030 --> 00:05:47.990
you can uncheck those and do the same thing.

00:05:48.000 --> 00:05:51.310
Next, in order to utilize the Kibana portion of ELK,

00:05:51.320 --> 00:05:52.450
the dashboards,

00:05:52.460 --> 00:05:55.420
we'll want to configure the Kibana section within this

00:05:55.430 --> 00:05:58.790
YAML file as well with the same type of information so

00:05:58.790 --> 00:06:00.630
that it can successfully connect.

00:06:00.640 --> 00:06:03.640
So we will scroll up to Kibana here.

00:06:03.640 --> 00:06:09.060
Same thing, plug in the same destination IP for our ELK instance.

00:06:09.070 --> 00:06:13.310
The port is different, and it should be the default that comes within the policy.

00:06:13.310 --> 00:06:19.210
Make sure it's unchecked, and that is all that is needed for the Kibana setup.

00:06:19.220 --> 00:06:21.570
Moving on. Now that we have everything connected,

00:06:21.580 --> 00:06:26.720
we'll need to set up actual sniffing within this YAML file to allow the

00:06:26.720 --> 00:06:30.760
network‑connected devices the ability to capture the traffic and send it

00:06:30.760 --> 00:06:33.950
on. For Windows, this is pretty straightforward as we just have to

00:06:33.950 --> 00:06:37.270
ensure the correct network interface is set to the

00:06:37.270 --> 00:06:40.670
packet.interfaces.device field within the YAML.

00:06:41.170 --> 00:06:46.420
So we'll scroll up here to that section first so that we can properly

00:06:46.420 --> 00:06:50.910
identify where we're going to be placing that value. And you'll see

00:06:50.910 --> 00:06:55.270
here there's a Network device section, and we will be setting that

00:06:55.270 --> 00:06:58.400
value here. Right now it's set to 4.

00:06:58.410 --> 00:07:02.590
So what we're going to do now in order to confirm which network interface it

00:07:02.590 --> 00:07:08.610
is, we're going to come back on over here to our PowerShell and we're going to

00:07:08.610 --> 00:07:18.470
simply run .\packetbeat.exe, and then devices, and this will give us a list of

00:07:18.480 --> 00:07:23.020
all the available network interfaces that are on this machine, and then we

00:07:23.020 --> 00:07:24.640
just choose which one that is.

00:07:24.650 --> 00:07:28.970
So you can see there's several on here. And if we go

00:07:28.970 --> 00:07:30.180
to the one that's currently set,

00:07:30.190 --> 00:07:33.890
it looks like it's the loopback device, which in this instance

00:07:33.890 --> 00:07:36.060
we actually want it to be device number 3,

00:07:36.070 --> 00:07:40.440
which is this gigabit network connection with the associated

00:07:40.440 --> 00:07:44.840
IP address. So we're going to come back over and simply

00:07:44.850 --> 00:07:48.350
change this value from a 4 to a 3.

00:07:48.630 --> 00:07:49.200
Okay.

00:07:49.200 --> 00:07:53.040
Another thing to mention within the YAML file is these transaction

00:07:53.040 --> 00:07:57.280
protocols. These are all the protocols that will be captured and then

00:07:57.280 --> 00:08:01.500
sent over to ELK within the Packetbeat setup.

00:08:01.510 --> 00:08:04.670
So, it's important that you go through these and review and

00:08:04.680 --> 00:08:08.080
enable or disable any of them that you may need.

00:08:08.400 --> 00:08:11.190
Okay, now that you have the YAML file completed,

00:08:11.200 --> 00:08:13.920
it's time to run a quick test to make sure everything checks

00:08:13.920 --> 00:08:19.730
out. To do this, you're just going to run .\packetbeat.exe,

00:08:19.740 --> 00:08:24.040
and then test config. Click Enter.

00:08:24.050 --> 00:08:26.300
Now if everything checks out appropriately,

00:08:26.310 --> 00:08:31.470
you should get this response, the Config OK. This is telling you that, okay,

00:08:31.480 --> 00:08:36.840
we run through your config, there's no additional spaces or things left out

00:08:36.840 --> 00:08:41.350
that are necessary for Packetbeat to successfully connect.

00:08:42.309 --> 00:08:45.560
So the next step is we'll need to set up the assets

00:08:45.560 --> 00:08:47.500
that are included with Packetbeat.

00:08:47.610 --> 00:08:52.380
These are used effectively to parse index and visualize the data. In order to

00:08:52.380 --> 00:08:56.620
properly load them, we will have to run the following command.

00:08:56.630 --> 00:09:00.060
So again, we're going to do that .\packetbeat.exe,

00:09:00.060 --> 00:09:05.260
and we're going to go setup ‑e.

00:09:05.270 --> 00:09:09.530
Now this essentially is, okay, now that the config is correct,

00:09:09.530 --> 00:09:14.110
we're going to actually load the config. And then the ‑e command is kind of

00:09:14.110 --> 00:09:18.150
like it's an option that will print out any verbose logging or error events

00:09:18.150 --> 00:09:22.720
to the screen, so you can run without it, but if there are any issues,

00:09:22.720 --> 00:09:24.370
we'll provide you with what you need.

00:09:24.380 --> 00:09:28.670
Okay. So it's loading. This is just some general loading.

00:09:28.670 --> 00:09:34.230
We see that we've got the index setup finished in the bottom lower left half of

00:09:34.230 --> 00:09:39.050
the screen, as well as the loading dashboards from Kibana. So it's moving on to

00:09:39.050 --> 00:09:42.680
the next step. Loaded dashboards successfully.

00:09:42.690 --> 00:09:43.350
Okay,

00:09:43.360 --> 00:09:46.890
so it looks like there's a lot of errors on the screen, but

00:09:46.900 --> 00:09:49.520
remember we ran that with the verbose logging.

00:09:49.530 --> 00:09:53.820
If I were to do that again without the e, we would get the only

00:09:53.820 --> 00:09:56.200
necessary commands that we're looking for.

00:09:56.230 --> 00:10:00.650
The index setup is finished loading the Kibana dashboards, and that may take

00:10:00.650 --> 00:10:05.600
a minute, but once completed, we will get that loaded dashboard successfully

00:10:05.610 --> 00:10:11.120
command. And then we know that we are good to go. And there it is. At this

00:10:11.120 --> 00:10:15.330
point if you received any other errors and did not get the loaded complete

00:10:15.330 --> 00:10:17.060
dashboards prompt at the end,

00:10:17.060 --> 00:10:20.390
you will want to look into those individually and satisfy them.

00:10:20.390 --> 00:10:22.910
They're pretty verbose, so you should be able to

00:10:22.920 --> 00:10:26.670
troubleshoot those, and they're usually tied to YAML

00:10:26.670 --> 00:10:29.550
config issues that need to be corrected.

00:10:29.560 --> 00:10:33.860
Okay, so once completed, now we'll actually need to start Packetbeat.

00:10:33.870 --> 00:10:39.840
So we do this by running start‑service packetbeat.

00:10:40.190 --> 00:10:42.950
Okay, now that we've successfully set up our config,

00:10:42.950 --> 00:10:44.200
tested it out,

00:10:44.210 --> 00:10:49.140
installed it, implemented it, and started Packetbeat, in our next video,

00:10:49.140 --> 00:10:53.430
we will verify that our DNS data is being successfully sent into the ELK

00:10:53.440 --> 00:10:57.430
instance, as well as walk through some of the common real‑world networking

00:10:57.430 --> 00:11:00.890
use cases that you can use Packetbeat data four.

00:11:00.900 --> 00:11:02.290
I'll see you in the next demo.
