WEBVTT

00:00:01.040 --> 00:00:02.880
Alright, onto the good stuff.

00:00:02.890 --> 00:00:05.750
Let's log into the Wazuh manager's Kibana UI.

00:00:09.340 --> 00:00:13.560
Okay, and admin, admin is the username and password.

00:00:14.040 --> 00:00:17.670
Obviously, if this is a production environment, that wouldn't be the case.

00:00:21.240 --> 00:00:23.920
Sweet, looks like our victim agent has checked in.

00:00:24.120 --> 00:00:26.670
Let's click on Total agents here and drill in further.

00:00:31.640 --> 00:00:39.090
Okay, let's drill in a little bit further. These graphs,

00:00:39.100 --> 00:00:42.470
so pretty. We can see some recent FIM events.

00:00:42.840 --> 00:00:44.850
Let's go into the Security events tab.

00:00:51.940 --> 00:00:54.760
Let's drill in a little bit further and go into the Events.

00:00:59.240 --> 00:01:03.290
Perfect, now we can see all the alert text. I'm going to scroll

00:01:03.290 --> 00:01:05.160
down to the beginning of the alert chain.

00:01:12.140 --> 00:01:16.440
By default, Wazuh checks netstat for changes every 6 minutes. Within

00:01:16.440 --> 00:01:19.160
this course, I changed this to be every 5 seconds,

00:01:19.170 --> 00:01:21.150
so it's easy to see what's going on.

00:01:21.640 --> 00:01:24.850
This can be configured within Wazuh's main configuration file.

00:01:25.440 --> 00:01:28.670
So long story short, the reason why you're seeing all the netstat alerts

00:01:28.680 --> 00:01:31.770
is because we're firing that check every 5 seconds.

00:01:33.140 --> 00:01:35.360
Okay, let's drill into this netstat alert.

00:01:40.040 --> 00:01:44.480
Notice the udp6 entry. That correlates to the Merlin agent

00:01:44.540 --> 00:01:47.450
instantiating a network connection; however,

00:01:47.700 --> 00:01:50.750
you do not see the Merlin agent's name anywhere within the

00:01:50.750 --> 00:01:53.160
output. That is due to our foothold script.

00:01:53.640 --> 00:01:55.260
Let's go back to the file alerts.

00:02:00.640 --> 00:02:03.070
Let's start with File added to the system.

00:02:08.740 --> 00:02:11.050
Here we see the preload file being added.

00:02:11.540 --> 00:02:13.850
Now let's check out the Integrity checksum alert.

00:02:21.440 --> 00:02:24.530
We see the /etc/bash.bashrc file being modified.

00:02:24.710 --> 00:02:26.960
Even better, if we scroll down a little bit,

00:02:32.240 --> 00:02:34.580
we can see the actual text that was changed.

00:02:34.730 --> 00:02:39.070
That's awesome. Anyhow, Wazuh caught the foothold script being

00:02:39.070 --> 00:02:42.160
added. In the real world, this script would have an innocuous

00:02:42.160 --> 00:02:45.340
name such as package updater. Okay,

00:02:45.350 --> 00:02:48.440
now it's time to zoom out a little bit here and do some reflection.

00:02:48.530 --> 00:02:50.270
I'm going to collapse these alerts.

00:02:52.840 --> 00:02:56.980
Let's quickly go through the rest of the alerts here. We see a bunch of CIS

00:02:56.980 --> 00:03:00.270
benchmark checks. That's outside of the scope of this tutorial.

00:03:04.540 --> 00:03:06.300
As we reflect on these alerts,

00:03:06.490 --> 00:03:10.500
it's important to notice what alerts were not generated. In the beginning of

00:03:10.500 --> 00:03:14.000
this tutorial, I spoke about Wazuh's rootkit functionality,

00:03:14.090 --> 00:03:17.480
where it gives an explicit alert for finding rootkits or

00:03:17.480 --> 00:03:21.420
cloaked processes. While Wazuh's rootkit functionality does

00:03:21.420 --> 00:03:23.770
look for hidden processes, in this case,

00:03:23.820 --> 00:03:26.780
it doesn't flag anything. Even if we increase the

00:03:26.780 --> 00:03:29.540
frequency of the rootkit scans, Wazuh will not

00:03:29.540 --> 00:03:32.270
consistently find the cloaked Merlin process.

00:03:32.740 --> 00:03:34.270
So, what gives?

00:03:34.640 --> 00:03:36.560
Does this mean Wazuh is complete garbage?

00:03:37.140 --> 00:03:40.210
Absolutely not, because perfection is an illusion,

00:03:40.220 --> 00:03:43.770
and it's my job to show the pros and cons of a given tool.

00:03:44.440 --> 00:03:47.770
So how do we get around this? When creating alerts,

00:03:47.780 --> 00:03:50.060
we should focus on the true foundation of the alert.

00:03:50.440 --> 00:03:54.670
Like many attacks, the foothold attack is based within the file system.

00:03:55.540 --> 00:03:58.250
Luckily for us, file integrity monitoring,

00:03:58.260 --> 00:03:59.010
or FIM,

00:03:59.070 --> 00:04:02.450
is a strength of Wazuh. And as we just saw, FIM con

00:04:02.450 --> 00:04:04.360
give us hints that malware is present.

00:04:05.140 --> 00:04:08.650
Let's explore Wazuh's file integrity monitoring in more detail.
