WEBVTT

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


00:00:04.320 --> 00:00:10.080 align:middle line:90%
[MUSIC PLAYING]

00:00:10.080 --> 00:00:14.100 align:middle line:84%
Searching for passwords in
Windows Configuration Files.

00:00:14.100 --> 00:00:15.900 align:middle line:84%
All right, so this is
the first technique

00:00:15.900 --> 00:00:18.570 align:middle line:84%
that we're going to be
exploring within this section.

00:00:18.570 --> 00:00:22.230 align:middle line:84%
And it will involve
searching for and identifying

00:00:22.230 --> 00:00:25.650 align:middle line:84%
user credentials that have been
stored in Windows Configuration

00:00:25.650 --> 00:00:26.250 align:middle line:90%
Files.

00:00:26.250 --> 00:00:28.410 align:middle line:84%
The key thing to note
here is we're not really

00:00:28.410 --> 00:00:29.910 align:middle line:84%
looking for passwords
that are being

00:00:29.910 --> 00:00:34.200 align:middle line:84%
stored in configuration files
of third party applications.

00:00:34.200 --> 00:00:37.500 align:middle line:84%
We're primarily interested in
Windows Configuration Files.

00:00:37.500 --> 00:00:39.150 align:middle line:84%
And in this particular
case, we are

00:00:39.150 --> 00:00:42.060 align:middle line:84%
going to be exploring
the process of searching

00:00:42.060 --> 00:00:45.840 align:middle line:84%
for and identifying user
credentials or passwords that

00:00:45.840 --> 00:00:48.930 align:middle line:84%
have been stored in the
unattended Windows Setup

00:00:48.930 --> 00:00:51.480 align:middle line:90%
Utility Configuration Files.

00:00:51.480 --> 00:00:55.440 align:middle line:84%
So Windows can automate a
variety of repetitive tasks,

00:00:55.440 --> 00:00:58.950 align:middle line:84%
such as the mass rollout
or installation of Windows

00:00:58.950 --> 00:01:01.900 align:middle line:84%
on many systems or
multiple systems.

00:01:01.900 --> 00:01:05.040 align:middle line:84%
So if you've ever been a
system administrator before,

00:01:05.040 --> 00:01:08.220 align:middle line:84%
and you've been tasked
with installing Windows

00:01:08.220 --> 00:01:11.610 align:middle line:84%
on more than two
systems, maybe 10 or 15,

00:01:11.610 --> 00:01:13.650 align:middle line:84%
this can be quite
tedious in regards

00:01:13.650 --> 00:01:17.370 align:middle line:84%
to configuring each of these
systems based on the company's

00:01:17.370 --> 00:01:20.430 align:middle line:84%
security policy or based
on the configurations

00:01:20.430 --> 00:01:23.130 align:middle line:84%
that you'd like to implement
on these Windows systems.

00:01:23.130 --> 00:01:25.530 align:middle line:84%
Now, this process
can be automated

00:01:25.530 --> 00:01:29.400 align:middle line:84%
through the use of an unattended
Windows Setup Utility, which

00:01:29.400 --> 00:01:32.550 align:middle line:84%
again is used to automate the
mass installation or deployment

00:01:32.550 --> 00:01:34.870 align:middle line:90%
of Windows on multiple systems.

00:01:34.870 --> 00:01:37.740 align:middle line:84%
So this tool utilizes
configuration files

00:01:37.740 --> 00:01:40.830 align:middle line:84%
that contain specific
configurations and user account

00:01:40.830 --> 00:01:43.920 align:middle line:84%
credentials, specifically
the administrator's account

00:01:43.920 --> 00:01:44.500 align:middle line:90%
password.

00:01:44.500 --> 00:01:48.150 align:middle line:84%
So if I wanted to automate
the process of installing

00:01:48.150 --> 00:01:51.990 align:middle line:84%
or deploying Windows on more
than two or five systems

00:01:51.990 --> 00:01:55.350 align:middle line:84%
automatically, I can use
the unattended Windows Setup

00:01:55.350 --> 00:01:56.160 align:middle line:90%
Utility.

00:01:56.160 --> 00:01:58.860 align:middle line:84%
Now the unattended
Windows Setup Utility

00:01:58.860 --> 00:02:01.410 align:middle line:84%
requires configuration
files that

00:02:01.410 --> 00:02:04.860 align:middle line:84%
will contain the specifics
of the configuration

00:02:04.860 --> 00:02:07.260 align:middle line:84%
or the different
configurations that you'd

00:02:07.260 --> 00:02:10.350 align:middle line:84%
like to perform on
the Windows systems

00:02:10.350 --> 00:02:14.580 align:middle line:84%
that you're essentially
installing or mass installing.

00:02:14.580 --> 00:02:17.010 align:middle line:84%
And one of these
configurations is

00:02:17.010 --> 00:02:19.440 align:middle line:84%
going to be the
administrator password.

00:02:19.440 --> 00:02:22.590 align:middle line:84%
So within this these
configuration files,

00:02:22.590 --> 00:02:25.080 align:middle line:84%
you can specify the
administrator's password

00:02:25.080 --> 00:02:27.750 align:middle line:84%
that you want configured
on these Windows systems,

00:02:27.750 --> 00:02:31.380 align:middle line:84%
as well as any other user
account username and password

00:02:31.380 --> 00:02:34.540 align:middle line:84%
that you'd like to create
during the installation process.

00:02:34.540 --> 00:02:37.950 align:middle line:84%
So if the unattended Window
Setup configuration files

00:02:37.950 --> 00:02:40.800 align:middle line:84%
are left on the target
systems after installation,

00:02:40.800 --> 00:02:42.990 align:middle line:84%
they can reveal user
account credentials

00:02:42.990 --> 00:02:45.610 align:middle line:84%
that can be used by attackers
to authenticate with the Windows

00:02:45.610 --> 00:02:46.980 align:middle line:90%
target legitimately.

00:02:46.980 --> 00:02:50.820 align:middle line:84%
So after you utilize the
unattended Windows Setup

00:02:50.820 --> 00:02:54.610 align:middle line:84%
Utility to install Windows
on more than one system,

00:02:54.610 --> 00:02:57.300 align:middle line:84%
you actually need to manually
go to each of these systems

00:02:57.300 --> 00:02:59.280 align:middle line:84%
and delete these
configuration files.

00:02:59.280 --> 00:03:02.730 align:middle line:84%
Because if they're left over,
then if an attacker gains

00:03:02.730 --> 00:03:05.100 align:middle line:84%
access to a system, they
can find these files

00:03:05.100 --> 00:03:06.990 align:middle line:84%
and find the
credentials within them

00:03:06.990 --> 00:03:11.400 align:middle line:84%
and utilize these credentials to
either elevate their privileges

00:03:11.400 --> 00:03:14.640 align:middle line:84%
to an administrator
account or to utilize

00:03:14.640 --> 00:03:17.550 align:middle line:84%
these credentials to
legitimately authenticate

00:03:17.550 --> 00:03:19.410 align:middle line:84%
with the system
whenever they want.

00:03:19.410 --> 00:03:21.150 align:middle line:84%
And of course, this
is very important,

00:03:21.150 --> 00:03:22.920 align:middle line:84%
because then an
attacker will not

00:03:22.920 --> 00:03:26.460 align:middle line:84%
need to exploit a service in
order to gain access again.

00:03:26.460 --> 00:03:28.590 align:middle line:84%
They can simply use the
credentials and gain

00:03:28.590 --> 00:03:33.730 align:middle line:84%
access via PsExec or via
RDP, et cetera, et cetera.

00:03:33.730 --> 00:03:38.280 align:middle line:84%
So in terms of the unattended
Windows Setup Utility,

00:03:38.280 --> 00:03:40.170 align:middle line:84%
the utility will
typically utilize

00:03:40.170 --> 00:03:41.760 align:middle line:84%
one of the following
configuration

00:03:41.760 --> 00:03:44.490 align:middle line:84%
files that contains user
account and system configuration

00:03:44.490 --> 00:03:45.390 align:middle line:90%
information.

00:03:45.390 --> 00:03:47.880 align:middle line:84%
And it can be found within
the following directories

00:03:47.880 --> 00:03:51.120 align:middle line:84%
on a Windows system
now this will depend on

00:03:51.120 --> 00:03:54.160 align:middle line:84%
the version of Windows
that was installed,

00:03:54.160 --> 00:03:56.290 align:middle line:84%
as well as the
configuration itself.

00:03:56.290 --> 00:04:01.050 align:middle line:84%
So you'll typically find the
unattended.xml configuration

00:04:01.050 --> 00:04:04.380 align:middle line:84%
file within the Windows
directory under the C drive

00:04:04.380 --> 00:04:07.200 align:middle line:84%
under a directory called
Panther, and then the file,

00:04:07.200 --> 00:04:10.590 align:middle line:84%
it will either be just
within that directory

00:04:10.590 --> 00:04:14.875 align:middle line:84%
or it will be under a
subdirectory called unattend.

00:04:14.875 --> 00:04:16.500 align:middle line:84%
So you're typically
going to be looking

00:04:16.500 --> 00:04:19.290 align:middle line:90%
for the unattend.xml file.

00:04:19.290 --> 00:04:22.980 align:middle line:84%
You will also find it
under Windows Panther

00:04:22.980 --> 00:04:25.500 align:middle line:90%
Autounattend.xml in some cases.

00:04:25.500 --> 00:04:27.360 align:middle line:90%
But you will typically find it--

00:04:27.360 --> 00:04:31.740 align:middle line:84%
or the name of the file will
typically be unattend.xml.

00:04:31.740 --> 00:04:34.710 align:middle line:84%
Now as a security
precaution, the password

00:04:34.710 --> 00:04:37.920 align:middle line:84%
stored in the unattended
Windows Setup Configuration file

00:04:37.920 --> 00:04:41.610 align:middle line:84%
may be encoded in base64,
which really isn't

00:04:41.610 --> 00:04:43.260 align:middle line:90%
a deterrent for an attacker.

00:04:43.260 --> 00:04:47.740 align:middle line:84%
Because you can easily decode
the base64 encoded password.

00:04:47.740 --> 00:04:50.610 align:middle line:84%
And again, I just wanted to
make that as clear as possible,

00:04:50.610 --> 00:04:53.370 align:middle line:84%
so that you understand
that even if you

00:04:53.370 --> 00:04:57.600 align:middle line:84%
find a password within
the unattend.xml file,

00:04:57.600 --> 00:04:59.730 align:middle line:90%
it might be encoded in base64.

00:04:59.730 --> 00:05:02.760 align:middle line:84%
So it's always recommended
to try and decode it,

00:05:02.760 --> 00:05:04.870 align:middle line:84%
and then you lays it
for authentication

00:05:04.870 --> 00:05:06.820 align:middle line:90%
with the Windows target.

00:05:06.820 --> 00:05:09.490 align:middle line:84%
All right, so the
lab environment

00:05:09.490 --> 00:05:12.220 align:middle line:84%
attached to this
video has been set up

00:05:12.220 --> 00:05:15.040 align:middle line:84%
to demonstrate this
particular vulnerability

00:05:15.040 --> 00:05:17.680 align:middle line:84%
or how this vulnerability
can be exploited.

00:05:17.680 --> 00:05:20.470 align:middle line:84%
And all you need to do is just
fire up the lab environment,

00:05:20.470 --> 00:05:22.070 align:middle line:90%
and we can get started.

00:05:22.070 --> 00:05:26.700 align:middle line:84%
So I'll see you within
the lab environment.

00:05:26.700 --> 00:05:28.860 align:middle line:84%
All right, so I'm back
within the lab environment.

00:05:28.860 --> 00:05:33.690 align:middle line:84%
And this lab environment will
provide you with the target IP

00:05:33.690 --> 00:05:34.840 align:middle line:90%
address right over here.

00:05:34.840 --> 00:05:37.570 align:middle line:84%
However, in order to
gain access to it,

00:05:37.570 --> 00:05:39.300 align:middle line:84%
you will be provided
with the attacker

00:05:39.300 --> 00:05:41.293 align:middle line:84%
machine or the victim's
system that you're

00:05:41.293 --> 00:05:42.210 align:middle line:90%
going to be attacking.

00:05:42.210 --> 00:05:45.780 align:middle line:84%
So it provides you with
access to the Windows target

00:05:45.780 --> 00:05:48.180 align:middle line:84%
that we will be
essentially exploiting.

00:05:48.180 --> 00:05:53.280 align:middle line:84%
So you can utilize the
session on the attacker system

00:05:53.280 --> 00:05:55.110 align:middle line:84%
or either the victim
system in order

00:05:55.110 --> 00:05:57.360 align:middle line:84%
to perform the techniques
that I'm about to highlight.

00:05:57.360 --> 00:06:02.400 align:middle line:84%
So you can manually look for
the unattend.xml file yourself.

00:06:02.400 --> 00:06:05.910 align:middle line:84%
However, we are going to be
following the typical approach

00:06:05.910 --> 00:06:06.700 align:middle line:90%
of an attacker.

00:06:06.700 --> 00:06:10.020 align:middle line:84%
So we are going to gain initial
access to this target system

00:06:10.020 --> 00:06:12.120 align:middle line:84%
and obtain an
Meterpreter session.

00:06:12.120 --> 00:06:14.820 align:middle line:84%
After which, we will then
use our Meterpreter session

00:06:14.820 --> 00:06:18.990 align:middle line:84%
to find the unattend.xml
file, identify the password,

00:06:18.990 --> 00:06:23.730 align:middle line:84%
and then decode it with
the base64 utility,

00:06:23.730 --> 00:06:26.850 align:middle line:84%
and then authenticate with
the target via PsExec.

00:06:26.850 --> 00:06:29.790 align:middle line:84%
All right, so once
again, you can

00:06:29.790 --> 00:06:33.720 align:middle line:84%
utilize the access that has
been given to you on the victim

00:06:33.720 --> 00:06:35.430 align:middle line:90%
system if you want.

00:06:35.430 --> 00:06:37.170 align:middle line:84%
What we're going
to do firstly is

00:06:37.170 --> 00:06:40.300 align:middle line:84%
I'll just switch back to my
Kali machine right over here.

00:06:40.300 --> 00:06:43.150 align:middle line:84%
And in order to gain access
to the target system,

00:06:43.150 --> 00:06:45.060 align:middle line:84%
I'm just going to
generate a Meterpreter

00:06:45.060 --> 00:06:46.620 align:middle line:90%
payload with MSFvenom.

00:06:46.620 --> 00:06:48.930 align:middle line:84%
So I'm just going to
open up a terminal.

00:06:48.930 --> 00:06:51.180 align:middle line:84%
And within the
current directory,

00:06:51.180 --> 00:06:54.060 align:middle line:90%
I'm just going to say MSFvenom.

00:06:54.060 --> 00:06:56.610 align:middle line:84%
And because the target
system is running

00:06:56.610 --> 00:07:00.240 align:middle line:84%
a 64-bit version
of Windows Server,

00:07:00.240 --> 00:07:01.800 align:middle line:84%
you can see it's
Windows Server here.

00:07:01.800 --> 00:07:05.650 align:middle line:84%
And we currently have access
to an unprivileged user.

00:07:05.650 --> 00:07:07.950 align:middle line:84%
So if I can search for
CMD here, let me just

00:07:07.950 --> 00:07:10.210 align:middle line:90%
confirm that is the case.

00:07:10.210 --> 00:07:12.180 align:middle line:84%
It's just taking a few
seconds, because this

00:07:12.180 --> 00:07:13.590 align:middle line:90%
is running in the cloud.

00:07:13.590 --> 00:07:15.390 align:middle line:90%
So I'll just search for CMD.

00:07:15.390 --> 00:07:19.030 align:middle line:84%
And we should be able
to open up CMD there.

00:07:19.030 --> 00:07:21.480 align:middle line:90%
We also have a net user.

00:07:21.480 --> 00:07:24.990 align:middle line:84%
You can see, we're currently
utilizing the student account

00:07:24.990 --> 00:07:27.330 align:middle line:84%
right of here, which is
an unprivileged user.

00:07:27.330 --> 00:07:31.310 align:middle line:90%
So I can say whoami and privs.

00:07:31.310 --> 00:07:34.248 align:middle line:90%
And sorry, that is whoami/priv.

00:07:34.248 --> 00:07:34.790 align:middle line:90%
There we are.

00:07:34.790 --> 00:07:37.700 align:middle line:84%
You can see these are our
privileges right over here.

00:07:37.700 --> 00:07:42.150 align:middle line:84%
And this user is really not
a privileged account at all.

00:07:42.150 --> 00:07:45.170 align:middle line:84%
So what I'll do is I'll go
back to my Kali machine,

00:07:45.170 --> 00:07:46.940 align:middle line:84%
and we'll generate
a payload for--

00:07:46.940 --> 00:07:49.580 align:middle line:84%
we'll generate a
Meterpreter payload.

00:07:49.580 --> 00:07:53.960 align:middle line:84%
And in this case, we'll say this
is an x64, 64-bit Meterpreter

00:07:53.960 --> 00:07:55.280 align:middle line:90%
payload, so there we are.

00:07:55.280 --> 00:07:58.880 align:middle line:84%
Windows x64 interpreter, and
we'll use a staged payload,

00:07:58.880 --> 00:08:00.350 align:middle line:90%
so reverse TCP.

00:08:00.350 --> 00:08:03.300 align:middle line:84%
I'll then need to specify
my Kali Linux IP address.

00:08:03.300 --> 00:08:08.270 align:middle line:84%
So I'll open up a new tab,
and I'll say ifconfig.

00:08:08.270 --> 00:08:09.800 align:middle line:90%
Let me type that in correctly.

00:08:09.800 --> 00:08:12.320 align:middle line:84%
And I'm looking for
the IP address attached

00:08:12.320 --> 00:08:14.255 align:middle line:90%
to the interface ethernet1.

00:08:14.255 --> 00:08:17.060 align:middle line:84%
And of course in your case,
that's going to be different.

00:08:17.060 --> 00:08:20.120 align:middle line:84%
And I'll specify that
there and the LPORT we

00:08:20.120 --> 00:08:22.520 align:middle line:90%
will use in this case is 1234.

00:08:22.520 --> 00:08:25.400 align:middle line:84%
And the format is exe,
and we will output that

00:08:25.400 --> 00:08:27.740 align:middle line:90%
into a file called payload.exe.

00:08:27.740 --> 00:08:29.900 align:middle line:84%
So I'll hit enter
and MSFvenom will

00:08:29.900 --> 00:08:32.144 align:middle line:90%
generate the payload for me.

00:08:32.144 --> 00:08:33.769 align:middle line:84%
So we'll give that
a couple of seconds.

00:08:33.769 --> 00:08:36.850 align:middle line:90%


00:08:36.850 --> 00:08:38.710 align:middle line:84%
All right, there we
are, so it's generated.

00:08:38.710 --> 00:08:41.020 align:middle line:84%
I'm now going to set
up a simple web server

00:08:41.020 --> 00:08:45.670 align:middle line:84%
to host the payload.exe file
with the python module simple

00:08:45.670 --> 00:08:47.090 align:middle line:90%
HTTP server.

00:08:47.090 --> 00:08:50.650 align:middle line:84%
So I'll say python-m
SimpleHTTPServer.

00:08:50.650 --> 00:08:54.650 align:middle line:84%
And I'll host it on port
80 or run it on port 80.

00:08:54.650 --> 00:08:57.670 align:middle line:84%
So we can now download
the payload.exe file

00:08:57.670 --> 00:09:01.270 align:middle line:84%
onto the target system by
accessing the Kali Linux IP

00:09:01.270 --> 00:09:06.550 align:middle line:84%
address or the web server that's
being hosted on the Kali Linux

00:09:06.550 --> 00:09:08.050 align:middle line:90%
system on port 80.

00:09:08.050 --> 00:09:10.330 align:middle line:84%
And the name of the
file is payload.exe.

00:09:10.330 --> 00:09:14.890 align:middle line:84%
So how do we transfer it
over to the victim system

00:09:14.890 --> 00:09:16.030 align:middle line:90%
or to the target system?

00:09:16.030 --> 00:09:20.290 align:middle line:84%
Well, we'll just open up our
access on the victim system.

00:09:20.290 --> 00:09:22.780 align:middle line:84%
And we'll open up
the CMD session here

00:09:22.780 --> 00:09:25.300 align:middle line:84%
or a command prompt,
and let me just

00:09:25.300 --> 00:09:27.500 align:middle line:84%
zoom in so you can see
what's going on here.

00:09:27.500 --> 00:09:30.280 align:middle line:84%
So I'll just go into
properties and font.

00:09:30.280 --> 00:09:34.128 align:middle line:84%
And we should be able
to get access to that.

00:09:34.128 --> 00:09:34.670 align:middle line:90%
There we are.

00:09:34.670 --> 00:09:37.450 align:middle line:84%
And I'll increase
the font size to 24.

00:09:37.450 --> 00:09:38.170 align:middle line:90%
Fantastic.

00:09:38.170 --> 00:09:40.090 align:middle line:84%
So I'll navigate
onto the desktop.

00:09:40.090 --> 00:09:43.270 align:middle line:84%
And of course, this is just
for demonstration purposes.

00:09:43.270 --> 00:09:45.250 align:middle line:84%
Ideally, you would
be gaining access

00:09:45.250 --> 00:09:47.680 align:middle line:84%
to this target
system via an exploit

00:09:47.680 --> 00:09:50.890 align:middle line:84%
or by exploiting a
vulnerability in a service.

00:09:50.890 --> 00:09:53.410 align:middle line:84%
I'll now utilize
the certutil utility

00:09:53.410 --> 00:09:55.520 align:middle line:84%
to download the payload
from the target.

00:09:55.520 --> 00:09:57.940 align:middle line:84%
So this is an in-built
Windows Utility

00:09:57.940 --> 00:10:01.060 align:middle line:84%
that can be used to download
files from a web server.

00:10:01.060 --> 00:10:03.820 align:middle line:90%
So I'll say certutil-urlcache.

00:10:03.820 --> 00:10:05.380 align:middle line:90%
And we're downloading a file.

00:10:05.380 --> 00:10:08.140 align:middle line:84%
I'll then specify the
IP address of the web

00:10:08.140 --> 00:10:12.560 align:middle line:84%
server, which is running
on the Kali Linux system.

00:10:12.560 --> 00:10:13.250 align:middle line:90%
So there we are.

00:10:13.250 --> 00:10:15.490 align:middle line:84%
That's the IP address of
the Kali Linux system.

00:10:15.490 --> 00:10:18.070 align:middle line:84%
And the name of the
file is payload.exe,

00:10:18.070 --> 00:10:21.890 align:middle line:90%
and I'll save it as payload.exe.

00:10:21.890 --> 00:10:23.670 align:middle line:84%
All right, so that
completes successfully.

00:10:23.670 --> 00:10:25.545 align:middle line:84%
And if we check our
desktop, we have the file

00:10:25.545 --> 00:10:26.900 align:middle line:90%
downloaded successfully.

00:10:26.900 --> 00:10:29.150 align:middle line:84%
Before we execute it, I'm
just going to head back

00:10:29.150 --> 00:10:31.490 align:middle line:90%
into my Kali Linux system here.

00:10:31.490 --> 00:10:33.440 align:middle line:84%
And I'll shut down
the web server,

00:10:33.440 --> 00:10:36.950 align:middle line:84%
and we'll start up MSFconsole
and set up the multi/handler.

00:10:36.950 --> 00:10:41.790 align:middle line:84%
So I'll say service postgresql
start and MSFconsole.

00:10:41.790 --> 00:10:42.690 align:middle line:90%
There we are.

00:10:42.690 --> 00:10:45.960 align:middle line:84%
Give that a couple of
seconds to start up.

00:10:45.960 --> 00:10:48.450 align:middle line:84%
And of course, you can
also create a Metasploit RC

00:10:48.450 --> 00:10:52.050 align:middle line:84%
script to automate the process
of setting up the handler.

00:10:52.050 --> 00:10:53.970 align:middle line:90%
So we'll say use multi/handler.

00:10:53.970 --> 00:10:57.770 align:middle line:90%


00:10:57.770 --> 00:10:59.540 align:middle line:84%
And we'll set the
payload to the one

00:10:59.540 --> 00:11:02.300 align:middle line:84%
we used when generating
the payload with MSFvenom.

00:11:02.300 --> 00:11:04.895 align:middle line:84%
So payload is a
windows/x64/meterpreter/reverse

00:11:04.895 --> 00:11:06.350 align:middle line:90%
tcp.

00:11:06.350 --> 00:11:08.930 align:middle line:90%


00:11:08.930 --> 00:11:10.970 align:middle line:84%
We'll then set the
LPORT to the one

00:11:10.970 --> 00:11:12.470 align:middle line:84%
that we used when
we were generating

00:11:12.470 --> 00:11:13.790 align:middle line:90%
the payload with MSFvenom.

00:11:13.790 --> 00:11:15.620 align:middle line:90%
In this case, it's 1234.

00:11:15.620 --> 00:11:19.538 align:middle line:84%
And then, we'll set the LHOST
option to the Kali Linux IP.

00:11:19.538 --> 00:11:21.080 align:middle line:84%
There we are, and
then I can hit run.

00:11:21.080 --> 00:11:23.030 align:middle line:84%
That's going to start
the reverse TCP handler.

00:11:23.030 --> 00:11:26.660 align:middle line:84%
So now when I execute the
payload on the target system

00:11:26.660 --> 00:11:29.450 align:middle line:84%
like so, I will get a
Meterpreter session.

00:11:29.450 --> 00:11:31.980 align:middle line:84%
There we are, you can see
Meterpreter session one open.

00:11:31.980 --> 00:11:33.920 align:middle line:84%
So I'll just clear up
the terminal there.

00:11:33.920 --> 00:11:36.020 align:middle line:90%
And I can now say sysinfo.

00:11:36.020 --> 00:11:39.440 align:middle line:84%
You can see the target is
running Windows Server 2016,

00:11:39.440 --> 00:11:42.090 align:middle line:84%
and we have a 64-bit
Meterpreter payload.

00:11:42.090 --> 00:11:46.860 align:middle line:84%
So we can manually search
for the unattend.xml file.

00:11:46.860 --> 00:11:48.560 align:middle line:90%
So again, if we utilize--

00:11:48.560 --> 00:11:50.450 align:middle line:84%
we can utilize the
search utility,

00:11:50.450 --> 00:11:53.610 align:middle line:84%
the inbuilt Meterpreter
search utility.

00:11:53.610 --> 00:11:56.300 align:middle line:84%
So I can say if I
just type in search,

00:11:56.300 --> 00:11:59.480 align:middle line:84%
it'll provide you with a
documentation regarding

00:11:59.480 --> 00:12:00.450 align:middle line:90%
how you can use this.

00:12:00.450 --> 00:12:02.960 align:middle line:84%
So we can search for--
we can say search.

00:12:02.960 --> 00:12:06.050 align:middle line:84%
And we are looking
for file, and we

00:12:06.050 --> 00:12:08.570 align:middle line:90%
can say this is unattend.xml.

00:12:08.570 --> 00:12:11.490 align:middle line:84%
And let's see whether we're
able to identify this way.

00:12:11.490 --> 00:12:13.580 align:middle line:84%
So we'll give this
a couple of seconds.

00:12:13.580 --> 00:12:15.860 align:middle line:84%
And of course, it's much
easier to do this manually.

00:12:15.860 --> 00:12:19.760 align:middle line:84%
But again, this is a technique
that you can utilize.

00:12:19.760 --> 00:12:23.030 align:middle line:84%
Because we already know where
this is likely to be stored,

00:12:23.030 --> 00:12:25.410 align:middle line:84%
we can just search
for it manually.

00:12:25.410 --> 00:12:28.430 align:middle line:84%
So what we can do is just
terminate that search.

00:12:28.430 --> 00:12:31.170 align:middle line:84%
And we can head over into
the root of the C drive.

00:12:31.170 --> 00:12:36.590 align:middle line:84%
And on the Windows and on
the Panther, which exists,

00:12:36.590 --> 00:12:38.230 align:middle line:84%
which means there
is or there could

00:12:38.230 --> 00:12:41.270 align:middle line:84%
be the unattend.xml
file on this system.

00:12:41.270 --> 00:12:43.930 align:middle line:84%
So if we type in
dir, you can see

00:12:43.930 --> 00:12:47.530 align:middle line:84%
that we have the
unattend.xml right over here.

00:12:47.530 --> 00:12:50.000 align:middle line:84%
And that looks like
it has a bit of data.

00:12:50.000 --> 00:12:52.070 align:middle line:84%
So we can download
this onto our system.

00:12:52.070 --> 00:12:54.510 align:middle line:84%
So I'm going to say
download unattend.xml.

00:12:54.510 --> 00:12:57.610 align:middle line:90%


00:12:57.610 --> 00:12:58.220 align:middle line:90%
There we go.

00:12:58.220 --> 00:13:00.220 align:middle line:84%
And I'll just go
into a new tab here.

00:13:00.220 --> 00:13:03.190 align:middle line:84%
And I currently have the file
downloaded, so that we are.

00:13:03.190 --> 00:13:06.880 align:middle line:84%
And I can just cut out the
content of unattend.xml.

00:13:06.880 --> 00:13:09.400 align:middle line:84%
And if we take a look
at the configuration,

00:13:09.400 --> 00:13:11.110 align:middle line:84%
you can see it just
contains information

00:13:11.110 --> 00:13:13.690 align:middle line:84%
pertinent to the
installation of Windows.

00:13:13.690 --> 00:13:16.160 align:middle line:84%
So for example, you
can see that user data.

00:13:16.160 --> 00:13:19.720 align:middle line:84%
The product key will
show you why always.

00:13:19.720 --> 00:13:22.150 align:middle line:84%
And we're looking for
the user credentials

00:13:22.150 --> 00:13:26.360 align:middle line:84%
here that have been set up for
this particular Windows system.

00:13:26.360 --> 00:13:28.790 align:middle line:84%
And if we scroll right
over here to the bottom,

00:13:28.790 --> 00:13:31.960 align:middle line:84%
you can see we have the
AutoLogon configuration,

00:13:31.960 --> 00:13:35.110 align:middle line:84%
whereby the username
has been configured

00:13:35.110 --> 00:13:38.320 align:middle line:84%
to administrator and the
password right over here.

00:13:38.320 --> 00:13:42.010 align:middle line:84%
You can see the value
there is encoded in base64.

00:13:42.010 --> 00:13:46.930 align:middle line:84%
And I'm able to deduce that
because the plaintext option is

00:13:46.930 --> 00:13:47.840 align:middle line:90%
set to false.

00:13:47.840 --> 00:13:50.710 align:middle line:84%
So that is going to
be encoded in base64.

00:13:50.710 --> 00:13:54.310 align:middle line:84%
So I can copy the password
that has been encoded in base64

00:13:54.310 --> 00:13:56.270 align:middle line:84%
and I can create
a new file here.

00:13:56.270 --> 00:13:59.920 align:middle line:84%
And I'll just call
this password.txt.

00:13:59.920 --> 00:14:04.390 align:middle line:84%
And I'll use Vim and paste in
the base64 encoded password.

00:14:04.390 --> 00:14:05.620 align:middle line:90%
And I'll write and quit.

00:14:05.620 --> 00:14:08.650 align:middle line:84%
And we can now utilize
the base64 tool

00:14:08.650 --> 00:14:12.220 align:middle line:84%
that comes pre-packaged
on Kali Linux, so base64.

00:14:12.220 --> 00:14:16.390 align:middle line:84%
And I can use the D option to
decode that password.txt file.

00:14:16.390 --> 00:14:19.120 align:middle line:84%
There we are, and then I can
output it into another file

00:14:19.120 --> 00:14:20.620 align:middle line:90%
or I can just hit enter.

00:14:20.620 --> 00:14:23.740 align:middle line:84%
And you can see we get the
base64 decoded password.

00:14:23.740 --> 00:14:27.940 align:middle line:84%
In this case, the password for
the administrator is Admin@123.

00:14:27.940 --> 00:14:28.960 align:middle line:90%
Fantastic!

00:14:28.960 --> 00:14:32.320 align:middle line:84%
So we've been able to obtain
the administrator's credentials.

00:14:32.320 --> 00:14:35.200 align:middle line:84%
However, in some
cases, you may find

00:14:35.200 --> 00:14:37.630 align:middle line:84%
that the administrator
has changed the password

00:14:37.630 --> 00:14:38.900 align:middle line:90%
after installation.

00:14:38.900 --> 00:14:42.020 align:middle line:84%
So this may not
be valid anymore.

00:14:42.020 --> 00:14:44.230 align:middle line:84%
However, in this case,
we can test this out

00:14:44.230 --> 00:14:46.570 align:middle line:84%
through the use of
the PsExec Python

00:14:46.570 --> 00:14:48.640 align:middle line:84%
script, which I've
already covered

00:14:48.640 --> 00:14:49.760 align:middle line:90%
how to use in this course.

00:14:49.760 --> 00:14:52.660 align:middle line:90%
So we can say psexec.py.

00:14:52.660 --> 00:14:55.030 align:middle line:84%
And in order to utilize
it, we can simply

00:14:55.030 --> 00:14:57.610 align:middle line:84%
say we want to log
in as administrator.

00:14:57.610 --> 00:15:00.250 align:middle line:90%
And we specify the target IP.

00:15:00.250 --> 00:15:05.800 align:middle line:84%
So what I'll do here is we can
just paste in the target IP

00:15:05.800 --> 00:15:08.260 align:middle line:90%
right over there.

00:15:08.260 --> 00:15:11.380 align:middle line:90%
And we can hit enter.

00:15:11.380 --> 00:15:12.910 align:middle line:84%
And I can then
provide the password

00:15:12.910 --> 00:15:17.440 align:middle line:84%
that we were able to
decode, which is admin@123.

00:15:17.440 --> 00:15:18.210 align:middle line:90%
Hit enter.

00:15:18.210 --> 00:15:21.820 align:middle line:84%
Looks like I've typed
it in incorrectly.

00:15:21.820 --> 00:15:24.040 align:middle line:84%
So let me just cut
out the contents of--

00:15:24.040 --> 00:15:26.840 align:middle line:84%
or we can just run the
base64 command again.

00:15:26.840 --> 00:15:29.470 align:middle line:84%
Let me make sure I
copy that correctly.

00:15:29.470 --> 00:15:32.530 align:middle line:84%
So I'll just copy that, then and
we can run the psexec command

00:15:32.530 --> 00:15:33.640 align:middle line:90%
again.

00:15:33.640 --> 00:15:35.470 align:middle line:90%
And I'll paste in the password.

00:15:35.470 --> 00:15:43.710 align:middle line:84%
And it looks like we're not
able to log in successfully.

00:15:43.710 --> 00:15:46.450 align:middle line:90%
Am I typing in--

00:15:46.450 --> 00:15:48.790 align:middle line:84%
yeah, I'm typing in
the actual username

00:15:48.790 --> 00:15:51.880 align:middle line:90%
incorrectly, so administrator.

00:15:51.880 --> 00:15:52.900 align:middle line:90%
There we are.

00:15:52.900 --> 00:15:54.220 align:middle line:90%
Hit enter.

00:15:54.220 --> 00:15:55.570 align:middle line:90%
Paste that in there.

00:15:55.570 --> 00:15:58.420 align:middle line:84%
And we should get a command
shell session, and we do.

00:15:58.420 --> 00:16:00.910 align:middle line:90%
So I can say whoami.

00:16:00.910 --> 00:16:02.380 align:middle line:90%
Nt authority system.

00:16:02.380 --> 00:16:03.070 align:middle line:90%
Fantastic.

00:16:03.070 --> 00:16:06.040 align:middle line:84%
So I've been able to gain
access to the target system

00:16:06.040 --> 00:16:09.040 align:middle line:84%
by of course finding a
legitimate administrator

00:16:09.040 --> 00:16:12.820 align:middle line:84%
password within a Windows
configuration file,

00:16:12.820 --> 00:16:16.920 align:middle line:84%
more specifically the unattended
set up utilities configuration

00:16:16.920 --> 00:16:17.420 align:middle line:90%
file.

00:16:17.420 --> 00:16:20.020 align:middle line:84%
So you can see that this
is a huge vulnerability.

00:16:20.020 --> 00:16:25.270 align:middle line:84%
And it's something that you
will actually find in the wild.

00:16:25.270 --> 00:16:29.290 align:middle line:84%
Because again, in networks that
have a large amount of window

00:16:29.290 --> 00:16:32.860 align:middle line:84%
systems, the unattended set
up utility is frequently used.

00:16:32.860 --> 00:16:35.080 align:middle line:84%
And in some cases,
administrators

00:16:35.080 --> 00:16:38.500 align:middle line:84%
may actually forget to delete
those configuration files.

00:16:38.500 --> 00:16:41.500 align:middle line:84%
And if that is the case, if an
attacker is able to gain access

00:16:41.500 --> 00:16:45.070 align:middle line:84%
to the system even though
they have unprivileged access,

00:16:45.070 --> 00:16:48.610 align:middle line:84%
they can still obtain the
actual contents of that file

00:16:48.610 --> 00:16:51.490 align:middle line:84%
or download the file
outrightly, and then

00:16:51.490 --> 00:16:55.000 align:middle line:84%
decode the actual password and
authenticate with the target

00:16:55.000 --> 00:16:57.250 align:middle line:90%
legitimately through PsExec.

00:16:57.250 --> 00:17:00.310 align:middle line:84%
And of course, you can also
utilize the PsExec Metasploit

00:17:00.310 --> 00:17:02.440 align:middle line:84%
module to obtain an
Meterpreter session.

00:17:02.440 --> 00:17:05.650 align:middle line:84%
But in this case, I've just
used the exact Python script

00:17:05.650 --> 00:17:07.040 align:middle line:90%
to do this manually.

00:17:07.040 --> 00:17:10.240 align:middle line:84%
So that is going to conclude
the practical demonstration

00:17:10.240 --> 00:17:13.060 align:middle line:90%
side of this video.

00:17:13.060 --> 00:17:15.150 align:middle line:84%
In the next video,
we will be exploring

00:17:15.150 --> 00:17:19.380 align:middle line:84%
the process of dumping
NTLM hashes from memory

00:17:19.380 --> 00:17:20.490 align:middle line:90%
with Mimikatz.

00:17:20.490 --> 00:17:24.139 align:middle line:84%
So I'll see you
in the next video.

00:17:24.139 --> 00:17:25.000 align:middle line:90%