WEBVTT

00:00:00.342 --> 00:00:01.033
Awesome.

00:00:01.033 --> 00:00:03.108
So beyond PowerShell,

00:00:03.109 --> 00:00:07.797
what other types of fileless malware or methods are we talking about?

00:00:07.797 --> 00:00:13.310
Well, on the operating system, there are installed by default some C# compilers.

00:00:13.310 --> 00:00:17.575
So attackers can download source code for their malware or for

00:00:17.575 --> 00:00:20.337
their attacks and compile it on the fly.

00:00:20.337 --> 00:00:22.669
And yes, depending on how this is done,

00:00:22.670 --> 00:00:24.849
there are going to be some files left behind.

00:00:24.850 --> 00:00:28.198
If an attacker downloads the actual source code in a file itself,

00:00:28.198 --> 00:00:30.137
that file is going to be on there.

00:00:30.137 --> 00:00:33.903
If they remove it, there's always the possibility that you can recover it.

00:00:33.903 --> 00:00:36.298
However, going back to PowerShell.

00:00:36.298 --> 00:00:41.882
There are attackers out there that I've seen that will in their code,

00:00:41.882 --> 00:00:43.486
in the PowerShell code,

00:00:43.486 --> 00:00:47.507
they download the source code for C# on the fly and

00:00:47.507 --> 00:00:49.486
compile it within PowerShell.

00:00:49.487 --> 00:00:52.537
There are APIs within PowerShell that you can use to compile things,

00:00:52.537 --> 00:00:53.884
to compile C# code.

00:00:53.884 --> 00:00:55.358
So it's like combine capabilities.

00:00:55.358 --> 00:00:55.743
Exactly.

00:00:55.743 --> 00:00:57.287
It combines the capabilities,

00:00:57.287 --> 00:01:02.295
and the advantage to the attacker for this is they're not downloading a

00:01:02.295 --> 00:01:06.812
binary that an antivirus signature is going to go off of.

00:01:06.813 --> 00:01:11.831
They're downloading source code and compiling that source code on the fly.

00:01:11.831 --> 00:01:15.931
And if they do it right, it's all in-memory, so it never touches disk.

00:01:15.931 --> 00:01:18.227
Antivirus is probably not going to see this.

00:01:18.227 --> 00:01:22.236
EDR type tools, they may not see it as well.

00:01:22.236 --> 00:01:25.493
So it's a pretty easy way for an attacker to get whatever they

00:01:25.493 --> 00:01:29.091
want onto the system and compile it on the fly so there's no

00:01:29.091 --> 00:01:30.729
signature in existence for it.

00:01:30.729 --> 00:01:31.101
Excellent.

00:01:31.101 --> 00:01:33.710
Yeah, so that's even with deep packet inspection,

00:01:33.710 --> 00:01:36.494
a lot of that stuff is looking at the serial binary and looking for

00:01:36.494 --> 00:01:39.802
a hex code that indicates the MZU when it's an executable and that

00:01:39.802 --> 00:01:45.030
kind of thing and then blocks accordingly based on the hex code

00:01:45.030 --> 00:01:46.442
that's inside those packets.

00:01:46.442 --> 00:01:49.388
In this case, you would not see those executable headers,

00:01:49.388 --> 00:01:54.889
you wouldn't see all of these signatures that you normally see for executables.

00:01:54.889 --> 00:01:55.198
Instead,

00:01:55.198 --> 00:01:58.421
what would be downloaded would be either like a full source code

00:01:58.421 --> 00:02:01.213
file or probably just more likely snippets of code,

00:02:01.214 --> 00:02:06.538
which there are literally thousands of ways that you can encode strings,

00:02:06.538 --> 00:02:10.783
and so it's almost impossible for intrusion detection systems,

00:02:10.783 --> 00:02:11.839
or EDR systems,

00:02:11.839 --> 00:02:16.360
or anything that's watching all of this to be able to figure out

00:02:16.360 --> 00:02:18.043
how to decode everything that's coming down.

00:02:18.043 --> 00:02:20.876
So it's very easy for the attackers to hide these snippets

00:02:20.876 --> 00:02:23.243
of code and then compile them on the fly.

00:02:23.243 --> 00:02:25.970
Not to mention the CPU overhead to decode every single

00:02:25.970 --> 00:02:28.113
thing that comes through all the time.

00:02:28.114 --> 00:02:30.717
Depending on how it was done, it would be pretty immense.

00:02:30.717 --> 00:02:33.520
But one question I have actually is with C#,

00:02:33.520 --> 00:02:39.250
I know, so for UNIX, you can readily compile C code on UNIX.

00:02:39.250 --> 00:02:40.750
Microsoft, not quite so much,

00:02:40.750 --> 00:02:45.066
but C# can be because it includes those libraries natively on the OS.

00:02:45.066 --> 00:02:48.588
So is that the main reason that it's not just we're not pulling down C++,

00:02:48.588 --> 00:02:50.529
but instead, we're pulling down the C#?

00:02:50.529 --> 00:02:50.832
Yeah.

00:02:50.832 --> 00:02:52.653
So with a lot of the.

00:02:52.653 --> 00:02:54.682
NET libraries that get installed,

00:02:54.682 --> 00:02:57.860
there are C# compilers that get installed with them.

00:02:57.860 --> 00:02:59.544
They're on the operating system.

00:02:59.545 --> 00:03:01.008
They're usually not in a default path,

00:03:01.008 --> 00:03:04.028
so you can't just go to a Command Prompt and type csc,

00:03:04.028 --> 00:03:08.385
which is one of the compilers, and have it run automatically.

00:03:08.385 --> 00:03:11.136
But it's on your operating system, and if you search around for it,

00:03:11.136 --> 00:03:12.277
you're going to find it.

00:03:12.278 --> 00:03:13.369
There's csc.

00:03:13.369 --> 00:03:13.915
exe.

00:03:13.915 --> 00:03:16.897
There is another one, microsoft.

00:03:16.897 --> 00:03:17.695
workflow.

00:03:17.695 --> 00:03:18.494
compiler.

00:03:18.494 --> 00:03:19.292
exe.

00:03:19.293 --> 00:03:22.783
Searching around on your Windows system, you're going to find it somewhere.

00:03:22.784 --> 00:03:26.767
And the nice thing for attackers is that they're

00:03:26.767 --> 00:03:28.835
usually in the same directories.

00:03:28.835 --> 00:03:32.045
So once you find it and once you know where it is on one system,

00:03:32.045 --> 00:03:35.442
it's probably going to be in that same location on all of the other system.

00:03:35.442 --> 00:03:39.774
And so the attackers could hard code that address or

00:03:39.774 --> 00:03:42.001
that directory where that file is,

00:03:42.001 --> 00:03:44.597
and they can go in and compile their code without

00:03:44.597 --> 00:03:46.720
having to search the entire hard drive,

00:03:46.720 --> 00:03:49.231
which could indicate some activity is going on.

00:03:49.231 --> 00:03:56.859
Yeah, so they can evade a CPU usage anomaly or even just an indexer usage.

00:03:56.860 --> 00:03:57.425
So with C#,

00:03:57.425 --> 00:04:01.283
this isn't stuff that's being brought down for developers on a developer box,

00:04:01.283 --> 00:04:05.072
so you can't just kind of segment off this subnet of your DevOps guys who

00:04:05.072 --> 00:04:07.331
are doing whatever they want just to make the app work.

00:04:07.331 --> 00:04:12.002
This is stuff that comes with the OS in a standard directory.

00:04:12.003 --> 00:04:13.846
It doesn't have to be preinstalled by anyone.

00:04:13.846 --> 00:04:14.259
Correct.

00:04:14.259 --> 00:04:17.490
Yeah, this goes back to living off the land,

00:04:17.490 --> 00:04:21.245
which is what the fileless attacks and fileless malware are based off of.

00:04:21.245 --> 00:04:24.126
The attackers know that these compilers exist within Windows,

00:04:24.126 --> 00:04:27.345
and so they know that they're going to be able to use it,

00:04:27.346 --> 00:04:31.022
and they use it to their advantage with every chance that they get.

00:04:31.022 --> 00:04:32.022
Awesome.
