WEBVTT

00:00:00.540 --> 00:00:01.100
Hello.

00:00:01.100 --> 00:00:02.330
In this demo,

00:00:02.340 --> 00:00:05.210
we will look at how Winlogbeat can help us detect

00:00:05.220 --> 00:00:07.810
unauthorized clearing of Windows event logs.

00:00:07.810 --> 00:00:10.470
We will start by ensuring our Winlogbeat

00:00:10.470 --> 00:00:13.060
configuration has the necessary event IDs.

00:00:13.740 --> 00:00:14.280
Then,

00:00:14.460 --> 00:00:18.090
I will simulate clearing the Windows event logs using a well known

00:00:18.090 --> 00:00:22.160
technique seen by ransomware like NotPetya and various APTs.

00:00:22.940 --> 00:00:23.560
Finally,

00:00:23.720 --> 00:00:26.480
we will conclude the demo by observing the artifacts on our

00:00:26.480 --> 00:00:29.660
Elasticsearch cluster using the Kibana web UI.

00:00:30.840 --> 00:00:31.960
Generally speaking,

00:00:32.150 --> 00:00:36.260
the Windows event logs serve as a history of events that occurred on a system.

00:00:36.840 --> 00:00:40.120
So, if a threat actor were to compromise this machine,

00:00:40.370 --> 00:00:42.660
they know the logs may capture their activities,

00:00:43.140 --> 00:00:46.090
so part of their TTPs, or Tactics, Techniques,

00:00:46.090 --> 00:00:49.550
and Procedures, typically involves clearing the event logs.

00:00:50.340 --> 00:00:53.550
This is another reason why it's essential to use a tool like

00:00:53.560 --> 00:00:56.490
Winlogbeat to ship logs off the endpoint.

00:00:56.490 --> 00:01:00.230
Malicious or incidental clearing of the event logs probably

00:01:00.230 --> 00:01:03.170
will not have as much impact if you know those logs are

00:01:03.170 --> 00:01:05.840
saved in real time to a SIEM.

00:01:05.840 --> 00:01:10.150
So what can we do with the Winlogbeat configuration to help us with detection?

00:01:10.740 --> 00:01:14.260
Well, when the audit logs are cleared on a Windows system,

00:01:14.490 --> 00:01:17.330
the event ID 1102 is generated.

00:01:17.330 --> 00:01:20.580
It looks like we have that event ID configured.

00:01:20.580 --> 00:01:24.120
According to the MITRE ATT&CK framework, clearing the Windows

00:01:24.120 --> 00:01:27.260
event logs is considered a defense evasion tactic.

00:01:27.840 --> 00:01:30.960
There are two well‑known ways that logs can be cleared on a

00:01:30.960 --> 00:01:35.030
Windows endpoint. The first is using the Windows Events Command

00:01:35.030 --> 00:01:38.850
Line Utility with a full suite of options available, including

00:01:38.930 --> 00:01:40.660
clearing a specified log.

00:01:41.540 --> 00:01:44.480
The second way to clear logs on a Windows system is with

00:01:44.480 --> 00:01:47.260
the PowerShell cmdlet Clear‑EventLog.

00:01:48.240 --> 00:01:53.160
Let's jump over to the Kibana web UI and search for any existing 1102

00:01:53.160 --> 00:02:00.110
event IDs. Here we are, and as expected, there are no results. If you

00:02:00.110 --> 00:02:04.450
find any 1102 EIDs in your production dataset, I recommend

00:02:04.450 --> 00:02:08.310
investigating and considering developing a policy around arbitrary

00:02:08.310 --> 00:02:10.360
clearing of production security logs.

00:02:11.440 --> 00:02:14.050
Okay, time to head back to the workstation.

00:02:14.840 --> 00:02:20.550
Now, let's clear the screen and put on our adversary hat. I've just

00:02:20.550 --> 00:02:24.900
conducted my operations on this endpoint, and now I want to erase the

00:02:24.900 --> 00:02:27.360
logs that may have evidence of my activity.

00:02:28.440 --> 00:02:31.560
Now those pesky defenders will never know what I've done.

00:02:32.840 --> 00:02:37.730
Okay, that should have logged the 1102 EID to the local system, and

00:02:37.730 --> 00:02:40.560
Winlogbeat shipped it to our centralized collection point.

00:02:41.340 --> 00:02:46.150
I'm going to switch over to the Kibana web UI and look at the data. Here we are.

00:02:46.740 --> 00:02:51.460
You might notice there's only one event when we in fact cleared four event logs.

00:02:51.840 --> 00:02:57.340
Well, that's because the event ID 1102 is specifically for the audit

00:02:57.340 --> 00:03:01.950
log, also known as the security log. If we take a look at the message

00:03:01.950 --> 00:03:04.360
field, we can see the source of the event.

00:03:05.840 --> 00:03:08.850
Ah‑hah! You know which system and user is

00:03:08.850 --> 00:03:10.760
associated with the event at this point.

00:03:11.940 --> 00:03:16.960
Remember, accounts do get compromised, so this isn't a single source of truth.

00:03:17.540 --> 00:03:22.060
You will need more context to identify if this was malicious or incidental,

00:03:23.040 --> 00:03:27.150
but at least you will now be aware of the activity thanks to Winlogbeat.

00:03:27.940 --> 00:03:29.150
That's all for this clip.

00:03:29.300 --> 00:03:30.250
Thanks for watching.
