WEBVTT

00:00:00.000 --> 00:00:09.930 align:middle line:90%


00:00:09.930 --> 00:00:11.760 align:middle line:90%
Alternate data streams.

00:00:11.760 --> 00:00:14.250 align:middle line:84%
So we're currently within
the Windows file system

00:00:14.250 --> 00:00:16.079 align:middle line:84%
vulnerability section
of this course,

00:00:16.079 --> 00:00:18.150 align:middle line:84%
and the primary
vulnerability that we're

00:00:18.150 --> 00:00:20.610 align:middle line:84%
going to be focusing
on within this section

00:00:20.610 --> 00:00:22.050 align:middle line:90%
is alternate data streams.

00:00:22.050 --> 00:00:24.810 align:middle line:84%
So we're going to take a look
at what alternate data streams

00:00:24.810 --> 00:00:29.190 align:middle line:84%
are in the context of the
standard Windows file system,

00:00:29.190 --> 00:00:31.770 align:middle line:84%
as well as how they're
used or exploited

00:00:31.770 --> 00:00:35.820 align:middle line:84%
by attackers, primarily in
order to evade detection.

00:00:35.820 --> 00:00:38.640 align:middle line:84%
All right, so what are
alternate data streams,

00:00:38.640 --> 00:00:40.200 align:middle line:90%
also known as ADS?

00:00:40.200 --> 00:00:43.440 align:middle line:84%
Alternate data streams,
also known as ADS,

00:00:43.440 --> 00:00:45.870 align:middle line:90%
is an NTFS file attribute.

00:00:45.870 --> 00:00:51.000 align:middle line:84%
NTFS is the default format
for Windows installations,

00:00:51.000 --> 00:00:52.410 align:middle line:90%
or for Windows computers.

00:00:52.410 --> 00:00:54.503 align:middle line:84%
So if you have ever
installed Windows,

00:00:54.503 --> 00:00:55.920 align:middle line:84%
you know that
you'll actually need

00:00:55.920 --> 00:00:59.370 align:middle line:84%
to format your hard drive
into the NTFS format

00:00:59.370 --> 00:01:01.470 align:middle line:84%
in order to install
Windows on it, right?

00:01:01.470 --> 00:01:04.620 align:middle line:84%
So ADS is essentially
an NTFS file attribute

00:01:04.620 --> 00:01:07.710 align:middle line:84%
and was designed to provide
compatibility with the MacOS

00:01:07.710 --> 00:01:11.890 align:middle line:84%
HFS, or the hierarchical
file system for MacOS.

00:01:11.890 --> 00:01:12.390 align:middle line:90%
All right?

00:01:12.390 --> 00:01:15.930 align:middle line:84%
So what this means,
really, is that whenever

00:01:15.930 --> 00:01:19.290 align:middle line:84%
you create a new file on
an NTFS formatted drive,

00:01:19.290 --> 00:01:22.110 align:middle line:84%
it will typically have
two different forks

00:01:22.110 --> 00:01:23.560 align:middle line:90%
or streams of data.

00:01:23.560 --> 00:01:24.060 align:middle line:90%
All right?

00:01:24.060 --> 00:01:26.310 align:middle line:84%
So whenever you
create a text file,

00:01:26.310 --> 00:01:28.390 align:middle line:84%
a document file,
really any file,

00:01:28.390 --> 00:01:32.400 align:middle line:84%
whenever you download an
MP3, an MP4, really any

00:01:32.400 --> 00:01:34.320 align:middle line:84%
file with any
extension, they're going

00:01:34.320 --> 00:01:35.770 align:middle line:90%
to be two streams of data.

00:01:35.770 --> 00:01:36.270 align:middle line:90%
All right?

00:01:36.270 --> 00:01:37.853 align:middle line:84%
So you're going to
have a data stream.

00:01:37.853 --> 00:01:41.430 align:middle line:84%
This is the default stream that
contains the data of the file.

00:01:41.430 --> 00:01:44.490 align:middle line:84%
So for example, if
I create a TXT file,

00:01:44.490 --> 00:01:46.680 align:middle line:84%
the data stream is
essentially the data that's

00:01:46.680 --> 00:01:48.060 align:middle line:90%
within the text file, right?

00:01:48.060 --> 00:01:52.350 align:middle line:84%
And whenever I open
up the text file,

00:01:52.350 --> 00:01:53.970 align:middle line:84%
any text that I've
typed in there

00:01:53.970 --> 00:01:56.220 align:middle line:84%
is going to be displayed to
me, and that's essentially

00:01:56.220 --> 00:01:57.300 align:middle line:90%
the data stream.

00:01:57.300 --> 00:01:59.430 align:middle line:84%
You then have the
resource stream,

00:01:59.430 --> 00:02:02.020 align:middle line:84%
which will typically contain
the metadata of the file.

00:02:02.020 --> 00:02:06.150 align:middle line:84%
So for example, if I've
created a text file,

00:02:06.150 --> 00:02:09.539 align:middle line:84%
that text file is going to have
a certain amount of metadata

00:02:09.539 --> 00:02:11.400 align:middle line:90%
related to it or attached to it.

00:02:11.400 --> 00:02:15.450 align:middle line:84%
And again, as we know, metadata
is simply just data about data.

00:02:15.450 --> 00:02:20.400 align:middle line:84%
So in the case of NTFS
or in the case of ADS,

00:02:20.400 --> 00:02:22.470 align:middle line:84%
the metadata will
typically be information

00:02:22.470 --> 00:02:25.980 align:middle line:84%
pertinent to when the file was
created, who it was created by,

00:02:25.980 --> 00:02:26.790 align:middle line:90%
et cetera.

00:02:26.790 --> 00:02:30.160 align:middle line:84%
And of course, this is very
different for different file

00:02:30.160 --> 00:02:30.660 align:middle line:90%
formats.

00:02:30.660 --> 00:02:34.800 align:middle line:84%
So for example, if I'm
talking about an MP3 file,

00:02:34.800 --> 00:02:38.790 align:middle line:84%
the metadata of an MP3 file will
typically entail information

00:02:38.790 --> 00:02:41.220 align:middle line:84%
like the duration
of the MP3 file

00:02:41.220 --> 00:02:44.820 align:middle line:84%
or the duration of the
music, or the song rather,

00:02:44.820 --> 00:02:49.230 align:middle line:84%
as well as the file
size, the actual composer

00:02:49.230 --> 00:02:52.260 align:middle line:84%
or the artist that created
the song, et cetera.

00:02:52.260 --> 00:02:53.250 align:middle line:90%
Right?

00:02:53.250 --> 00:02:56.730 align:middle line:84%
Now attackers can use ADS
to hide malicious code

00:02:56.730 --> 00:02:59.040 align:middle line:84%
or executables in
legitimate files

00:02:59.040 --> 00:03:00.940 align:middle line:90%
in order to evade detection.

00:03:00.940 --> 00:03:01.440 align:middle line:90%
All right?

00:03:01.440 --> 00:03:03.960 align:middle line:84%
Now this can be done by
storing the malicious code

00:03:03.960 --> 00:03:08.070 align:middle line:84%
or executables in the file
attribute resource stream,

00:03:08.070 --> 00:03:11.580 align:middle line:84%
also known as the metadata
stream, of a legitimate file.

00:03:11.580 --> 00:03:15.300 align:middle line:84%
So an example of this would
be if I had an executable that

00:03:15.300 --> 00:03:18.330 align:middle line:84%
was malicious in nature,
I can essentially

00:03:18.330 --> 00:03:25.260 align:middle line:84%
use ADS to essentially hide
the payload within the metadata

00:03:25.260 --> 00:03:27.450 align:middle line:84%
or the resource stream
of a legitimate file.

00:03:27.450 --> 00:03:31.200 align:middle line:84%
So I can hide it in the
resource stream of a text file,

00:03:31.200 --> 00:03:34.650 align:middle line:84%
and whenever I run the
text file with the resource

00:03:34.650 --> 00:03:37.410 align:middle line:84%
stream specified, and of
course the resource stream

00:03:37.410 --> 00:03:40.950 align:middle line:84%
will contain the executable,
then the executable

00:03:40.950 --> 00:03:42.012 align:middle line:90%
will be executed.

00:03:42.012 --> 00:03:43.470 align:middle line:84%
And of course, this
will make sense

00:03:43.470 --> 00:03:45.360 align:middle line:84%
once I switch over
to the Windows system

00:03:45.360 --> 00:03:46.620 align:middle line:90%
and demonstrate this.

00:03:46.620 --> 00:03:48.570 align:middle line:84%
So this technique
is usually used

00:03:48.570 --> 00:03:51.360 align:middle line:84%
to evade basic
signature-based antiviruses

00:03:51.360 --> 00:03:53.010 align:middle line:90%
and static scanning tools.

00:03:53.010 --> 00:03:55.830 align:middle line:84%
And it really isn't an
advanced evasion technique.

00:03:55.830 --> 00:03:58.710 align:middle line:84%
It is very useful
or helpful if you

00:03:58.710 --> 00:04:02.820 align:middle line:84%
are trying to evade evasion
from or by administrators

00:04:02.820 --> 00:04:04.230 align:middle line:90%
or by users on the system.

00:04:04.230 --> 00:04:07.950 align:middle line:84%
So this is a great way of
hiding malicious payloads

00:04:07.950 --> 00:04:11.190 align:middle line:84%
or executables in
legitimate files.

00:04:11.190 --> 00:04:13.500 align:middle line:84%
Therefore, again, making
it very difficult to

00:04:13.500 --> 00:04:16.680 align:middle line:84%
detect whether the system
has been compromised.

00:04:16.680 --> 00:04:19.061 align:middle line:84%
So we're actually going
to be demonstrating,

00:04:19.061 --> 00:04:21.269 align:middle line:84%
or we're going to be taking
a look at how this can be

00:04:21.269 --> 00:04:23.220 align:middle line:90%
done in a few seconds, right?

00:04:23.220 --> 00:04:26.670 align:middle line:84%
So this video doesn't have
a lab attached to it, again,

00:04:26.670 --> 00:04:29.263 align:middle line:84%
primarily because of
the actual techniques

00:04:29.263 --> 00:04:30.180 align:middle line:90%
I'll be demonstrating.

00:04:30.180 --> 00:04:33.540 align:middle line:84%
You can easily replicate these
techniques on your own Windows

00:04:33.540 --> 00:04:34.530 align:middle line:90%
system.

00:04:34.530 --> 00:04:37.830 align:middle line:84%
It doesn't have to entail the
use of a malicious payload.

00:04:37.830 --> 00:04:40.920 align:middle line:84%
It can just be any
executable that you'd like

00:04:40.920 --> 00:04:42.360 align:middle line:90%
to hide in a legitimate file.

00:04:42.360 --> 00:04:44.580 align:middle line:84%
So I'll switch over
to the Windows VM

00:04:44.580 --> 00:04:48.520 align:middle line:84%
and we can get started and take
a look at how this can be done.

00:04:48.520 --> 00:04:49.020 align:middle line:90%
All right.

00:04:49.020 --> 00:04:51.930 align:middle line:84%
So I'm back on a
Windows seven VM.

00:04:51.930 --> 00:04:56.067 align:middle line:84%
This will work on any modern
version of Windows, really,

00:04:56.067 --> 00:04:57.900 align:middle line:84%
so again, I'm just going
to be demonstrating

00:04:57.900 --> 00:04:59.430 align:middle line:90%
this on Windows 7.

00:04:59.430 --> 00:05:01.620 align:middle line:84%
So again, what
I'm going to do is

00:05:01.620 --> 00:05:04.410 align:middle line:84%
I'm just going to navigate
to the temp directory here,

00:05:04.410 --> 00:05:06.990 align:middle line:84%
and I'll show you
how this works.

00:05:06.990 --> 00:05:09.450 align:middle line:84%
All right, so I'll just
open up my C drive,

00:05:09.450 --> 00:05:11.280 align:middle line:84%
and I have the temp
directory here.

00:05:11.280 --> 00:05:11.940 align:middle line:90%
Fantastic.

00:05:11.940 --> 00:05:14.670 align:middle line:90%
OK, so what we can do is--

00:05:14.670 --> 00:05:17.880 align:middle line:84%
let's say I wanted to
create a text file.

00:05:17.880 --> 00:05:20.040 align:middle line:84%
I'll just open up my
command prompt here

00:05:20.040 --> 00:05:24.390 align:middle line:84%
and I'll just minimize that so
you can see what's going on.

00:05:24.390 --> 00:05:28.088 align:middle line:84%
I'm just going to expand
this so we can actually

00:05:28.088 --> 00:05:29.130 align:middle line:90%
see what's going on here.

00:05:29.130 --> 00:05:31.172 align:middle line:84%
For some reason, it doesn't
want to expand there,

00:05:31.172 --> 00:05:32.340 align:middle line:90%
but there we go.

00:05:32.340 --> 00:05:38.250 align:middle line:84%
So I'm currently within
the Win 7 home directory.

00:05:38.250 --> 00:05:40.920 align:middle line:84%
So I can head over
to my desktop, right,

00:05:40.920 --> 00:05:45.360 align:middle line:84%
and I can create a file, a text
file for example, with Notepad.

00:05:45.360 --> 00:05:50.950 align:middle line:84%
So I can say Notepad, and then I
can say, for example, test.txt.

00:05:50.950 --> 00:05:51.450 align:middle line:90%
Right?

00:05:51.450 --> 00:05:53.250 align:middle line:84%
So that's typically how
you'd create a file.

00:05:53.250 --> 00:05:54.375 align:middle line:90%
So I can click on it there.

00:05:54.375 --> 00:05:56.460 align:middle line:84%
It's going to say "cannot
find the text file"

00:05:56.460 --> 00:05:58.388 align:middle line:90%
or the default call test.txt.

00:05:58.388 --> 00:05:59.430 align:middle line:90%
Do you want to create it?

00:05:59.430 --> 00:06:00.420 align:middle line:90%
I'm going to hit yes.

00:06:00.420 --> 00:06:04.350 align:middle line:84%
And then I can enter in some
basic data like hello, world.

00:06:04.350 --> 00:06:06.240 align:middle line:90%
Something very basic like that.

00:06:06.240 --> 00:06:07.590 align:middle line:90%
And I can hit save.

00:06:07.590 --> 00:06:08.190 align:middle line:90%
OK?

00:06:08.190 --> 00:06:10.590 align:middle line:84%
So that's created on my desktop,
and you can see it here.

00:06:10.590 --> 00:06:14.700 align:middle line:84%
So again, whenever I open up a
file, this is the data stream,

00:06:14.700 --> 00:06:18.270 align:middle line:84%
or rather, this is the data that
stored within the data stream.

00:06:18.270 --> 00:06:19.380 align:middle line:90%
Right?

00:06:19.380 --> 00:06:21.360 align:middle line:84%
If I right click
on the file and I

00:06:21.360 --> 00:06:25.500 align:middle line:84%
click on properties
and details, this

00:06:25.500 --> 00:06:28.440 align:middle line:84%
is the metadata of the
file, so this is essentially

00:06:28.440 --> 00:06:29.880 align:middle line:90%
the resource stream.

00:06:29.880 --> 00:06:32.430 align:middle line:84%
And what we can do
is, we can actually

00:06:32.430 --> 00:06:36.330 align:middle line:84%
hide a malicious payload
within the resource stream,

00:06:36.330 --> 00:06:41.190 align:middle line:84%
and whenever we execute the file
or whenever we open this file,

00:06:41.190 --> 00:06:44.400 align:middle line:84%
we can specify that we want to
execute the malicious payload.

00:06:44.400 --> 00:06:46.020 align:middle line:90%
So that's just an example.

00:06:46.020 --> 00:06:50.130 align:middle line:90%
So I can say, rm test.txt.

00:06:50.130 --> 00:06:54.390 align:middle line:84%
Sorry, I can just
say, del test.txt.

00:06:54.390 --> 00:06:57.900 align:middle line:84%
I keep forgetting that I'm
working on a Windows system.

00:06:57.900 --> 00:07:04.260 align:middle line:84%
So what I can do now is, I
can actually show you how

00:07:04.260 --> 00:07:05.730 align:middle line:90%
alternate data streams work.

00:07:05.730 --> 00:07:10.590 align:middle line:84%
So if I create another
text file called--

00:07:10.590 --> 00:07:14.070 align:middle line:84%
I'll just use notepad here,
and I'll say test.txt.

00:07:14.070 --> 00:07:19.770 align:middle line:84%
I can also essentially hide
a file within test.txt.

00:07:19.770 --> 00:07:22.500 align:middle line:90%
And we can call it secret.txt.

00:07:22.500 --> 00:07:26.370 align:middle line:84%
Now, what this will do is,
it will open up secret.txt

00:07:26.370 --> 00:07:27.330 align:middle line:90%
with Notepad.

00:07:27.330 --> 00:07:29.610 align:middle line:84%
Remember, it's not
opening up test.txt.

00:07:29.610 --> 00:07:32.620 align:middle line:84%
So if I enter, it's going
to say right over here,

00:07:32.620 --> 00:07:35.850 align:middle line:84%
it cannot find the file
test.txt-- secret.txt.

00:07:35.850 --> 00:07:37.260 align:middle line:90%
So I'll hit Yes.

00:07:37.260 --> 00:07:40.710 align:middle line:84%
So I'm currently working within
the hidden secret.txt file.

00:07:40.710 --> 00:07:42.240 align:middle line:90%
So I can enter data in here.

00:07:42.240 --> 00:07:44.175 align:middle line:90%
So I can say, this is hidden.

00:07:44.175 --> 00:07:47.310 align:middle line:90%


00:07:47.310 --> 00:07:49.650 align:middle line:84%
There we are, and
I can hit Save.

00:07:49.650 --> 00:07:53.340 align:middle line:84%
And if I close that up,
and I open up test.txt,

00:07:53.340 --> 00:07:55.830 align:middle line:84%
you can see test.txt
doesn't have anything.

00:07:55.830 --> 00:07:57.330 align:middle line:90%
That's weird.

00:07:57.330 --> 00:07:59.610 align:middle line:84%
And if I list out the
contents of the Desktop,

00:07:59.610 --> 00:08:02.460 align:middle line:84%
you can see that we only
have the test.txt file.

00:08:02.460 --> 00:08:05.520 align:middle line:84%
And you can see that
the current size is

00:08:05.520 --> 00:08:07.470 align:middle line:90%
0 bytes, which is interesting.

00:08:07.470 --> 00:08:10.570 align:middle line:84%
Now, I can also add data
to the test.txt file.

00:08:10.570 --> 00:08:16.050 align:middle line:84%
So I can say, notepad
test.txt, and I hit Enter.

00:08:16.050 --> 00:08:18.340 align:middle line:90%
And I can say, this is visible.

00:08:18.340 --> 00:08:21.210 align:middle line:90%


00:08:21.210 --> 00:08:22.110 align:middle line:90%
This is visible.

00:08:22.110 --> 00:08:23.190 align:middle line:90%
And I can save that.

00:08:23.190 --> 00:08:24.600 align:middle line:90%
So I can close that up.

00:08:24.600 --> 00:08:26.640 align:middle line:84%
And now, whenever
I open up test.txt,

00:08:26.640 --> 00:08:30.330 align:middle line:84%
I can get the data that's
actually visible there.

00:08:30.330 --> 00:08:33.750 align:middle line:84%
If I ever wanted to access the
hidden file-- which is hidden,

00:08:33.750 --> 00:08:34.530 align:middle line:90%
as you can see.

00:08:34.530 --> 00:08:37.860 align:middle line:84%
You really cannot tell that
we have a hidden file here.

00:08:37.860 --> 00:08:41.100 align:middle line:84%
I can utilize Notepad
if it is a text file,

00:08:41.100 --> 00:08:44.159 align:middle line:84%
or I can use utilize Word if
it's a Word file, et cetera.

00:08:44.159 --> 00:08:45.240 align:middle line:90%
You get the idea.

00:08:45.240 --> 00:08:47.910 align:middle line:90%
So I can say, notepad test.txt.

00:08:47.910 --> 00:08:50.490 align:middle line:84%
And I can access the
actual resource stream

00:08:50.490 --> 00:08:53.980 align:middle line:84%
using the colon, as I did when
I was creating the hidden file.

00:08:53.980 --> 00:08:57.210 align:middle line:84%
So I'll say, open up the
following hidden file

00:08:57.210 --> 00:09:00.150 align:middle line:84%
that's in the resource
stream of test.txt.

00:09:00.150 --> 00:09:03.810 align:middle line:84%
And in this case, we are
going to open up secret.txt.

00:09:03.810 --> 00:09:06.450 align:middle line:84%
If I hit Open, you can see
that is the hidden file.

00:09:06.450 --> 00:09:07.860 align:middle line:84%
And that's the
hidden data that's

00:09:07.860 --> 00:09:11.220 align:middle line:84%
being stored in the resource
stream of the legitimate file

00:09:11.220 --> 00:09:13.380 align:middle line:90%
or the test.txt file.

00:09:13.380 --> 00:09:15.630 align:middle line:84%
So you can now start
to understand how

00:09:15.630 --> 00:09:17.250 align:middle line:90%
attackers can leverage this.

00:09:17.250 --> 00:09:21.570 align:middle line:84%
So I'm just going to delete
the test.txt file there.

00:09:21.570 --> 00:09:24.450 align:middle line:84%
And I have the
WinPEAS binary here.

00:09:24.450 --> 00:09:27.990 align:middle line:84%
So WinPEAS is a utility
used by penetration testers

00:09:27.990 --> 00:09:31.140 align:middle line:84%
to perform local enumeration
on a Windows system

00:09:31.140 --> 00:09:33.390 align:middle line:84%
in order to identify
vulnerabilities that

00:09:33.390 --> 00:09:35.370 align:middle line:84%
can be exploited,
or vulnerabilities

00:09:35.370 --> 00:09:38.700 align:middle line:84%
that can be exploited to
elevate our privileges.

00:09:38.700 --> 00:09:41.100 align:middle line:84%
So it's not really
a malicious file,

00:09:41.100 --> 00:09:42.810 align:middle line:84%
but it's something
that you want to keep

00:09:42.810 --> 00:09:44.640 align:middle line:90%
hidden as much as possible.

00:09:44.640 --> 00:09:47.220 align:middle line:84%
So what I'll do is, I'll
just rename this here.

00:09:47.220 --> 00:09:48.740 align:middle line:90%
I'll rename this to payload.

00:09:48.740 --> 00:09:50.490 align:middle line:84%
And, of course, it's
not really a payload,

00:09:50.490 --> 00:09:51.865 align:middle line:84%
but I can just
rename it to that.

00:09:51.865 --> 00:09:55.380 align:middle line:84%
And I'll cut it, and I'll put
it within the Temp directory.

00:09:55.380 --> 00:09:57.360 align:middle line:84%
Because, as I said, this
is where you typically

00:09:57.360 --> 00:10:00.750 align:middle line:84%
want to hide or store your
exploit files or payloads.

00:10:00.750 --> 00:10:04.110 align:middle line:84%
So it's currently within
the Temp directory.

00:10:04.110 --> 00:10:07.050 align:middle line:84%
So I'll just use my
terminal here or my command

00:10:07.050 --> 00:10:09.750 align:middle line:84%
prompt to navigate to
the root of the C drive.

00:10:09.750 --> 00:10:14.250 align:middle line:84%
And under Temp, you can see we
have the payload.exe file here.

00:10:14.250 --> 00:10:16.140 align:middle line:84%
So I can use the
type command and then

00:10:16.140 --> 00:10:20.280 align:middle line:84%
redirect the output
of payload.exe

00:10:20.280 --> 00:10:23.010 align:middle line:90%
into a new legitimate text file.

00:10:23.010 --> 00:10:24.840 align:middle line:84%
And then, of course,
I'm going to pass

00:10:24.840 --> 00:10:29.940 align:middle line:84%
in the actual executable
into the legitimate text file

00:10:29.940 --> 00:10:31.320 align:middle line:90%
resource stream.

00:10:31.320 --> 00:10:33.660 align:middle line:84%
And I can do that
by saying, type.

00:10:33.660 --> 00:10:35.490 align:middle line:90%
And then I say, payload.exe.

00:10:35.490 --> 00:10:38.460 align:middle line:90%
And I'll redirect the output.

00:10:38.460 --> 00:10:41.130 align:middle line:84%
And I'll say, I want to create
a new legitimate file maybe

00:10:41.130 --> 00:10:44.490 align:middle line:84%
called windowsupdate
or windowslog.txt.

00:10:44.490 --> 00:10:47.040 align:middle line:90%


00:10:47.040 --> 00:10:50.910 align:middle line:84%
And I can essentially
hide the executable.

00:10:50.910 --> 00:10:54.000 align:middle line:84%
And I'll provide the
name of the executable

00:10:54.000 --> 00:10:56.730 align:middle line:84%
that we are essentially hiding
within the resource stream.

00:10:56.730 --> 00:11:00.155 align:middle line:84%
And I'll just call
it winpeas.exe.

00:11:00.155 --> 00:11:00.780 align:middle line:90%
I'll hit Enter.

00:11:00.780 --> 00:11:03.240 align:middle line:84%
You can see that was
successfully done.

00:11:03.240 --> 00:11:05.550 align:middle line:84%
And we still have
the payload file.

00:11:05.550 --> 00:11:10.410 align:middle line:84%
And you can see that the
windowslog.txt file is actually

00:11:10.410 --> 00:11:13.950 align:middle line:84%
0 in terms of its size because
we haven't entered any data.

00:11:13.950 --> 00:11:15.510 align:middle line:84%
So what an attacker
would typically

00:11:15.510 --> 00:11:19.680 align:middle line:84%
do is, they would open
up Notepad and utilize

00:11:19.680 --> 00:11:23.730 align:middle line:84%
the actual file,
the windowslog.txt

00:11:23.730 --> 00:11:26.370 align:middle line:84%
file that they've created,
enter in legitimate data

00:11:26.370 --> 00:11:28.740 align:middle line:84%
so that it looks like a
legitimate file or text

00:11:28.740 --> 00:11:30.450 align:middle line:90%
file that contains log data.

00:11:30.450 --> 00:11:32.730 align:middle line:90%
So I can just say log, log 1.

00:11:32.730 --> 00:11:34.890 align:middle line:84%
Maybe there's a bit
of information there.

00:11:34.890 --> 00:11:38.850 align:middle line:84%
And for the for the purpose
of brevity, I'll just say,

00:11:38.850 --> 00:11:42.930 align:middle line:90%
this is a test file.

00:11:42.930 --> 00:11:46.580 align:middle line:84%
Or we can just say,
this is visible.

00:11:46.580 --> 00:11:47.240 align:middle line:90%
There we are.

00:11:47.240 --> 00:11:50.330 align:middle line:90%
And I can close that up.

00:11:50.330 --> 00:11:52.400 align:middle line:84%
By list of the contents
of this directory,

00:11:52.400 --> 00:11:55.940 align:middle line:84%
we still have payload.exe
and windowslog.txt

00:11:55.940 --> 00:11:57.410 align:middle line:90%
that contains data.

00:11:57.410 --> 00:11:59.270 align:middle line:84%
And we can actually
delete payload.

00:11:59.270 --> 00:12:01.190 align:middle line:84%
So let's delete that
because we've already

00:12:01.190 --> 00:12:04.310 align:middle line:84%
hidden payload or output
the content of payload

00:12:04.310 --> 00:12:08.900 align:middle line:84%
into the winpeas.exe
file that is currently

00:12:08.900 --> 00:12:11.360 align:middle line:84%
stored within the
resource stream

00:12:11.360 --> 00:12:14.180 align:middle line:84%
of the legitimate
windowslog.txt file.

00:12:14.180 --> 00:12:15.440 align:middle line:90%
So I'll hit Yes.

00:12:15.440 --> 00:12:18.350 align:middle line:84%
Now, I can directly
execute this.

00:12:18.350 --> 00:12:20.690 align:middle line:84%
And this will probably
work on Windows 7.

00:12:20.690 --> 00:12:24.320 align:middle line:84%
But I can say start because I'm
now executing an executable.

00:12:24.320 --> 00:12:27.050 align:middle line:90%
I'll say windowslog.txt.

00:12:27.050 --> 00:12:31.220 align:middle line:84%
And I want to execute the
hidden winpeas.exe executable

00:12:31.220 --> 00:12:34.190 align:middle line:84%
that I hid within
the resource stream

00:12:34.190 --> 00:12:36.020 align:middle line:90%
of the windowslog.txt file.

00:12:36.020 --> 00:12:36.853 align:middle line:90%
So I'll hit Enter.

00:12:36.853 --> 00:12:38.270 align:middle line:84%
You can see it's
going to tell you

00:12:38.270 --> 00:12:42.050 align:middle line:84%
there's no program associated
to perform the requested action.

00:12:42.050 --> 00:12:45.080 align:middle line:84%
So OK, so this is being
done or facilitated

00:12:45.080 --> 00:12:47.750 align:middle line:90%
through just the start command.

00:12:47.750 --> 00:12:51.400 align:middle line:84%
What we can do is, we can
create a symbolic link.

00:12:51.400 --> 00:12:53.900 align:middle line:84%
And, of course, if you've never
done that before on Windows,

00:12:53.900 --> 00:12:55.100 align:middle line:90%
it's fairly simple.

00:12:55.100 --> 00:12:58.970 align:middle line:84%
I'll create a symbolic link
within the Windows directory,

00:12:58.970 --> 00:13:01.490 align:middle line:90%
under System32.

00:13:01.490 --> 00:13:02.150 align:middle line:90%
There we are.

00:13:02.150 --> 00:13:06.660 align:middle line:84%
And what I'll do here
is, I'll say, mklink.

00:13:06.660 --> 00:13:09.420 align:middle line:84%
And I'm just going to
call this maybe wupdate.

00:13:09.420 --> 00:13:12.960 align:middle line:84%
So whenever I type in
wupdate within CMD,

00:13:12.960 --> 00:13:17.940 align:middle line:84%
it will automatically execute
the hidden winpeas executable

00:13:17.940 --> 00:13:22.140 align:middle line:84%
that is within the resource
stream of the windows update

00:13:22.140 --> 00:13:23.790 align:middle line:90%
log file that we just created.

00:13:23.790 --> 00:13:28.920 align:middle line:90%
So I'll say, mklink wupdate.exe.

00:13:28.920 --> 00:13:32.010 align:middle line:84%
And the file that we want
to execute is under--

00:13:32.010 --> 00:13:34.290 align:middle line:84%
and I'll just head
over into My Computer,

00:13:34.290 --> 00:13:36.150 align:middle line:84%
and I'll just get
the absolute path

00:13:36.150 --> 00:13:37.380 align:middle line:90%
because I need to specify it.

00:13:37.380 --> 00:13:39.060 align:middle line:90%
So that's under Temp.

00:13:39.060 --> 00:13:41.600 align:middle line:90%
And I'll copy that there.

00:13:41.600 --> 00:13:43.040 align:middle line:90%
So that's under Temp.

00:13:43.040 --> 00:13:47.960 align:middle line:84%
And the file in this case
is called windowslog.txt.

00:13:47.960 --> 00:13:51.840 align:middle line:90%


00:13:51.840 --> 00:13:55.620 align:middle line:84%
And we then specify the actual
executable, which in this case

00:13:55.620 --> 00:13:59.670 align:middle line:90%
is going to be winpeas.exe.

00:13:59.670 --> 00:14:00.510 align:middle line:90%
And I hit Enter.

00:14:00.510 --> 00:14:01.650 align:middle line:84%
And it's going to
tell me, you don't

00:14:01.650 --> 00:14:03.870 align:middle line:84%
have sufficient privileges
to perform this action.

00:14:03.870 --> 00:14:10.200 align:middle line:84%
So I'm just going to do this
with an elevated session here.

00:14:10.200 --> 00:14:11.880 align:middle line:84%
And what I'll do
is, I'll just run

00:14:11.880 --> 00:14:13.110 align:middle line:90%
the same command I did there.

00:14:13.110 --> 00:14:16.230 align:middle line:84%
So again, we're still within
the Windows System32 directory.

00:14:16.230 --> 00:14:20.700 align:middle line:90%
So I'll say mklink wupdate.exe.

00:14:20.700 --> 00:14:24.030 align:middle line:84%
And this is under C.
Or I can actually just

00:14:24.030 --> 00:14:25.260 align:middle line:90%
paste in what I'd copied.

00:14:25.260 --> 00:14:29.010 align:middle line:84%
And the name of the
file is windowslog.txt.

00:14:29.010 --> 00:14:32.800 align:middle line:90%


00:14:32.800 --> 00:14:35.500 align:middle line:84%
And the hidden file
within the resource stream

00:14:35.500 --> 00:14:39.280 align:middle line:90%
is called winpeas.exe.

00:14:39.280 --> 00:14:40.120 align:middle line:90%
I'll lit Enter.

00:14:40.120 --> 00:14:42.430 align:middle line:84%
You can see the symbolic
link is created.

00:14:42.430 --> 00:14:46.750 align:middle line:84%
So whenever I type in
wupdate and hit Enter,

00:14:46.750 --> 00:14:48.948 align:middle line:90%
it's going to execute--

00:14:48.948 --> 00:14:50.740 align:middle line:84%
I'll just open this up
here so you can see.

00:14:50.740 --> 00:14:52.870 align:middle line:90%
It's going to execute winpeas.

00:14:52.870 --> 00:14:56.230 align:middle line:84%
So you can actually see that
winpeas has been executed here.

00:14:56.230 --> 00:14:59.050 align:middle line:84%
And this will start performing
enumeration on the system.

00:14:59.050 --> 00:15:02.350 align:middle line:84%
So this is a really,
really cool vulnerability

00:15:02.350 --> 00:15:05.020 align:middle line:84%
within the Windows file system
that not a lot of people

00:15:05.020 --> 00:15:05.860 align:middle line:90%
actually know about.

00:15:05.860 --> 00:15:11.050 align:middle line:84%
But it is extremely helpful in
evading very basic detection

00:15:11.050 --> 00:15:13.660 align:middle line:84%
by human beings,
or administrators,

00:15:13.660 --> 00:15:17.120 align:middle line:84%
or by very basic signature-based
antivirus systems.

00:15:17.120 --> 00:15:20.530 align:middle line:84%
So again, as I said, this is
not really a malicious payload.

00:15:20.530 --> 00:15:23.470 align:middle line:84%
But I could have done the same
thing for a Meterpreter payload

00:15:23.470 --> 00:15:25.570 align:middle line:90%
that I generated with MSFvenom.

00:15:25.570 --> 00:15:28.450 align:middle line:84%
And, of course, you're
not just limited to hiding

00:15:28.450 --> 00:15:29.950 align:middle line:90%
payloads or executables.

00:15:29.950 --> 00:15:32.740 align:middle line:84%
You can also hide text
files, or documents.

00:15:32.740 --> 00:15:34.150 align:middle line:84%
Really, any type
of file that you

00:15:34.150 --> 00:15:36.910 align:middle line:84%
want you can hide it
within a legitimate file,

00:15:36.910 --> 00:15:40.000 align:middle line:84%
within the resource stream
of the legitimate file.

00:15:40.000 --> 00:15:42.550 align:middle line:84%
So that is how alternate
data streams work,

00:15:42.550 --> 00:15:46.900 align:middle line:84%
and how they can be abused or
exploited by attackers in order

00:15:46.900 --> 00:15:50.920 align:middle line:84%
to hide their malicious
payloads or executables.

00:15:50.920 --> 00:15:53.740 align:middle line:84%
So that is going to conclude
the practical demonstration

00:15:53.740 --> 00:15:57.000 align:middle line:90%
side of this video.

00:15:57.000 --> 00:15:58.980 align:middle line:84%
In the next section
of this course,

00:15:58.980 --> 00:16:01.710 align:middle line:84%
we will be taking a
look at the process

00:16:01.710 --> 00:16:06.690 align:middle line:84%
of how to dump credentials and
hashes from a Windows system.

00:16:06.690 --> 00:16:09.120 align:middle line:84%
And, of course, this
process will essentially

00:16:09.120 --> 00:16:12.540 align:middle line:84%
be done with the hope
or with the objective

00:16:12.540 --> 00:16:16.110 align:middle line:84%
of dumping hashes or
identifying clear text

00:16:16.110 --> 00:16:20.430 align:middle line:84%
passwords within memory for
the purposes of performing

00:16:20.430 --> 00:16:22.020 align:middle line:90%
lateral movement.

00:16:22.020 --> 00:16:26.250 align:middle line:84%
And we'll also be setting the
stage for password cracking,

00:16:26.250 --> 00:16:30.270 align:middle line:84%
more specifically NTLM
password cracking or NTLM hash

00:16:30.270 --> 00:16:35.460 align:middle line:84%
cracking, which we will be
covering in another course.

00:16:35.460 --> 00:16:37.853 align:middle line:84%
But that is really what
we're going to be exploring.

00:16:37.853 --> 00:16:39.270 align:middle line:84%
And we'll also be
exploring how we

00:16:39.270 --> 00:16:42.990 align:middle line:84%
can use the hashes we have
dumped to essentially gain

00:16:42.990 --> 00:16:45.270 align:middle line:84%
access to a target
system legitimately,

00:16:45.270 --> 00:16:51.493 align:middle line:84%
either with PsExec and quite a
few other utilities or tools.

00:16:51.493 --> 00:16:53.160 align:middle line:84%
So that's going to
be it for this video.

00:16:53.160 --> 00:16:56.330 align:middle line:84%
And I'll see you
in the next video.

00:16:56.330 --> 00:16:57.000 align:middle line:90%