WEBVTT

00:00:00.000 --> 00:00:00.601
And Tyler,

00:00:00.601 --> 00:00:03.349
thanks for going through all of this with me and

00:00:03.349 --> 00:00:05.411
being here for this Play by Play.

00:00:05.411 --> 00:00:10.518
I think we talked about hunting and detecting fileless malware,

00:00:10.519 --> 00:00:11.728
and we've really kind of delivered on that,

00:00:11.728 --> 00:00:12.688
or you have,

00:00:12.688 --> 00:00:15.508
in showing not just that fileless malware actually has

00:00:15.508 --> 00:00:18.082
files and can be associated with files, but also,

00:00:18.082 --> 00:00:21.154
the things that we'd miss, and the techniques that are used,

00:00:21.154 --> 00:00:23.120
and then tools used to catch that,

00:00:23.121 --> 00:00:25.725
but there seems to be quite a bit of backend stuff that has to

00:00:25.725 --> 00:00:27.957
be done as well to enable us to catch that.

00:00:27.957 --> 00:00:28.919
Yeah, there is.

00:00:28.919 --> 00:00:33.257
You can't just walk into an organization or an organization just can't start

00:00:33.257 --> 00:00:35.442
up and assume that it's going to be detecting all these.

00:00:35.442 --> 00:00:37.504
You have to do the prep work.

00:00:37.505 --> 00:00:39.976
You have to prepare, understand what you're not seeing,

00:00:39.976 --> 00:00:42.665
and what you need to in order to see that.

00:00:42.665 --> 00:00:44.328
And that's where the logging comes in.

00:00:44.328 --> 00:00:45.246
Like we saw,

00:00:45.246 --> 00:00:48.680
if we had not turned on that PowerShell logging and

00:00:48.680 --> 00:00:53.221
the process creation logging, and even we didn't go through on how to do this,

00:00:53.221 --> 00:00:57.484
but the network connection logging, we would not have seen all that information.

00:00:57.484 --> 00:00:59.170
And with that information being logged,

00:00:59.171 --> 00:01:03.165
we saw exactly what the attacker did without having antivirus,

00:01:03.165 --> 00:01:07.026
or EDR, or any of those other tools on the system.

00:01:07.027 --> 00:01:09.831
And although we don't have any kind of tangible assets to pull

00:01:09.831 --> 00:01:12.222
out and say this was the thing that was ran because the memory

00:01:12.222 --> 00:01:14.370
is probably long gone by now,

00:01:14.370 --> 00:01:18.033
but we were able to catch literally everything that happened.

00:01:18.033 --> 00:01:20.995
And that's a great point because memory,

00:01:20.996 --> 00:01:24.808
the length of time that memory exists is finite.

00:01:24.809 --> 00:01:28.412
You may be walking into months down the line after it happened,

00:01:28.412 --> 00:01:33.119
which is not uncommon, and memory is long gone by that point.

00:01:33.120 --> 00:01:34.853
The attacker may have cleaned up their tools,

00:01:34.853 --> 00:01:38.617
but event logs, especially if you're centrally logging them,

00:01:38.617 --> 00:01:40.331
probably still exist.

00:01:40.332 --> 00:01:41.084
Yeah, and that's awesome.

00:01:41.084 --> 00:01:43.297
So we were able to go over PowerShell.

00:01:43.298 --> 00:01:47.574
We went into C# a little bit and how that can compile on the box.

00:01:47.575 --> 00:01:49.830
You can compile programs on the fly.

00:01:49.831 --> 00:01:53.848
That's great for bypassing static signatures.

00:01:53.848 --> 00:01:57.388
The executable really never touches disk at that point.

00:01:57.388 --> 00:01:57.672
Yeah,

00:01:57.672 --> 00:02:01.714
and then even deeper and kind of even more old school a little bit in WMI

00:02:01.715 --> 00:02:05.082
exploits in the subscriptions and the event handlers.

00:02:05.083 --> 00:02:06.198
WMI is, I think,

00:02:06.198 --> 00:02:11.144
one of those things that security investigators and organizations know exists,

00:02:11.144 --> 00:02:14.627
but it's not as understood as well.

00:02:14.627 --> 00:02:16.107
There's not a lot of logging.

00:02:16.107 --> 00:02:19.504
It's a little bit more esoteric than PowerShell is.

00:02:19.504 --> 00:02:23.286
But attackers have realized that this is a great thing that they can use.

00:02:23.286 --> 00:02:24.430
It's deployed everywhere.

00:02:24.430 --> 00:02:26.403
It's been deployed everywhere forever.

00:02:26.403 --> 00:02:28.577
It's even deployed on systems that PowerShell isn't.

00:02:28.577 --> 00:02:33.122
So an attacker is going to use whatever advantage they can,

00:02:33.123 --> 00:02:36.184
and WMI is the perfect place for them to do it.

00:02:36.184 --> 00:02:39.460
Yeah, and there's going to be artifacts,

00:02:39.461 --> 00:02:40.637
especially if we're working on persistence,

00:02:40.637 --> 00:02:42.710
there's going to be registry artifacts that come from that

00:02:42.710 --> 00:02:44.828
because that's a likely mode of persistence.

00:02:44.828 --> 00:02:45.606
Oh yeah, absolutely.

00:02:45.606 --> 00:02:49.945
And the thing to remember too is that the registry where a lot of

00:02:49.945 --> 00:02:53.147
this persistence is going to be located at,

00:02:53.147 --> 00:02:57.466
you don't always just have the run key that everybody is familiar with.

00:02:57.466 --> 00:03:01.652
You may have executables which place themselves directly in the registry.

00:03:01.653 --> 00:03:05.644
There's entire classes of malware where the malware

00:03:05.644 --> 00:03:08.965
executable lives in the registry, it never touches disk,

00:03:08.965 --> 00:03:12.471
and the executable itself never goes to disk anywhere.

00:03:12.471 --> 00:03:14.604
And so it gets launched from the registry,

00:03:14.604 --> 00:03:16.228
it lives in the registry,

00:03:16.228 --> 00:03:19.189
and so if you're not looking there for it or you're not

00:03:19.189 --> 00:03:22.433
familiar with these types of things, you might very well miss it.

00:03:22.434 --> 00:03:25.161
So kind of in an aspect, the registry is not volatile memory,

00:03:25.161 --> 00:03:28.668
but it still is a place that you're not normally looking for an executable.

00:03:28.668 --> 00:03:28.875
Exactly.

00:03:28.875 --> 00:03:30.325
When you think about an executable,

00:03:30.325 --> 00:03:34.590
you think directly I'm going to look for it on the disk.

00:03:34.590 --> 00:03:35.520
It's got to be somewhere on the disk.

00:03:35.520 --> 00:03:38.263
And the whole thing that we've been talking about is

00:03:38.263 --> 00:03:40.222
the attackers avoiding going to disk.

00:03:40.222 --> 00:03:43.670
Because as soon as it touches disk, antivirus is going to be looking at it,

00:03:43.670 --> 00:03:46.627
EDR is going to be looking at it, it leaves a footprint on the disk.

00:03:46.628 --> 00:03:47.933
Even if the attacker deletes it,

00:03:47.933 --> 00:03:50.348
there's always the chance that it can be recovered or at

00:03:50.348 --> 00:03:52.203
least snippets of it can be recovered.

00:03:52.204 --> 00:03:54.200
So the less time they spend on the disk,

00:03:54.201 --> 00:03:58.023
the more likely they are to avoid detection.

00:03:58.023 --> 00:04:02.166
Well, we definitely learned a lot here, but as always with cyber security,

00:04:02.167 --> 00:04:03.917
there is always a whole bunch more to learn.

00:04:03.918 --> 00:04:04.838
There is.

00:04:04.838 --> 00:04:05.298
Absolutely.

00:04:05.298 --> 00:04:10.013
And that speaks to continuous learning as really the best maybe

00:04:10.013 --> 00:04:13.016
mitigation for detecting advanced threats.

00:04:13.016 --> 00:04:13.763
It is.

00:04:13.763 --> 00:04:18.200
I mean, in security, you can't stop learning and you can't stop learning.

00:04:18.200 --> 00:04:19.485
In my opinion,

00:04:19.485 --> 00:04:23.695
the best thing that anybody can do is use their

00:04:23.695 --> 00:04:25.918
curiosity and look in their environment,

00:04:25.918 --> 00:04:28.122
look for these anomalies on their own because it all

00:04:28.122 --> 00:04:31.168
starts with that analyst going hmm, this looks weird,

00:04:31.168 --> 00:04:35.814
and they start digging into it, and that's when things usually blow wide open.

00:04:35.815 --> 00:04:38.724
Yeah, so if we want to implement this in a new environment,

00:04:38.724 --> 00:04:42.158
we would turn on some logging, probably locally with Group Policy,

00:04:42.158 --> 00:04:45.396
and then we'd start using some tools to remotely query.

00:04:45.397 --> 00:04:47.154
And then if we're really getting on our game,

00:04:47.154 --> 00:04:49.039
remotely query, pull that information back,

00:04:49.039 --> 00:04:51.025
maybe using the OS query or something like that,

00:04:51.025 --> 00:04:52.138
into a centralized hub.

00:04:52.139 --> 00:04:53.234
And that's really it.

00:04:53.234 --> 00:04:56.066
If you're not looking for this stuff, you're not going to find it.

00:04:56.066 --> 00:04:59.556
And you don't need to go out and buy this huge commercial environment to do so.

00:04:59.557 --> 00:05:01.030
There are tons of free tools,

00:05:01.030 --> 00:05:03.941
which will do this for you and do it effectively and will

00:05:03.941 --> 00:05:05.456
allow you to essentially log things.

00:05:05.457 --> 00:05:07.265
So for most organizations,

00:05:07.265 --> 00:05:09.533
there's really no excuse why they shouldn't be doing

00:05:09.533 --> 00:05:13.260
this because once you start doing it, you're going to find stuff.

00:05:13.260 --> 00:05:13.599
Absolutely.

00:05:13.599 --> 00:05:15.633
Yeah, and that's the fun part.

00:05:15.633 --> 00:05:16.902
It is.

00:05:16.902 --> 00:05:19.117
That's the only fun we get as blue team.

00:05:19.117 --> 00:05:21.461
Well, unless it's Friday at 4 PM.

00:05:21.462 --> 00:05:23.231
That's when you tend to find stuff.

00:05:23.232 --> 00:05:24.458
That's when it's there.

00:05:24.459 --> 00:05:25.989
Exactly.

00:05:25.989 --> 00:05:26.263
Awesome.

00:05:26.263 --> 00:05:27.913
Well, thanks for joining me, Tyler.

00:05:27.914 --> 00:05:29.750
This Play by Play has been awesome, and I think,

00:05:29.750 --> 00:05:32.523
I hope the viewers can look forward to more of your expertise

00:05:32.523 --> 00:05:34.529
in some future Play by Plays and courses.

00:05:34.530 --> 00:05:36.693
You have some Filebase malware analysis courses out there,

00:05:36.693 --> 00:05:39.767
as well as some intro into malware analysis.

00:05:39.767 --> 00:05:43.877
And I think malware analysis sounds scary to the average analyst,

00:05:43.877 --> 00:05:46.869
but if you really, especially watching some of your courses,

00:05:46.869 --> 00:05:49.139
you start to get into it and realize how it's extremely pertinent,

00:05:49.139 --> 00:05:52.353
like in this scenario, to even continuous monitoring,

00:05:52.353 --> 00:05:54.725
incident response, and forensics.

00:05:54.725 --> 00:05:57.451
It's not like its own bucket or its own stovepipe.

00:05:57.451 --> 00:05:58.263
Yeah, very good.

00:05:58.263 --> 00:05:58.534
Well,

00:05:58.534 --> 00:06:01.765
thanks for joining us for this Play by Play with Hunting for Fileless Malware.

00:06:01.765 --> 00:06:02.713
Alright, I was glad to be here.

00:06:02.713 --> 00:06:03.169
Thank you.

00:06:03.169 --> 00:06:04.169
Great.
