WEBVTT

00:00:00.000 --> 00:00:04.018
So I'm going to open up another tool, which is an amazing tool called CyberChef.

00:00:04.018 --> 00:00:04.625
I love CyberChef.

00:00:04.626 --> 00:00:05.701
CyberChef is awesome.

00:00:05.702 --> 00:00:10.098
You can actually go out online to its GitHub site and run it,

00:00:10.098 --> 00:00:13.802
or you can actually download the HTML file and run it locally,

00:00:13.802 --> 00:00:14.509
which is great.

00:00:14.509 --> 00:00:16.850
Yeah, you can run your own instance of it.

00:00:16.850 --> 00:00:20.469
So all I'm doing is I took that Base64 encoded string,

00:00:20.469 --> 00:00:24.708
I copied it in here, and up here on the right,

00:00:24.708 --> 00:00:25.852
we see the Input.

00:00:25.852 --> 00:00:26.955
That's where I pasted it.

00:00:26.955 --> 00:00:29.838
And down here on the bottom right is the Output.

00:00:29.839 --> 00:00:34.536
That's what's going, that's where our decoded stuff is going to be.

00:00:34.536 --> 00:00:38.198
Now what CyberChef does is it has, I don't know,

00:00:38.198 --> 00:00:42.196
maybe like 100 different what it calls recipes of different ways that you can

00:00:42.196 --> 00:00:46.737
decode or manipulate the input and then get it at the output,

00:00:46.737 --> 00:00:50.464
and you can do multiple recipes at the same time.

00:00:50.465 --> 00:00:53.319
So if, let's say, we had a string that was was Base64 encoded,

00:00:53.319 --> 00:00:56.341
and then it was like, let's say,

00:00:56.341 --> 00:01:00.154
zlib compressed or some other type of obfuscation,

00:01:00.154 --> 00:01:05.878
we could first Base64 decode it, and then we could set it,

00:01:05.879 --> 00:01:08.559
then we could do the decompression, or the secondary,

00:01:08.559 --> 00:01:10.478
or whatever it is, and we can do as many as we want.

00:01:10.478 --> 00:01:12.862
And that's what makes cyber stuff so powerful.

00:01:12.862 --> 00:01:15.566
And I see it says BAKE right there, and I've used it before.

00:01:15.566 --> 00:01:16.202
So it's cool.

00:01:16.202 --> 00:01:17.842
You make a recipe, and you bake it up.

00:01:17.842 --> 00:01:18.635
You know what I mean?

00:01:18.635 --> 00:01:23.046
So what I'm going to do here is I'm just going to select the From Base64,

00:01:23.046 --> 00:01:25.919
drag it over here, and when I let go of the mouse button,

00:01:25.919 --> 00:01:29.139
watch the Output portion of the screen because it's going to change,

00:01:29.139 --> 00:01:32.414
and it's going to show us the decoded PowerShell.

00:01:32.414 --> 00:01:33.199
There we go.

00:01:33.199 --> 00:01:35.031
So here we see the decoded PowerShell.

00:01:35.031 --> 00:01:38.427
Now you see that there is dots in between.

00:01:38.427 --> 00:01:40.426
That just means that we're dealing with Unicode

00:01:40.426 --> 00:01:44.849
strings as opposed to an ASCII string, which we could go in and we could modify.

00:01:44.850 --> 00:01:47.288
But I think we can still see what's going on here pretty well.

00:01:47.288 --> 00:01:50.376
It's the extra bits that UTF uses versus ASCII.

00:01:50.376 --> 00:01:56.440
If we look at this, we can see that it's creating a new Web Client object,

00:01:56.441 --> 00:01:59.349
it's going out, we see stuff related to proxy and credentials,

00:01:59.349 --> 00:02:02.634
but at the very bottom here, we see something that says d.

00:02:02.634 --> 00:02:02.723
o.

00:02:02.723 --> 00:02:02.812
w.

00:02:02.812 --> 00:02:02.902
n.

00:02:02.902 --> 00:02:02.991
l.

00:02:02.991 --> 00:02:03.080
o.

00:02:03.080 --> 00:02:03.170
a.

00:02:03.170 --> 00:02:03.259
d.

00:02:03.259 --> 00:02:03.348
S.

00:02:03.348 --> 00:02:03.437
t.

00:02:03.437 --> 00:02:03.527
r.

00:02:03.527 --> 00:02:03.616
I.

00:02:03.616 --> 00:02:03.705
n.

00:02:03.705 --> 00:02:05.222
g, and then we see a URL.

00:02:05.222 --> 00:02:08.981
So even if you don't know how to write code in PowerShell,

00:02:08.981 --> 00:02:11.739
and I will admit, I suck at PowerShell,

00:02:11.739 --> 00:02:15.237
but you can at least look at this and see where it's saying d.

00:02:15.237 --> 00:02:15.388
o.

00:02:15.388 --> 00:02:15.540
w.

00:02:15.540 --> 00:02:15.691
n.

00:02:15.691 --> 00:02:15.842
l.

00:02:15.842 --> 00:02:15.993
o.

00:02:15.993 --> 00:02:16.145
a.

00:02:16.145 --> 00:02:16.296
d.

00:02:16.296 --> 00:02:16.447
S.

00:02:16.447 --> 00:02:16.598
t.

00:02:16.598 --> 00:02:16.750
r.

00:02:16.750 --> 00:02:16.901
I.

00:02:16.901 --> 00:02:17.052
n.

00:02:17.052 --> 00:02:20.201
g, and then a link out to a Pastebin site.

00:02:20.201 --> 00:02:25.136
And so you can at least infer from this that when the user downloads,

00:02:25.136 --> 00:02:29.343
or I'm sorry, when the user opens up the document,

00:02:29.344 --> 00:02:32.822
it's going to launch this PowerShell, and it's going to download this document,

00:02:32.822 --> 00:02:36.741
or whatever this is, whatever this is on Pastebin.

00:02:36.741 --> 00:02:39.957
Now if you look above that, you'll see IEX,

00:02:39.957 --> 00:02:44.783
and that is a PowerShell command for executing whatever is after that.

00:02:44.783 --> 00:02:47.554
So if you're familiar with JavaScript--- Invoke-Expression.

00:02:47.554 --> 00:02:48.631
---yeah, Invoke-Expression.

00:02:48.631 --> 00:02:51.178
If you're familiar with JavaScript, they have the eval command,

00:02:51.178 --> 00:02:54.075
which evaluates anything that's given to it within JavaScript.

00:02:54.075 --> 00:02:55.311
Same concept here.

00:02:55.311 --> 00:02:56.549
It's going to evaluate.

00:02:56.549 --> 00:03:01.228
So probably what's going on here is this PowerShell is going to

00:03:01.228 --> 00:03:04.404
download this Pastebin file and then execute it,

00:03:04.404 --> 00:03:07.174
so it's probably more PowerShell that it's going to execute.

00:03:07.174 --> 00:03:09.419
Yeah, and you can see there's a semicolon at the end too,

00:03:09.419 --> 00:03:10.899
which generally indicates that on the same line,

00:03:10.899 --> 00:03:12.592
there's going to be another command.

00:03:12.592 --> 00:03:16.619
So this is a really good example too because we're

00:03:16.619 --> 00:03:18.108
talking about fileless malware,

00:03:18.108 --> 00:03:23.242
yet there is a file that is the source of the fileless malware.

00:03:23.242 --> 00:03:23.517
Yeah, exactly.

00:03:23.517 --> 00:03:25.456
So there is the file that's going on here.

00:03:25.456 --> 00:03:26.941
We've got that documented.

00:03:26.942 --> 00:03:31.776
We could start tracing through, but this code here that gets downloaded,

00:03:31.776 --> 00:03:32.926
that's downloaded into memory.

00:03:32.926 --> 00:03:35.283
That's not saved to a file anywhere.

00:03:35.283 --> 00:03:40.102
So the defender would have to go out and hope that this is still there,

00:03:40.103 --> 00:03:41.513
this Pastebin site is still there,

00:03:41.514 --> 00:03:46.459
and download it on their own and start to recover it or hope that they have,

00:03:46.460 --> 00:03:51.290
it's HTTPS, so hope that they're decoding SLL traffic in the network,

00:03:51.290 --> 00:03:52.894
which is pretty rare.

00:03:52.895 --> 00:03:56.470
So after this point, if this site is no longer there,

00:03:56.470 --> 00:03:58.517
then you may be out of luck.

00:03:58.517 --> 00:04:00.782
So the fileless part here, because this isn't actually the exploit,

00:04:00.782 --> 00:04:03.710
this is just the stage area that's pulling down the actual exploit,

00:04:03.710 --> 00:04:06.983
so it's loading--- Exploit, or malware, or something.

00:04:06.983 --> 00:04:09.548
---so it's loading that exploit or malware into memory.

00:04:09.548 --> 00:04:11.149
Yes.

00:04:11.149 --> 00:04:15.661
So what if you have Macros disabled, does that help here?

00:04:15.662 --> 00:04:16.185
It does.

00:04:16.185 --> 00:04:20.229
So if you had Macros disabled back here in our documents,

00:04:20.229 --> 00:04:25.545
this code right here would never run.

00:04:25.546 --> 00:04:31.233
You need to have the Macros enabled, and even if you have Macros enabled,

00:04:31.233 --> 00:04:34.237
the user, at least with modern versions of Office,

00:04:34.237 --> 00:04:36.732
they get a little security warning saying that do

00:04:36.732 --> 00:04:38.414
you want to enable this content?

00:04:38.414 --> 00:04:40.470
But the user is going to click Yes.

00:04:40.471 --> 00:04:41.468
They always click Yes.

00:04:41.468 --> 00:04:43.118
Yeah, that's exactly what I was going to say.

00:04:43.119 --> 00:04:47.512
It's the same as saying that we can run a batch

00:04:47.512 --> 00:04:51.403
script to bypass execution policy.

00:04:51.404 --> 00:04:56.784
The policy of disabling the Macros still allows you to enable them

00:04:56.784 --> 00:04:59.885
as the user generally because a lot of Excel sheets have a whole

00:04:59.885 --> 00:05:02.680
bunch of macros that someone made a lot of effort to make to make

00:05:02.680 --> 00:05:05.971
your spreadsheet look awesome, and they're necessary,

00:05:05.971 --> 00:05:08.762
but so they're going to click Yes all the time.

00:05:08.762 --> 00:05:13.312
And attackers know this, and they know that they want to try to trick the users.

00:05:13.313 --> 00:05:15.642
And so often, these phishing documents, they have,

00:05:15.642 --> 00:05:18.954
all that's in there outside of the macro is this really big image

00:05:18.954 --> 00:05:21.658
that says this document has been encrypted.

00:05:21.659 --> 00:05:24.483
Enable Macros in order to see the contents.

00:05:24.484 --> 00:05:28.039
And for most users, that's enough to trick them into doing it.

00:05:28.040 --> 00:05:31.040
That makes sense.
