WEBVTT

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


00:00:10.140 --> 00:00:14.670 align:middle line:84%
Windows Privilege Escalation:
Bypassing UAC, also known

00:00:14.670 --> 00:00:16.920 align:middle line:90%
as User Access Control.

00:00:16.920 --> 00:00:18.990 align:middle line:84%
In this video, we
will be exploring

00:00:18.990 --> 00:00:21.060 align:middle line:84%
the process of
utilizing the Metasploit

00:00:21.060 --> 00:00:25.420 align:middle line:84%
framework to essentially elevate
our privileges on a Windows

00:00:25.420 --> 00:00:25.920 align:middle line:90%
target.

00:00:25.920 --> 00:00:28.290 align:middle line:84%
And the technique
we will be utilizing

00:00:28.290 --> 00:00:31.060 align:middle line:90%
is the Bypass UAC technique.

00:00:31.060 --> 00:00:31.560 align:middle line:90%
All right?

00:00:31.560 --> 00:00:36.480 align:middle line:84%
So let's learn a little bit
more about what UAC is, right?

00:00:36.480 --> 00:00:40.860 align:middle line:84%
So UAC stands for
User Access Control.

00:00:40.860 --> 00:00:44.310 align:middle line:84%
So UAC is essentially a
Windows security feature

00:00:44.310 --> 00:00:47.280 align:middle line:84%
that was introduced
in Windows Vista that

00:00:47.280 --> 00:00:49.710 align:middle line:84%
is used to prevent
unauthorized changes from being

00:00:49.710 --> 00:00:51.640 align:middle line:90%
made to the operating system.

00:00:51.640 --> 00:00:54.930 align:middle line:84%
So if you've used any modern
Windows operating system,

00:00:54.930 --> 00:00:57.210 align:middle line:84%
you should be familiar
with what UAC is.

00:00:57.210 --> 00:01:02.040 align:middle line:84%
So whenever you try and
perform any action that again,

00:01:02.040 --> 00:01:04.349 align:middle line:84%
requires administrative
privileges--

00:01:04.349 --> 00:01:08.550 align:middle line:84%
sort of like opening a Windows
command prompt as administrator

00:01:08.550 --> 00:01:10.900 align:middle line:90%
or installing a new program--

00:01:10.900 --> 00:01:13.170 align:middle line:84%
you will be prompted
with the UAC

00:01:13.170 --> 00:01:16.140 align:middle line:84%
prompt here that essentially
asks you whether or not

00:01:16.140 --> 00:01:19.710 align:middle line:84%
you want to allow a certain
application to make changes

00:01:19.710 --> 00:01:22.050 align:middle line:84%
to a device or to this
particular device.

00:01:22.050 --> 00:01:24.270 align:middle line:84%
And then you can
either say Yes or No.

00:01:24.270 --> 00:01:31.330 align:middle line:84%
Now, if you are a standard
user and not an administrator--

00:01:31.330 --> 00:01:33.900 align:middle line:84%
once you hit Yes,
you will be required

00:01:33.900 --> 00:01:35.700 align:middle line:84%
to provide the
administrator password

00:01:35.700 --> 00:01:38.580 align:middle line:84%
or you essentially need to
provide the administrator

00:01:38.580 --> 00:01:42.570 align:middle line:84%
password in order to, again,
allow a certain application

00:01:42.570 --> 00:01:45.480 align:middle line:84%
to make changes to
your operating system

00:01:45.480 --> 00:01:47.650 align:middle line:90%
or to that particular device.

00:01:47.650 --> 00:01:50.160 align:middle line:84%
So UAC is essentially
used to ensure

00:01:50.160 --> 00:01:52.020 align:middle line:84%
that changes to the
operating system

00:01:52.020 --> 00:01:54.570 align:middle line:84%
require approval from
the administrator.

00:01:54.570 --> 00:01:56.640 align:middle line:84%
If you don't have the
administrator password

00:01:56.640 --> 00:01:58.330 align:middle line:84%
or if you're not
the administrator,

00:01:58.330 --> 00:02:00.520 align:middle line:90%
then you can't make any changes.

00:02:00.520 --> 00:02:04.140 align:middle line:84%
Now how do we bypass
UAC or how do we utilize

00:02:04.140 --> 00:02:06.600 align:middle line:90%
UAC to elevate our privileges?

00:02:06.600 --> 00:02:09.720 align:middle line:84%
Well, we can utilize the
"Windows Escalate UAC

00:02:09.720 --> 00:02:11.220 align:middle line:90%
Protection Bypass"--

00:02:11.220 --> 00:02:14.850 align:middle line:84%
and of course, that's the
In Memory Injection method

00:02:14.850 --> 00:02:15.450 align:middle line:90%
module--

00:02:15.450 --> 00:02:19.530 align:middle line:84%
to bypass UAC by utilizing the
trusted publisher certificate

00:02:19.530 --> 00:02:21.150 align:middle line:90%
through process injection.

00:02:21.150 --> 00:02:23.730 align:middle line:84%
So what this exploit
module will do

00:02:23.730 --> 00:02:26.970 align:middle line:84%
is it will essentially
bypass UAC.

00:02:26.970 --> 00:02:32.520 align:middle line:84%
And it will then consequently
spawn or actually create

00:02:32.520 --> 00:02:35.940 align:middle line:84%
a second Meterpreter
session, in our case, that

00:02:35.940 --> 00:02:39.850 align:middle line:84%
has the UAC flag turned
off or has UAC turned off,

00:02:39.850 --> 00:02:43.060 align:middle line:84%
which means within the
second Meterpreter session,

00:02:43.060 --> 00:02:45.390 align:middle line:84%
we will not have
UAC enabled at all.

00:02:45.390 --> 00:02:48.840 align:middle line:84%
Which means we can perform
administrative tasks

00:02:48.840 --> 00:02:52.530 align:middle line:84%
or we can essentially perform
what the administrator would

00:02:52.530 --> 00:02:54.810 align:middle line:84%
be able to perform
without providing

00:02:54.810 --> 00:02:56.100 align:middle line:90%
the administrative password.

00:02:56.100 --> 00:03:01.520 align:middle line:84%
And in this case, consequently,
elevate our privileges.

00:03:01.520 --> 00:03:03.842 align:middle line:84%
All right, so in
order to perform this,

00:03:03.842 --> 00:03:05.300 align:middle line:84%
you're going to
need to have access

00:03:05.300 --> 00:03:07.940 align:middle line:84%
to the target system
via a Meterpreter

00:03:07.940 --> 00:03:09.980 align:middle line:90%
session or a Meterpreter shell.

00:03:09.980 --> 00:03:12.020 align:middle line:84%
And in addition
to that, you also

00:03:12.020 --> 00:03:16.430 align:middle line:84%
must ensure that the Meterpreter
session or the Meterpreter

00:03:16.430 --> 00:03:20.750 align:middle line:84%
payload being used is the
64-bit version as opposed

00:03:20.750 --> 00:03:22.440 align:middle line:90%
to the 32-bit version.

00:03:22.440 --> 00:03:22.940 align:middle line:90%
All right?

00:03:22.940 --> 00:03:26.150 align:middle line:84%
So let's take a look at how this
can be performed within the lab

00:03:26.150 --> 00:03:26.820 align:middle line:90%
environment.

00:03:26.820 --> 00:03:28.580 align:middle line:84%
So just fire up
the lab environment

00:03:28.580 --> 00:03:32.620 align:middle line:90%
and we can get started.

00:03:32.620 --> 00:03:35.250 align:middle line:84%
All right, so I'm back
within the lab environment.

00:03:35.250 --> 00:03:38.710 align:middle line:84%
And we have the target
IP provided to us here,

00:03:38.710 --> 00:03:39.340 align:middle line:90%
which is great.

00:03:39.340 --> 00:03:42.110 align:middle line:90%
So we can copy that.

00:03:42.110 --> 00:03:44.510 align:middle line:84%
And we then need to
start up MSFconsole

00:03:44.510 --> 00:03:46.100 align:middle line:84%
But before we do
that, we actually

00:03:46.100 --> 00:03:48.992 align:middle line:84%
need to start up the
PostgreSQL database service.

00:03:48.992 --> 00:03:50.450 align:middle line:84%
So I'm just going
to zoom in so you

00:03:50.450 --> 00:03:52.140 align:middle line:90%
can see what's going on here.

00:03:52.140 --> 00:03:56.540 align:middle line:84%
So we are going to say
Service, PostgreSQL, Start.

00:03:56.540 --> 00:03:58.970 align:middle line:84%
And we're also going
to start up MSFconsole

00:03:58.970 --> 00:04:00.108 align:middle line:90%
so we can save time here.

00:04:00.108 --> 00:04:01.025 align:middle line:90%
So I'm going to Enter.

00:04:01.025 --> 00:04:04.860 align:middle line:90%


00:04:04.860 --> 00:04:07.770 align:middle line:84%
That's going to start the
PostgreSQL database server,

00:04:07.770 --> 00:04:10.860 align:middle line:84%
and it's then going to
start up MSFconsole for us.

00:04:10.860 --> 00:04:20.589 align:middle line:90%


00:04:20.589 --> 00:04:21.089 align:middle line:90%
All right.

00:04:21.089 --> 00:04:23.350 align:middle line:90%
So MSFconsole has started.

00:04:23.350 --> 00:04:26.700 align:middle line:84%
We are now going to create
a new workspace called--

00:04:26.700 --> 00:04:30.730 align:middle line:84%
we're just going to call
this a UACBypass right?

00:04:30.730 --> 00:04:33.140 align:middle line:84%
Because that's what
we're exploring.

00:04:33.140 --> 00:04:36.700 align:middle line:84%
And we also need to set up the
global variable for the RHOSTS

00:04:36.700 --> 00:04:38.980 align:middle line:84%
option, which we'll
set to the target IP

00:04:38.980 --> 00:04:43.390 align:middle line:84%
so that we don't have to keep
on typing in the target IP

00:04:43.390 --> 00:04:45.190 align:middle line:90%
whenever we load a module.

00:04:45.190 --> 00:04:46.570 align:middle line:90%
So I'll hit Enter.

00:04:46.570 --> 00:04:50.140 align:middle line:84%
We now need to perform an
Nmap scan on the target server

00:04:50.140 --> 00:04:53.090 align:middle line:84%
to identify what services
are running on it,

00:04:53.090 --> 00:04:55.900 align:middle line:84%
and consequently, exploit
one of the services

00:04:55.900 --> 00:04:58.690 align:middle line:84%
in order to gain access
to the target system

00:04:58.690 --> 00:05:01.660 align:middle line:84%
so that we can get a Meterpreter
session, after which we

00:05:01.660 --> 00:05:04.240 align:middle line:84%
can take a look at how to
elevate our privileges.

00:05:04.240 --> 00:05:07.810 align:middle line:84%
So we'll use the db_nmap
command to perform an Nmap

00:05:07.810 --> 00:05:10.960 align:middle line:84%
scan from within the
Metasploit framework console.

00:05:10.960 --> 00:05:14.890 align:middle line:84%
And this command will allow
us to consequently save

00:05:14.890 --> 00:05:18.190 align:middle line:84%
the Nmap scan results directly
into the Metasploit framework

00:05:18.190 --> 00:05:19.420 align:middle line:90%
database.

00:05:19.420 --> 00:05:23.300 align:middle line:84%
And yeah, we can then access
the results whenever we want.

00:05:23.300 --> 00:05:24.880 align:middle line:90%
So we can type in db_nmap.

00:05:24.880 --> 00:05:27.670 align:middle line:84%
We're going to perform some
service version detection.

00:05:27.670 --> 00:05:31.090 align:middle line:84%
We're then going to paste in
the target IP and hit Enter.

00:05:31.090 --> 00:05:34.990 align:middle line:84%
So I'm just going to wait for
this to complete scanning.

00:05:34.990 --> 00:05:37.640 align:middle line:84%
All right, so the
Nmap scan is complete.

00:05:37.640 --> 00:05:41.080 align:middle line:84%
And as you can see, we
have the HttpFileServer

00:05:41.080 --> 00:05:42.640 align:middle line:90%
running on Port 80.

00:05:42.640 --> 00:05:46.690 align:middle line:84%
And that is the Rejetto
HttpFileServer version 2.3

00:05:46.690 --> 00:05:48.620 align:middle line:84%
that we have exploited
multiple times.

00:05:48.620 --> 00:05:51.010 align:middle line:84%
So that's going to
be our access vector.

00:05:51.010 --> 00:05:53.090 align:middle line:84%
So we are going to search
for the exploit module,

00:05:53.090 --> 00:05:56.360 align:middle line:84%
we're going to say
Search, Rejetto.

00:05:56.360 --> 00:05:59.250 align:middle line:84%
And we're going to be utilizing
this exploit module here,

00:05:59.250 --> 00:06:02.030 align:middle line:84%
which of course, allows us
to perform remote command

00:06:02.030 --> 00:06:02.910 align:middle line:90%
execution.

00:06:02.910 --> 00:06:06.660 align:middle line:84%
So I'm going to say
Use, paste it in there.

00:06:06.660 --> 00:06:10.650 align:middle line:84%
We then need to set the payload
to the 64-bit Meterpreter

00:06:10.650 --> 00:06:13.230 align:middle line:84%
payload because this is
what will be required

00:06:13.230 --> 00:06:16.530 align:middle line:84%
in order to
successfully bypass UAC

00:06:16.530 --> 00:06:18.180 align:middle line:90%
or to elevate our privileges.

00:06:18.180 --> 00:06:22.345 align:middle line:84%
So we will say Set Payload,
windows/x64/meterpreter/reverse

00:06:22.345 --> 00:06:23.810 align:middle line:90%
tcp.

00:06:23.810 --> 00:06:27.740 align:middle line:90%


00:06:27.740 --> 00:06:31.730 align:middle line:84%
Of course, you can use whatever
protocol you are interested in

00:06:31.730 --> 00:06:33.260 align:middle line:90%
or that you find useful.

00:06:33.260 --> 00:06:35.540 align:middle line:84%
In my case, I'll
use Reverse TCP.

00:06:35.540 --> 00:06:38.880 align:middle line:84%
We can then show the options
for this particular module.

00:06:38.880 --> 00:06:41.960 align:middle line:84%
And in this case, we have
the RHOST option already

00:06:41.960 --> 00:06:43.040 align:middle line:90%
specified for us.

00:06:43.040 --> 00:06:46.670 align:middle line:84%
We know that Rejetto is
running on Port 80, which

00:06:46.670 --> 00:06:48.650 align:middle line:90%
is perfectly fine in that case.

00:06:48.650 --> 00:06:51.590 align:middle line:84%
And then of course, as
for the payload options,

00:06:51.590 --> 00:06:54.260 align:middle line:84%
we have the LHOST
option specified for us.

00:06:54.260 --> 00:06:56.490 align:middle line:84%
You can, of course, change
that to the interface.

00:06:56.490 --> 00:06:59.690 align:middle line:84%
So we can say set
LHOST to ethernet 1.

00:06:59.690 --> 00:07:02.630 align:middle line:84%
If you want to do that as well,
you can go ahead and do that.

00:07:02.630 --> 00:07:05.840 align:middle line:84%
And we'll leave the
LPORT as Port 4444

00:07:05.840 --> 00:07:07.670 align:middle line:90%
as it's currently open.

00:07:07.670 --> 00:07:10.760 align:middle line:84%
All right, so we will hit
Run or you can hit Exploit,

00:07:10.760 --> 00:07:13.220 align:middle line:84%
depending on what
you're comfortable with.

00:07:13.220 --> 00:07:16.770 align:middle line:90%
In my case, I'll just Run.

00:07:16.770 --> 00:07:19.200 align:middle line:84%
Don't worry if it gives
you a warning regarding

00:07:19.200 --> 00:07:23.810 align:middle line:90%
the URI.escape is obsolete.

00:07:23.810 --> 00:07:25.850 align:middle line:84%
As you can see, we get
a Meterpreter session

00:07:25.850 --> 00:07:30.180 align:middle line:84%
on the target system so we can
type in the sysinfo command.

00:07:30.180 --> 00:07:33.150 align:middle line:84%
And we can also get an idea
of what user we currently

00:07:33.150 --> 00:07:36.310 align:middle line:84%
have access to by
typing in Get User ID.

00:07:36.310 --> 00:07:38.730 align:middle line:84%
And in this case, you can
see we have an account called

00:07:38.730 --> 00:07:42.900 align:middle line:84%
Admin, not Administrator, which
is a very different, but Admin.

00:07:42.900 --> 00:07:45.010 align:middle line:84%
And that's going to
be quite important.

00:07:45.010 --> 00:07:47.220 align:middle line:84%
Now, we can try and
elevate our privileges

00:07:47.220 --> 00:07:48.880 align:middle line:90%
using the Get System Command.

00:07:48.880 --> 00:07:51.990 align:middle line:84%
So we can say Get
System and hit Enter.

00:07:51.990 --> 00:07:54.540 align:middle line:84%
And as you can see, all
of the techniques fail.

00:07:54.540 --> 00:07:57.840 align:middle line:84%
So the Named Pipe Impersonation
technique In Memory

00:07:57.840 --> 00:08:01.590 align:middle line:84%
Fails as well as Token
Duplication and the Pipe

00:08:01.590 --> 00:08:02.940 align:middle line:90%
Impersonation technique.

00:08:02.940 --> 00:08:05.280 align:middle line:90%
So all of these techniques fail.

00:08:05.280 --> 00:08:07.980 align:middle line:84%
So let's try and get an
idea or an understanding

00:08:07.980 --> 00:08:10.560 align:middle line:84%
as to what users are
currently on the system

00:08:10.560 --> 00:08:12.540 align:middle line:90%
and what our privileges are.

00:08:12.540 --> 00:08:16.800 align:middle line:84%
Now, we can do that by tapping
and getprivs and hitting Enter.

00:08:16.800 --> 00:08:20.670 align:middle line:84%
And this command is limited
to the Meterpreter session

00:08:20.670 --> 00:08:22.090 align:middle line:90%
on a Windows target.

00:08:22.090 --> 00:08:24.930 align:middle line:84%
So this will give you an idea
of your current privileges

00:08:24.930 --> 00:08:27.660 align:middle line:84%
or the privileges assigned
to this particular user.

00:08:27.660 --> 00:08:30.510 align:middle line:84%
And indeed, we can
confirm that this really

00:08:30.510 --> 00:08:34.070 align:middle line:84%
isn't an Admin user, but
just a standard user.

00:08:34.070 --> 00:08:37.750 align:middle line:84%
Now, this Admin user may be part
of the Administrators group.

00:08:37.750 --> 00:08:42.330 align:middle line:84%
So how exactly can we verify
that or find out whether or not

00:08:42.330 --> 00:08:44.670 align:middle line:84%
this user is part of
the Administrator group?

00:08:44.670 --> 00:08:47.640 align:middle line:84%
Well, in order to do that, we
can open up a shell session

00:08:47.640 --> 00:08:49.710 align:middle line:90%
to get a command prompt.

00:08:49.710 --> 00:08:53.100 align:middle line:84%
And we can then type
in Net Local Group.

00:08:53.100 --> 00:08:56.940 align:middle line:84%
Or we can actually start off
by displaying the actual users

00:08:56.940 --> 00:08:57.610 align:middle line:90%
on the system.

00:08:57.610 --> 00:08:59.470 align:middle line:90%
So I can say Net Users.

00:08:59.470 --> 00:09:02.050 align:middle line:84%
And as you can see, we
have an Admin account,

00:09:02.050 --> 00:09:04.260 align:middle line:84%
which is what we
currently have access to.

00:09:04.260 --> 00:09:06.900 align:middle line:84%
And then we have the real
Administrator account,

00:09:06.900 --> 00:09:09.880 align:middle line:90%
as well as a Guest account.

00:09:09.880 --> 00:09:12.970 align:middle line:84%
Now, in order to enumerate
the actual members that

00:09:12.970 --> 00:09:15.310 align:middle line:84%
are part of the
Administrators group,

00:09:15.310 --> 00:09:18.820 align:middle line:84%
we can type in Net Local
Group Administrators.

00:09:18.820 --> 00:09:21.460 align:middle line:90%


00:09:21.460 --> 00:09:22.180 align:middle line:90%
Hit Enter.

00:09:22.180 --> 00:09:25.120 align:middle line:84%
And as you can see, the members
of the Administrator group

00:09:25.120 --> 00:09:27.050 align:middle line:90%
are Admin and Administrators.

00:09:27.050 --> 00:09:30.940 align:middle line:84%
So the Admin user account is
part of the Administrators

00:09:30.940 --> 00:09:34.120 align:middle line:84%
group, which means they can
perform administrative tasks

00:09:34.120 --> 00:09:36.910 align:middle line:84%
or they can essentially make
changes to the operating

00:09:36.910 --> 00:09:38.570 align:middle line:90%
system, which is great.

00:09:38.570 --> 00:09:42.950 align:middle line:84%
Which means we can actually
bypass UAC relatively easily.

00:09:42.950 --> 00:09:45.610 align:middle line:84%
Now, you may have a question
at the back of your mind.

00:09:45.610 --> 00:09:47.950 align:middle line:84%
And that is, why
are we utilizing

00:09:47.950 --> 00:09:50.980 align:middle line:84%
this particular privilege
escalation technique?

00:09:50.980 --> 00:09:54.070 align:middle line:84%
The reason we're utilizing
the Bypass User Access Control

00:09:54.070 --> 00:09:57.910 align:middle line:84%
technique is because first and
foremost, it actually exists

00:09:57.910 --> 00:10:03.730 align:middle line:84%
within versions of Windows from
Windows Vista to the latest

00:10:03.730 --> 00:10:04.900 align:middle line:90%
versions of Windows.

00:10:04.900 --> 00:10:07.660 align:middle line:84%
So it is fairly
stable in that regard.

00:10:07.660 --> 00:10:10.070 align:middle line:84%
And secondly,
again, it is, again,

00:10:10.070 --> 00:10:12.040 align:middle line:84%
a very, very, very
efficient technique

00:10:12.040 --> 00:10:14.260 align:middle line:84%
when it comes down to
elevating privileges

00:10:14.260 --> 00:10:16.750 align:middle line:84%
and doesn't require any
additional tinkering

00:10:16.750 --> 00:10:17.710 align:middle line:90%
or tweaking.

00:10:17.710 --> 00:10:21.610 align:middle line:84%
And the Metasploit framework
has various Bypass UAC modules

00:10:21.610 --> 00:10:24.280 align:middle line:84%
available based on
your current situation

00:10:24.280 --> 00:10:28.220 align:middle line:84%
or the actual configuration
of the target system.

00:10:28.220 --> 00:10:31.120 align:middle line:84%
So now that we've verified
that the Admin user is

00:10:31.120 --> 00:10:33.850 align:middle line:84%
part of the
Administrators group,

00:10:33.850 --> 00:10:38.320 align:middle line:84%
we already know that we don't
have administrative privileges

00:10:38.320 --> 00:10:39.820 align:middle line:84%
through them
Meterpreter session.

00:10:39.820 --> 00:10:44.350 align:middle line:84%
So we can bypass UAC by
utilizing the Bypass UAC

00:10:44.350 --> 00:10:45.100 align:middle line:90%
module.

00:10:45.100 --> 00:10:48.040 align:middle line:84%
But to be specific, we're
looking for the In Memory

00:10:48.040 --> 00:10:49.310 align:middle line:90%
Injection module.

00:10:49.310 --> 00:10:52.600 align:middle line:84%
So I will terminate
this particular channel

00:10:52.600 --> 00:10:56.810 align:middle line:84%
and I will put this
in the background.

00:10:56.810 --> 00:10:57.810 align:middle line:90%
All right, there we are.

00:10:57.810 --> 00:10:59.850 align:middle line:84%
And if we check
our sessions, you

00:10:59.850 --> 00:11:03.210 align:middle line:84%
can see that this is a
Meterpreter 64-bit Meterpreter

00:11:03.210 --> 00:11:04.020 align:middle line:90%
session.

00:11:04.020 --> 00:11:07.860 align:middle line:84%
And we currently have access to
the system via the Admin user,

00:11:07.860 --> 00:11:08.370 align:middle line:90%
right?

00:11:08.370 --> 00:11:11.260 align:middle line:84%
OK, so that's very, very
important to take note of.

00:11:11.260 --> 00:11:13.530 align:middle line:84%
So the module that
we are looking for

00:11:13.530 --> 00:11:15.970 align:middle line:90%
is the Bypass UAC module.

00:11:15.970 --> 00:11:19.680 align:middle line:84%
Now if we hit Enter, you can see
that we have quite a few Bypass

00:11:19.680 --> 00:11:23.490 align:middle line:84%
UAC modules that utilize
different techniques

00:11:23.490 --> 00:11:26.770 align:middle line:84%
to essentially elevate
your privileges.

00:11:26.770 --> 00:11:29.790 align:middle line:84%
Now, the one we are
interested in, in particular,

00:11:29.790 --> 00:11:34.080 align:middle line:84%
is going to be the Bypass UAC
Injection module, which again,

00:11:34.080 --> 00:11:38.670 align:middle line:84%
works or essentially
performs the actual bypassing

00:11:38.670 --> 00:11:41.910 align:middle line:84%
of the User Access Control
mechanism In Memory.

00:11:41.910 --> 00:11:44.130 align:middle line:84%
And in this case,
it will, of course,

00:11:44.130 --> 00:11:47.020 align:middle line:84%
execute the actual
Meterpreter payload In Memory.

00:11:47.020 --> 00:11:49.990 align:middle line:84%
So this is the actual
exploit module here.

00:11:49.990 --> 00:11:53.600 align:middle line:90%
So we are going to copy that.

00:11:53.600 --> 00:11:55.990 align:middle line:90%
And we are going to say Use.

00:11:55.990 --> 00:11:57.820 align:middle line:84%
It's great to set
the default payload

00:11:57.820 --> 00:12:00.560 align:middle line:84%
to the 32-bit
Meterpreter payload.

00:12:00.560 --> 00:12:05.354 align:middle line:84%
So we need to change that to
the actual Windows x64 payload.

00:12:05.354 --> 00:12:07.562 align:middle line:84%
So we're going to say
windows/x64/meterpreter/reverse

00:12:07.562 --> 00:12:08.875 align:middle line:90%
tcp.

00:12:08.875 --> 00:12:12.860 align:middle line:90%


00:12:12.860 --> 00:12:14.960 align:middle line:84%
All right, we can
now show the options

00:12:14.960 --> 00:12:17.690 align:middle line:90%
associated with this module.

00:12:17.690 --> 00:12:20.200 align:middle line:84%
And you can see that we need
to set up the actual session

00:12:20.200 --> 00:12:21.140 align:middle line:90%
ID here.

00:12:21.140 --> 00:12:25.390 align:middle line:84%
So we can set the
session to Session ID 1.

00:12:25.390 --> 00:12:27.520 align:middle line:84%
We then need to set
up the LPORT option,

00:12:27.520 --> 00:12:31.460 align:middle line:84%
because if we list
out our sessions here,

00:12:31.460 --> 00:12:33.020 align:middle line:90%
you can see that the session--

00:12:33.020 --> 00:12:34.970 align:middle line:84%
that this particular
session here

00:12:34.970 --> 00:12:37.970 align:middle line:90%
is already utilizing Port 4444.

00:12:37.970 --> 00:12:40.200 align:middle line:84%
So we need to set
the LPORT option.

00:12:40.200 --> 00:12:42.920 align:middle line:84%
So I'm going to show the
options again and set LPORT

00:12:42.920 --> 00:12:46.310 align:middle line:90%
to something like Port 4433.

00:12:46.310 --> 00:12:49.500 align:middle line:90%
OK, so we hit Enter.

00:12:49.500 --> 00:12:52.737 align:middle line:84%
And we can now test out
this payload, all right?

00:12:52.737 --> 00:12:53.820 align:middle line:90%
So we're going to hit Run.

00:12:53.820 --> 00:12:58.450 align:middle line:90%


00:12:58.450 --> 00:13:00.970 align:middle line:84%
All right, so we can
see that it actually

00:13:00.970 --> 00:13:04.270 align:middle line:84%
says that Windows Server
2012 R2 may be vulnerable.

00:13:04.270 --> 00:13:05.620 align:middle line:90%
UAC is enabled.

00:13:05.620 --> 00:13:07.240 align:middle line:90%
It's going to check the level.

00:13:07.240 --> 00:13:09.400 align:middle line:84%
It'll tell you that
the Admin user is part

00:13:09.400 --> 00:13:10.930 align:middle line:90%
of the Administrators group.

00:13:10.930 --> 00:13:13.750 align:middle line:84%
It's going to say that
UAC is set to default.

00:13:13.750 --> 00:13:16.600 align:middle line:84%
And then it's going to tell
you Bypass UAC can bypass

00:13:16.600 --> 00:13:18.310 align:middle line:90%
this setting, continuing.

00:13:18.310 --> 00:13:21.670 align:middle line:84%
But it tells us that the exploit
was aborted due to failure,

00:13:21.670 --> 00:13:26.510 align:middle line:84%
bad-config x86 Target
Selected for x64 system.

00:13:26.510 --> 00:13:28.660 align:middle line:84%
So in order to set
the target we're

00:13:28.660 --> 00:13:31.040 align:middle line:84%
going to say Set
the Target Option.

00:13:31.040 --> 00:13:33.460 align:middle line:84%
And then we can use the
Tab Alt to completion

00:13:33.460 --> 00:13:36.220 align:middle line:90%
to actually set the actual--

00:13:36.220 --> 00:13:40.480 align:middle line:84%
we can use this to set the
actual target operating system

00:13:40.480 --> 00:13:41.570 align:middle line:90%
architecture.

00:13:41.570 --> 00:13:45.290 align:middle line:84%
So in this case, we need to
set the target to Windows x64,

00:13:45.290 --> 00:13:45.790 align:middle line:90%
right?

00:13:45.790 --> 00:13:48.460 align:middle line:84%
So we set the target
and then we hit Run.

00:13:48.460 --> 00:13:56.240 align:middle line:90%


00:13:56.240 --> 00:13:58.970 align:middle line:84%
All right, as you can see,
it now completes successfully

00:13:58.970 --> 00:14:01.160 align:middle line:84%
and injects the payload
into the process.

00:14:01.160 --> 00:14:03.540 align:middle line:84%
And then it tells
you the process ID.

00:14:03.540 --> 00:14:05.930 align:middle line:84%
So we can see that it's
a sending stage and we

00:14:05.930 --> 00:14:07.160 align:middle line:90%
get the Meterpreter session.

00:14:07.160 --> 00:14:09.470 align:middle line:90%
So we say sysinfo.

00:14:09.470 --> 00:14:12.230 align:middle line:84%
We still have a 64-bit
Meterpreter payload

00:14:12.230 --> 00:14:15.000 align:middle line:90%
and we say getuid.

00:14:15.000 --> 00:14:18.960 align:middle line:84%
So the reason we don't have
any elevated privileges

00:14:18.960 --> 00:14:23.370 align:middle line:84%
is primarily because the
actual Bypass UAC exploit

00:14:23.370 --> 00:14:28.110 align:middle line:84%
module essentially created a
second Meterpreter session,

00:14:28.110 --> 00:14:31.330 align:middle line:84%
as we already explored
during the slides.

00:14:31.330 --> 00:14:36.550 align:middle line:84%
And this Meterpreter session has
the UAC flag or UAC disabled,

00:14:36.550 --> 00:14:39.360 align:middle line:84%
which means we can
utilize the Get System

00:14:39.360 --> 00:14:42.270 align:middle line:84%
Command to essentially
elevate our privileges.

00:14:42.270 --> 00:14:44.550 align:middle line:84%
And in this case,
it will successfully

00:14:44.550 --> 00:14:46.590 align:middle line:84%
be able to elevate
our privileges

00:14:46.590 --> 00:14:48.840 align:middle line:90%
because UAC is disabled.

00:14:48.840 --> 00:14:51.540 align:middle line:84%
And as a result,
we can pretty much

00:14:51.540 --> 00:14:55.530 align:middle line:84%
execute any command as
the Administrator user

00:14:55.530 --> 00:14:59.970 align:middle line:84%
without providing any
passwords or any credentials.

00:14:59.970 --> 00:15:02.340 align:middle line:84%
And the reason why I
recommend utilizing

00:15:02.340 --> 00:15:05.190 align:middle line:84%
this particular technique and
this particular exploit module

00:15:05.190 --> 00:15:09.030 align:middle line:84%
is because it works really
well on Windows versions

00:15:09.030 --> 00:15:11.520 align:middle line:84%
later or newer
than Windows Vista.

00:15:11.520 --> 00:15:15.060 align:middle line:84%
So Windows Server 2008,
Windows Server 2012.

00:15:15.060 --> 00:15:19.110 align:middle line:84%
As we've just done, Windows
7, Windows 10, Windows 8.1,

00:15:19.110 --> 00:15:20.890 align:middle line:90%
et cetera, et cetera.

00:15:20.890 --> 00:15:21.390 align:middle line:90%
All right?

00:15:21.390 --> 00:15:23.790 align:middle line:84%
So we've now been able to
elevate our privileges.

00:15:23.790 --> 00:15:26.400 align:middle line:84%
So we can perform
tasks that require

00:15:26.400 --> 00:15:28.950 align:middle line:84%
administrative privileges
like hash dump.

00:15:28.950 --> 00:15:30.090 align:middle line:90%
We hit Enter.

00:15:30.090 --> 00:15:31.830 align:middle line:84%
And as you can see
right over here,

00:15:31.830 --> 00:15:34.290 align:middle line:84%
we get the hashes
for the Admin user,

00:15:34.290 --> 00:15:36.610 align:middle line:84%
as well as the
Administrator user.

00:15:36.610 --> 00:15:39.180 align:middle line:84%
So again, you can now
go ahead and perform

00:15:39.180 --> 00:15:42.270 align:middle line:84%
all the tasks or
functionality that require

00:15:42.270 --> 00:15:43.990 align:middle line:90%
administrative privileges.

00:15:43.990 --> 00:15:49.500 align:middle line:84%
So that is how to elevate your
privileges by bypassing UAC.

00:15:49.500 --> 00:15:52.170 align:middle line:84%
And that is going to conclude
the practical demonstration

00:15:52.170 --> 00:15:56.260 align:middle line:90%
side or aspect of this video.

00:15:56.260 --> 00:15:58.920 align:middle line:84%
In the next video, we
are going to be exploring

00:15:58.920 --> 00:16:02.280 align:middle line:84%
the process of elevating
our privileges on Windows

00:16:02.280 --> 00:16:04.830 align:middle line:84%
through the Token
Impersonation technique.

00:16:04.830 --> 00:16:07.410 align:middle line:84%
And this can be
facilitated through the use

00:16:07.410 --> 00:16:10.230 align:middle line:84%
of a Meterpreter module
called Incognito.

00:16:10.230 --> 00:16:13.820 align:middle line:84%
So that's what we're going to
be exploring in the next video.

00:16:13.820 --> 00:16:15.500 align:middle line:90%
I'll see you there.

00:16:15.500 --> 00:16:16.000 align:middle line:90%