WEBVTT

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


00:00:10.020 --> 00:00:12.270 align:middle line:90%
Windows Kernel Exploits.

00:00:12.270 --> 00:00:16.110 align:middle line:84%
Now that we've taken a look at
how to exploit Windows services

00:00:16.110 --> 00:00:19.590 align:middle line:84%
and protocols, let's turn
our attention to performing

00:00:19.590 --> 00:00:22.890 align:middle line:84%
or elevating our privileges
on a Windows target, right?

00:00:22.890 --> 00:00:26.220 align:middle line:84%
So this is the Windows
privilege escalation section

00:00:26.220 --> 00:00:27.180 align:middle line:90%
of this course.

00:00:27.180 --> 00:00:30.780 align:middle line:84%
And to begin, we will be
taking a look at Windows kernel

00:00:30.780 --> 00:00:32.400 align:middle line:90%
exploits, all right?

00:00:32.400 --> 00:00:36.090 align:middle line:84%
Before we actually get started
with how to essentially elevate

00:00:36.090 --> 00:00:38.370 align:middle line:84%
our privileges through the
use of a kernel exploit,

00:00:38.370 --> 00:00:42.030 align:middle line:84%
let's get an understanding of
what privilege escalation is.

00:00:42.030 --> 00:00:43.710 align:middle line:84%
All right, so
privilege escalation

00:00:43.710 --> 00:00:46.410 align:middle line:84%
is the process of
exploiting vulnerabilities

00:00:46.410 --> 00:00:50.130 align:middle line:84%
or misconfigurations in
systems to elevate privileges

00:00:50.130 --> 00:00:52.140 align:middle line:84%
from one user to
another, typically,

00:00:52.140 --> 00:00:56.520 align:middle line:84%
to a user with administrative
or root access on a system.

00:00:56.520 --> 00:01:00.810 align:middle line:84%
All right, so again, I'll just
be using a very simple analogy

00:01:00.810 --> 00:01:01.710 align:middle line:90%
to explain this.

00:01:01.710 --> 00:01:04.209 align:middle line:84%
So let's say I gain
access to a system,

00:01:04.209 --> 00:01:05.940 align:middle line:84%
and in this case,
a Windows system,

00:01:05.940 --> 00:01:08.610 align:middle line:84%
and I realize that the
privileges that I currently

00:01:08.610 --> 00:01:11.940 align:middle line:84%
have access to are very limited,
which means that I can't really

00:01:11.940 --> 00:01:15.690 align:middle line:84%
do much in terms of data
exfiltration or pivoting

00:01:15.690 --> 00:01:18.120 align:middle line:84%
onto another system
on that network.

00:01:18.120 --> 00:01:19.920 align:middle line:84%
In order for me to
do anything that

00:01:19.920 --> 00:01:21.960 align:middle line:84%
requires administrative
privileges,

00:01:21.960 --> 00:01:25.080 align:middle line:84%
I would need to
elevate my privileges

00:01:25.080 --> 00:01:28.170 align:middle line:84%
to the privileges of
the administrator user

00:01:28.170 --> 00:01:31.590 align:middle line:84%
or to obtain NT authority
system privileges

00:01:31.590 --> 00:01:33.330 align:middle line:90%
in the case of Windows, right?

00:01:33.330 --> 00:01:35.100 align:middle line:84%
It's very important
to understand

00:01:35.100 --> 00:01:37.620 align:middle line:84%
what privilege escalation
is and the various privilege

00:01:37.620 --> 00:01:39.810 align:middle line:84%
escalation techniques
that can be performed

00:01:39.810 --> 00:01:41.880 align:middle line:90%
both on Windows and on Linux.

00:01:41.880 --> 00:01:45.390 align:middle line:84%
And privilege escalation is
a vital element of the attack

00:01:45.390 --> 00:01:48.060 align:middle line:84%
lifecycle and is a
major determinant

00:01:48.060 --> 00:01:50.670 align:middle line:84%
in the overall success
of a penetration test.

00:01:50.670 --> 00:01:53.230 align:middle line:84%
And the reason for
that is quite simple.

00:01:53.230 --> 00:01:56.760 align:middle line:84%
If you're contracted to
actually perform a penetration

00:01:56.760 --> 00:02:01.170 align:middle line:84%
test on a company's network, and
you only obtain initial access

00:02:01.170 --> 00:02:04.200 align:middle line:84%
on one system, and you
aren't able to elevate

00:02:04.200 --> 00:02:06.450 align:middle line:84%
your privileges, well,
you can't make your way

00:02:06.450 --> 00:02:10.949 align:middle line:84%
through the network or obtain
any data that's potentially

00:02:10.949 --> 00:02:12.790 align:middle line:90%
damaging to the company.

00:02:12.790 --> 00:02:15.150 align:middle line:84%
And again, a good
penetration test--

00:02:15.150 --> 00:02:18.150 align:middle line:84%
or a good penetration
tester is an individual

00:02:18.150 --> 00:02:21.000 align:middle line:84%
who is able, to
some extent, to be

00:02:21.000 --> 00:02:24.690 align:middle line:84%
able to actually elevate their
privileges across a network.

00:02:24.690 --> 00:02:27.550 align:middle line:84%
And, of course,
it isn't required,

00:02:27.550 --> 00:02:32.340 align:middle line:84%
but if the actual company's
network is secured properly

00:02:32.340 --> 00:02:34.690 align:middle line:84%
and the hosts have
been secured correctly,

00:02:34.690 --> 00:02:36.690 align:middle line:84%
and you are not able to
elevate your privileges,

00:02:36.690 --> 00:02:39.990 align:middle line:84%
well, that's just a testament
as to how good the company has

00:02:39.990 --> 00:02:44.250 align:middle line:84%
actually implemented
the security policy

00:02:44.250 --> 00:02:46.590 align:middle line:84%
or how good they're able
at detecting attacks.

00:02:46.590 --> 00:02:49.380 align:middle line:84%
But again, as I said,
if you're working

00:02:49.380 --> 00:02:50.880 align:middle line:84%
on a very simple
network and you're

00:02:50.880 --> 00:02:53.340 align:middle line:84%
dealing with Windows
systems, there

00:02:53.340 --> 00:02:55.800 align:middle line:84%
should be at least one
privilege escalation attack

00:02:55.800 --> 00:02:58.020 align:middle line:90%
vector that you can use.

00:02:58.020 --> 00:03:01.200 align:middle line:84%
All right, so after gaining an
initial foothold on a target

00:03:01.200 --> 00:03:04.200 align:middle line:84%
system, you will be required
to elevate your privileges

00:03:04.200 --> 00:03:06.600 align:middle line:84%
in order to perform tasks
and functionality that

00:03:06.600 --> 00:03:08.640 align:middle line:84%
require administrative
privileges,

00:03:08.640 --> 00:03:10.470 align:middle line:90%
and for obvious reasons, right?

00:03:10.470 --> 00:03:13.800 align:middle line:84%
So the importance of privilege
escalation in the penetration

00:03:13.800 --> 00:03:17.290 align:middle line:84%
testing process cannot be
overstated or overlooked.

00:03:17.290 --> 00:03:19.410 align:middle line:84%
Developing your privilege
escalation skills

00:03:19.410 --> 00:03:21.930 align:middle line:84%
will mark you out as a
good penetration tester.

00:03:21.930 --> 00:03:25.440 align:middle line:84%
So this is pretty much one
of the most important areas

00:03:25.440 --> 00:03:28.590 align:middle line:84%
within this course for
both Windows and Linux

00:03:28.590 --> 00:03:31.470 align:middle line:84%
because exploitation is
fairly simple in that there

00:03:31.470 --> 00:03:35.520 align:middle line:84%
are various exploitation
vectors that one can use,

00:03:35.520 --> 00:03:37.320 align:middle line:84%
and in addition
to that, there are

00:03:37.320 --> 00:03:40.950 align:middle line:84%
multiple exploit modules
or exploit code available

00:03:40.950 --> 00:03:43.890 align:middle line:90%
that can simplify that process.

00:03:43.890 --> 00:03:46.890 align:middle line:84%
Now, given the fact that we're
targeting the Windows kernel,

00:03:46.890 --> 00:03:49.470 align:middle line:84%
we need to have an understanding
of what a kernel is.

00:03:49.470 --> 00:03:52.560 align:middle line:84%
Well, firstly, a kernel
is a computer program

00:03:52.560 --> 00:03:54.990 align:middle line:84%
that is the core of
an operating system

00:03:54.990 --> 00:03:57.780 align:middle line:84%
and has complete control
over every resource

00:03:57.780 --> 00:03:59.860 align:middle line:90%
and hardware on a system.

00:03:59.860 --> 00:04:02.610 align:middle line:84%
So it really just acts
as a translation layer

00:04:02.610 --> 00:04:05.100 align:middle line:84%
between hardware and
software and facilitates

00:04:05.100 --> 00:04:07.480 align:middle line:84%
the communication
between these two layers.

00:04:07.480 --> 00:04:11.400 align:middle line:84%
So a kernel is essentially the
core of the operating system

00:04:11.400 --> 00:04:14.250 align:middle line:84%
and is responsible
for various pieces

00:04:14.250 --> 00:04:19.810 align:middle line:84%
of functionality like IO,
arithmetic memory management,

00:04:19.810 --> 00:04:21.450 align:middle line:90%
et cetera, et cetera.

00:04:21.450 --> 00:04:24.270 align:middle line:84%
Now, what kernel
does Windows run?

00:04:24.270 --> 00:04:27.420 align:middle line:84%
Well, Windows runs a kernel
called Windows NT, all right?

00:04:27.420 --> 00:04:30.180 align:middle line:84%
So Windows NT is the kernel
that comes pre-packaged

00:04:30.180 --> 00:04:32.190 align:middle line:84%
with all versions
of Microsoft Windows

00:04:32.190 --> 00:04:35.550 align:middle line:84%
and operates as a traditional
kernel with a few exceptions

00:04:35.550 --> 00:04:37.980 align:middle line:90%
based on user design philosophy.

00:04:37.980 --> 00:04:40.800 align:middle line:84%
And it consists of two
main modes of operation

00:04:40.800 --> 00:04:43.870 align:middle line:84%
that determine access to
system resources and hardware.

00:04:43.870 --> 00:04:45.900 align:middle line:90%
So this is very, very common--

00:04:45.900 --> 00:04:48.720 align:middle line:84%
this particular architecture
is very common on both Windows

00:04:48.720 --> 00:04:52.260 align:middle line:84%
or Unix based operating systems,
where you have your user

00:04:52.260 --> 00:04:55.440 align:middle line:84%
mode, whereby programs and
services running in user mode

00:04:55.440 --> 00:04:58.950 align:middle line:84%
have limited access to system
resources and functionality,

00:04:58.950 --> 00:05:04.140 align:middle line:84%
and user mode is typically left
for third-party applications

00:05:04.140 --> 00:05:07.950 align:middle line:84%
or programs that an
end-user would be running.

00:05:07.950 --> 00:05:09.690 align:middle line:90%
You then have your kernel mode.

00:05:09.690 --> 00:05:12.660 align:middle line:84%
Kernel mode has unrestricted
access to system resources

00:05:12.660 --> 00:05:16.560 align:middle line:84%
and functionality with the
added functionality of managing

00:05:16.560 --> 00:05:19.020 align:middle line:90%
devices and system memory.

00:05:19.020 --> 00:05:22.350 align:middle line:84%
So again, if we're targeting
the Windows kernel,

00:05:22.350 --> 00:05:25.470 align:middle line:84%
or we are trying to elevate
our privileges by exploiting

00:05:25.470 --> 00:05:28.050 align:middle line:84%
the Windows kernel, the
reason why we are doing

00:05:28.050 --> 00:05:31.380 align:middle line:84%
that is because if we get any
code executed in the kernel

00:05:31.380 --> 00:05:34.680 align:middle line:84%
mode or in kernel space,
then we are essentially

00:05:34.680 --> 00:05:35.580 align:middle line:90%
going to obtain--

00:05:35.580 --> 00:05:39.000 align:middle line:84%
or that particular
code or shellcode

00:05:39.000 --> 00:05:41.130 align:middle line:84%
will be executed
with the highest

00:05:41.130 --> 00:05:44.730 align:middle line:84%
level of privileges available
on the operating system.

00:05:44.730 --> 00:05:46.710 align:middle line:84%
So that's why we're
targeting the kernel.

00:05:46.710 --> 00:05:50.250 align:middle line:84%
Now, in terms of Windows
kernel exploitation,

00:05:50.250 --> 00:05:52.230 align:middle line:84%
kernel exploits on
Windows will typically

00:05:52.230 --> 00:05:54.720 align:middle line:84%
target vulnerabilities
in the Windows kernel

00:05:54.720 --> 00:05:56.610 align:middle line:84%
to execute arbitrary
code in order

00:05:56.610 --> 00:06:00.480 align:middle line:84%
to run privilege system commands
or obtain a system shell.

00:06:00.480 --> 00:06:03.240 align:middle line:84%
And, of course, there are
multiple vulnerabilities

00:06:03.240 --> 00:06:06.660 align:middle line:84%
within the Windows kernel, as
we'll be exploring shortly.

00:06:06.660 --> 00:06:10.350 align:middle line:84%
And it's very important to note
that this process will differ

00:06:10.350 --> 00:06:12.840 align:middle line:84%
based on the version of
Windows being targeted

00:06:12.840 --> 00:06:14.770 align:middle line:84%
and the kernel
exploit being used.

00:06:14.770 --> 00:06:18.930 align:middle line:84%
So kernel exploitation is not
a privilege escalation vector

00:06:18.930 --> 00:06:22.710 align:middle line:84%
that I would recommend just
running in an ad hoc fashion

00:06:22.710 --> 00:06:25.770 align:middle line:84%
because, as I said, once
you start interacting

00:06:25.770 --> 00:06:29.010 align:middle line:84%
with the kernel, there's an
increased likelihood that you

00:06:29.010 --> 00:06:33.540 align:middle line:84%
can cause system crashes that
would consequently lead to loss

00:06:33.540 --> 00:06:35.970 align:middle line:84%
of data, and it's not something
that I recommend running

00:06:35.970 --> 00:06:38.670 align:middle line:90%
in an enterprise environment.

00:06:38.670 --> 00:06:41.430 align:middle line:84%
Now, Windows
privilege escalation

00:06:41.430 --> 00:06:44.130 align:middle line:84%
will typically follow the
following methodology.

00:06:44.130 --> 00:06:47.820 align:middle line:84%
So it's a 2-step process,
whereby the first step will

00:06:47.820 --> 00:06:50.280 align:middle line:84%
involve identifying
kernel vulnerabilities

00:06:50.280 --> 00:06:54.000 align:middle line:84%
for this specific
version of Windows

00:06:54.000 --> 00:06:56.400 align:middle line:84%
that you're trying to
elevate your privileges on.

00:06:56.400 --> 00:06:59.760 align:middle line:84%
And we can do that through
the use of various tools

00:06:59.760 --> 00:07:01.680 align:middle line:90%
or various automation scripts.

00:07:01.680 --> 00:07:04.560 align:middle line:84%
And secondly, the second
part of this process

00:07:04.560 --> 00:07:06.300 align:middle line:84%
will involve
downloading, compiling,

00:07:06.300 --> 00:07:09.000 align:middle line:84%
and transferring kernel
exploits onto the target

00:07:09.000 --> 00:07:10.860 align:middle line:90%
system for execution.

00:07:10.860 --> 00:07:12.720 align:middle line:84%
And this process,
again, will differ

00:07:12.720 --> 00:07:15.910 align:middle line:84%
based on the version of
Windows we are targeting,

00:07:15.910 --> 00:07:19.370 align:middle line:84%
as well as the kernel
exploit that's being used.

00:07:19.370 --> 00:07:21.500 align:middle line:84%
Now, as for the tools
and the environment

00:07:21.500 --> 00:07:24.320 align:middle line:84%
that I'm going to be using
to demonstrate the kernel

00:07:24.320 --> 00:07:26.870 align:middle line:84%
exploitation
process, we are going

00:07:26.870 --> 00:07:30.470 align:middle line:84%
to be utilizing a tool called
the Windows exploit suggester.

00:07:30.470 --> 00:07:34.550 align:middle line:84%
This is a Python tool that
compares a target's patch

00:07:34.550 --> 00:07:37.610 align:middle line:84%
levels against the Microsoft
vulnerability database

00:07:37.610 --> 00:07:41.160 align:middle line:84%
in order to detect potential
missing patches on the target.

00:07:41.160 --> 00:07:44.930 align:middle line:84%
It also notifies the user
if there are public exploits

00:07:44.930 --> 00:07:48.560 align:middle line:84%
and Metasploit modules available
for the missing bulletins

00:07:48.560 --> 00:07:50.300 align:middle line:90%
or for the missing patches.

00:07:50.300 --> 00:07:51.830 align:middle line:84%
All right, so the
GitHub repository

00:07:51.830 --> 00:07:54.290 align:middle line:84%
has been linked to
this particular slide,

00:07:54.290 --> 00:07:56.870 align:middle line:84%
and, of course, I'll be showing
you how to get the tool setup

00:07:56.870 --> 00:07:58.100 align:middle line:90%
and how to use it.

00:07:58.100 --> 00:08:00.380 align:middle line:84%
And then we have another
GitHub repository

00:08:00.380 --> 00:08:02.030 align:middle line:90%
called Windows kernel exploits.

00:08:02.030 --> 00:08:04.970 align:middle line:84%
This is essentially a collection
of Windows kernel exploits

00:08:04.970 --> 00:08:06.590 align:middle line:90%
sorted by CVE.

00:08:06.590 --> 00:08:08.930 align:middle line:84%
And the great thing about
this GitHub repository

00:08:08.930 --> 00:08:13.310 align:middle line:84%
is it actually sorts out the
actual kernel exploits based

00:08:13.310 --> 00:08:17.470 align:middle line:84%
on CVEs or the Microsoft
vulnerability identification

00:08:17.470 --> 00:08:20.370 align:middle line:84%
ID or rather the Microsoft
vulnerability ID.

00:08:20.370 --> 00:08:22.610 align:middle line:84%
So, in this case,
the link I've posted

00:08:22.610 --> 00:08:26.690 align:middle line:84%
is a link to the MS16-135
vulnerability, which

00:08:26.690 --> 00:08:29.660 align:middle line:84%
is a kernel or a vulnerability
within the Windows kernel

00:08:29.660 --> 00:08:33.320 align:middle line:84%
that allows for local
privilege escalation.

00:08:33.320 --> 00:08:35.179 align:middle line:84%
And we'll be taking
a look at how

00:08:35.179 --> 00:08:38.539 align:middle line:84%
to do this both automatically
with Metasploit as well

00:08:38.539 --> 00:08:39.720 align:middle line:90%
as manually.

00:08:39.720 --> 00:08:40.220 align:middle line:90%
All right.

00:08:40.220 --> 00:08:42.950 align:middle line:84%
Now, it's very important
to note that the techniques

00:08:42.950 --> 00:08:46.370 align:middle line:84%
demonstrated in this video are
performed on a Windows service

00:08:46.370 --> 00:08:48.110 align:middle line:90%
pack 1 virtual machine.

00:08:48.110 --> 00:08:50.360 align:middle line:84%
And, of course,
you already should

00:08:50.360 --> 00:08:51.950 align:middle line:84%
have noticed this
particular lab,

00:08:51.950 --> 00:08:54.680 align:middle line:84%
or this particular video
doesn't have an associated lab

00:08:54.680 --> 00:08:55.620 align:middle line:90%
environment.

00:08:55.620 --> 00:08:58.220 align:middle line:84%
The reason for that is
because kernel exploitation

00:08:58.220 --> 00:09:02.180 align:middle line:84%
is extremely nuanced,
depending on the type of target

00:09:02.180 --> 00:09:03.290 align:middle line:90%
that you're dealing with.

00:09:03.290 --> 00:09:06.440 align:middle line:84%
And the objective of this
video is to show you the tools

00:09:06.440 --> 00:09:08.630 align:middle line:84%
that you can use to
enumerate vulnerabilities

00:09:08.630 --> 00:09:13.250 align:middle line:84%
within the Windows kernel for
a specific version of Windows.

00:09:13.250 --> 00:09:15.500 align:middle line:84%
And secondly, I'll take
you through the process

00:09:15.500 --> 00:09:18.650 align:middle line:84%
of how you can take a
look at the exploit code,

00:09:18.650 --> 00:09:21.830 align:middle line:84%
how you can compile it,
how you can transfer

00:09:21.830 --> 00:09:25.700 align:middle line:84%
the actual compiled binary
or executable onto the target

00:09:25.700 --> 00:09:27.680 align:middle line:90%
system, and how to execute it.

00:09:27.680 --> 00:09:30.260 align:middle line:84%
And, of course, this
will essentially

00:09:30.260 --> 00:09:32.810 align:middle line:84%
encapsulate the privilege
escalation process

00:09:32.810 --> 00:09:34.970 align:middle line:84%
through the use of a
Windows kernel exploit.

00:09:34.970 --> 00:09:38.000 align:middle line:84%
So I'm going to switch
over to my Kali Linux VM,

00:09:38.000 --> 00:09:40.610 align:middle line:84%
and we can begin the
kernel exploitation

00:09:40.610 --> 00:09:41.645 align:middle line:90%
process for Windows.

00:09:41.645 --> 00:09:44.860 align:middle line:90%


00:09:44.860 --> 00:09:48.340 align:middle line:84%
All right, so I'm back on my
Kali Linux virtual machine,

00:09:48.340 --> 00:09:51.170 align:middle line:84%
and I've already gained
access to the target system,

00:09:51.170 --> 00:09:53.800 align:middle line:84%
so I'm currently within the
Metasploit framework console.

00:09:53.800 --> 00:09:57.910 align:middle line:84%
And if I say sessions, you'll
see that I have a PowerShell

00:09:57.910 --> 00:10:00.880 align:middle line:84%
session on the target, as
well as a Meterpreter session,

00:10:00.880 --> 00:10:01.810 align:middle line:90%
so there we are.

00:10:01.810 --> 00:10:04.030 align:middle line:84%
You can see it's
running Windows 7,

00:10:04.030 --> 00:10:06.880 align:middle line:84%
and the user count that
I currently have access

00:10:06.880 --> 00:10:08.810 align:middle line:90%
to is the accountant user.

00:10:08.810 --> 00:10:12.220 align:middle line:84%
So again, if I say sessions 3
to interact with that session,

00:10:12.220 --> 00:10:14.800 align:middle line:84%
and I type in get
user ID, you can

00:10:14.800 --> 00:10:17.710 align:middle line:84%
see that I'm currently
logged on as the accountant,

00:10:17.710 --> 00:10:21.160 align:middle line:84%
and this particular account does
not have elevated privileges,

00:10:21.160 --> 00:10:25.600 align:middle line:84%
and I can actually demonstrate
that by saying getprivs,

00:10:25.600 --> 00:10:28.720 align:middle line:84%
and if I hit Enter, you can see
that the amount of privileges

00:10:28.720 --> 00:10:30.830 align:middle line:84%
that we have is
extremely limited

00:10:30.830 --> 00:10:33.670 align:middle line:84%
and we essentially
want to elevate

00:10:33.670 --> 00:10:36.460 align:middle line:84%
our privileges to
anti-authority system, right?

00:10:36.460 --> 00:10:39.940 align:middle line:84%
So again, depending
on the type of access

00:10:39.940 --> 00:10:43.090 align:middle line:84%
you have on the target, whether
it be through a Meterpreter

00:10:43.090 --> 00:10:45.640 align:middle line:84%
session or a typical
command shell session,

00:10:45.640 --> 00:10:46.870 align:middle line:90%
it really doesn't matter.

00:10:46.870 --> 00:10:49.030 align:middle line:84%
We're going to start off
by taking a look at how

00:10:49.030 --> 00:10:52.210 align:middle line:84%
we can identify
kernel vulnerabilities

00:10:52.210 --> 00:10:55.450 align:middle line:84%
within the Windows kernel
with Metasploit first.

00:10:55.450 --> 00:10:58.570 align:middle line:84%
So I've already obtained
a Meterpreter session.

00:10:58.570 --> 00:11:01.420 align:middle line:84%
And, of course, many of you
who have used Metasploit before

00:11:01.420 --> 00:11:04.450 align:middle line:84%
know that there is an inbuilt
Meterpreter command that allows

00:11:04.450 --> 00:11:07.720 align:middle line:84%
you to automatically elevate
your privileges on the target

00:11:07.720 --> 00:11:10.300 align:middle line:84%
system, and that command
is just get system.

00:11:10.300 --> 00:11:11.980 align:middle line:84%
And if I hit Enter,
it would essentially

00:11:11.980 --> 00:11:13.570 align:middle line:84%
go through a plethora
of techniques

00:11:13.570 --> 00:11:15.890 align:middle line:84%
in order to elevate the
privileges and, in this case,

00:11:15.890 --> 00:11:19.060 align:middle line:84%
you can see that all of
them have actually failed.

00:11:19.060 --> 00:11:23.890 align:middle line:84%
So it tries various techniques
like token duplication,

00:11:23.890 --> 00:11:27.340 align:middle line:84%
named pipe impersonation, et
cetera, et cetera, and all

00:11:27.340 --> 00:11:28.000 align:middle line:90%
of these fail.

00:11:28.000 --> 00:11:30.820 align:middle line:84%
Well, let me just put
this Meterpreter session

00:11:30.820 --> 00:11:31.810 align:middle line:90%
in the background.

00:11:31.810 --> 00:11:35.710 align:middle line:84%
There is a really, really
useful Metasploit module

00:11:35.710 --> 00:11:38.920 align:middle line:84%
that will essentially
enumerate all vulnerabilities

00:11:38.920 --> 00:11:41.800 align:middle line:84%
pertinent to this particular
version of Windows,

00:11:41.800 --> 00:11:44.200 align:middle line:90%
and the name of that module is--

00:11:44.200 --> 00:11:48.393 align:middle line:84%
I'm just going to search for
a module called suggester,

00:11:48.393 --> 00:11:49.560 align:middle line:90%
and this is the module here.

00:11:49.560 --> 00:11:52.500 align:middle line:84%
You can see that it is a
post-exploitation module,

00:11:52.500 --> 00:11:55.470 align:middle line:84%
and it's called local
exploit suggester,

00:11:55.470 --> 00:11:57.760 align:middle line:84%
and it works for multiple
operating systems,

00:11:57.760 --> 00:12:00.990 align:middle line:84%
whether it be Linux,
Windows, macOS, et cetera.

00:12:00.990 --> 00:12:04.300 align:middle line:84%
So I can say use
this module here,

00:12:04.300 --> 00:12:07.630 align:middle line:84%
and if we show the
options here, you

00:12:07.630 --> 00:12:10.570 align:middle line:84%
have the ability-- because this
is a post-exploitation module,

00:12:10.570 --> 00:12:12.400 align:middle line:84%
you need to specify
the session that you

00:12:12.400 --> 00:12:14.300 align:middle line:90%
want to run this module on.

00:12:14.300 --> 00:12:17.110 align:middle line:84%
So, in this case, I've
already set the session

00:12:17.110 --> 00:12:19.750 align:middle line:84%
to 3, which in my case, is
the Meterpreter session.

00:12:19.750 --> 00:12:23.530 align:middle line:84%
If I can actually type that in,
you can see that is the case,

00:12:23.530 --> 00:12:26.050 align:middle line:84%
and all you need
to do is hit Run.

00:12:26.050 --> 00:12:27.790 align:middle line:90%
This will bring up--

00:12:27.790 --> 00:12:31.120 align:middle line:84%
or will essentially enumerate
all the vulnerabilities

00:12:31.120 --> 00:12:34.090 align:middle line:84%
within this particular
version of Windows.

00:12:34.090 --> 00:12:37.270 align:middle line:84%
And furthermore, it will
display the Metasploit modules

00:12:37.270 --> 00:12:40.480 align:middle line:84%
that you can use to
elevate your privileges.

00:12:40.480 --> 00:12:42.670 align:middle line:84%
So again, the best
way to show this is

00:12:42.670 --> 00:12:45.220 align:middle line:84%
or to actually demonstrate
this is to just hit Run,

00:12:45.220 --> 00:12:49.630 align:middle line:84%
and it's going to say collecting
local exploits for x64/windows.

00:12:49.630 --> 00:12:52.600 align:middle line:84%
So give this a couple of
seconds to a couple of minutes,

00:12:52.600 --> 00:12:55.373 align:middle line:84%
as will I. So I'm going to
just wait for this to complete,

00:12:55.373 --> 00:12:57.040 align:middle line:84%
and I'll get back to
you when it's done.

00:12:57.040 --> 00:13:00.100 align:middle line:90%


00:13:00.100 --> 00:13:03.010 align:middle line:84%
All right, so the local exploit
suggester module is complete,

00:13:03.010 --> 00:13:05.650 align:middle line:84%
and you can see it's going to
tell you 31 exploit checks are

00:13:05.650 --> 00:13:07.810 align:middle line:84%
being tried, and then
it'll provide you

00:13:07.810 --> 00:13:10.420 align:middle line:84%
with a list of exploit
modules that you can

00:13:10.420 --> 00:13:13.270 align:middle line:90%
use to elevate your privileges.

00:13:13.270 --> 00:13:15.490 align:middle line:84%
So starting off, we
have the typical bypass

00:13:15.490 --> 00:13:18.880 align:middle line:84%
UAC exploit module, which
we will be covering later

00:13:18.880 --> 00:13:22.240 align:middle line:84%
on in this section when we'll be
taking a look at how to elevate

00:13:22.240 --> 00:13:24.190 align:middle line:90%
our privileges through the--

00:13:24.190 --> 00:13:26.320 align:middle line:90%
or through bypassing UAC.

00:13:26.320 --> 00:13:29.050 align:middle line:84%
And then you have
a few others here,

00:13:29.050 --> 00:13:32.530 align:middle line:84%
for example, the shchelevator
exploit, as well as

00:13:32.530 --> 00:13:33.770 align:middle line:90%
this one right over here.

00:13:33.770 --> 00:13:36.700 align:middle line:84%
So again, this
particular exploit

00:13:36.700 --> 00:13:39.880 align:middle line:84%
or these particular
exploit modules,

00:13:39.880 --> 00:13:43.150 align:middle line:84%
again, can be used if you've
performed enough research

00:13:43.150 --> 00:13:46.540 align:middle line:84%
on them in regards to
what versions of Windows

00:13:46.540 --> 00:13:48.320 align:middle line:84%
they will actually
be successful on.

00:13:48.320 --> 00:13:52.540 align:middle line:84%
So, for example, I can
search for this particular--

00:13:52.540 --> 00:13:54.340 align:middle line:84%
I can search for
it on Google here.

00:13:54.340 --> 00:13:56.770 align:middle line:84%
So I'll just open up my
browser, and I'll just

00:13:56.770 --> 00:13:57.940 align:middle line:90%
paste that in there.

00:13:57.940 --> 00:14:00.400 align:middle line:84%
And I can utilize
the links here,

00:14:00.400 --> 00:14:02.740 align:middle line:84%
for example, the Rapid7
link, to learn more

00:14:02.740 --> 00:14:06.130 align:middle line:84%
about what this exploit does or
this particular exploit module

00:14:06.130 --> 00:14:06.800 align:middle line:90%
does.

00:14:06.800 --> 00:14:09.220 align:middle line:90%
So you can see this is Rapid7.

00:14:09.220 --> 00:14:12.220 align:middle line:84%
Rapid7 is the company that
developed the Metasploit

00:14:12.220 --> 00:14:14.590 align:middle line:84%
framework, or rather acquired
the Metasploit framework

00:14:14.590 --> 00:14:17.630 align:middle line:84%
and is currently responsible
for developing it.

00:14:17.630 --> 00:14:22.180 align:middle line:84%
So you can see that this module
exploits the Task Scheduler 2.0

00:14:22.180 --> 00:14:25.000 align:middle line:90%
XML 0day exploited by Stuxnet.

00:14:25.000 --> 00:14:28.090 align:middle line:84%
When processing task files,
the Windows Task Scheduler

00:14:28.090 --> 00:14:34.330 align:middle line:84%
only uses a CRC32 checksum to
validate that the file has not

00:14:34.330 --> 00:14:35.530 align:middle line:90%
been tampered with.

00:14:35.530 --> 00:14:37.810 align:middle line:84%
Also, in a default
configuration,

00:14:37.810 --> 00:14:41.320 align:middle line:84%
normal users can read
and write the task files

00:14:41.320 --> 00:14:42.550 align:middle line:90%
that they have created.

00:14:42.550 --> 00:14:47.050 align:middle line:84%
By modifying the task file and
creating the CRC32 collision,

00:14:47.050 --> 00:14:49.420 align:middle line:84%
an attacker can execute
arbitrary commands.

00:14:49.420 --> 00:14:52.090 align:middle line:84%
So this really isn't
a kernel exploit.

00:14:52.090 --> 00:14:57.610 align:middle line:84%
So if we take a look at this
one right over here, MS16_014,

00:14:57.610 --> 00:15:00.265 align:middle line:84%
and let's just
search for this here.

00:15:00.265 --> 00:15:01.890 align:middle line:84%
I'll just paste this
in here, and we'll

00:15:01.890 --> 00:15:03.070 align:middle line:90%
perform a Google search.

00:15:03.070 --> 00:15:06.810 align:middle line:84%
So we'll open up the Rapid7
link right over here.

00:15:06.810 --> 00:15:09.005 align:middle line:90%


00:15:09.005 --> 00:15:10.130 align:middle line:90%
All right, so there we are.

00:15:10.130 --> 00:15:14.450 align:middle line:84%
You can see that this exploits
the Windows WMI subsystem.

00:15:14.450 --> 00:15:17.360 align:middle line:84%
And you can see right
over here, this module has

00:15:17.360 --> 00:15:21.860 align:middle line:84%
been tested on vulnerable builds
of Windows 7 Service Pack 0

00:15:21.860 --> 00:15:24.860 align:middle line:84%
and Windows 7 Service
Pack 1 64-bit,

00:15:24.860 --> 00:15:27.330 align:middle line:84%
so this might be a
good starting point.

00:15:27.330 --> 00:15:29.280 align:middle line:84%
And, of course, if
we want to use it,

00:15:29.280 --> 00:15:32.060 align:middle line:84%
we can simply just
copy the exploit name,

00:15:32.060 --> 00:15:36.050 align:middle line:84%
the exploit module name
here, and we'll hit Use

00:15:36.050 --> 00:15:37.548 align:middle line:90%
and paste that in there.

00:15:37.548 --> 00:15:38.090 align:middle line:90%
There we are.

00:15:38.090 --> 00:15:40.048 align:middle line:84%
So it's going to use the
default payload, which

00:15:40.048 --> 00:15:42.560 align:middle line:84%
is a 64-bit version
of the Meterpreter.

00:15:42.560 --> 00:15:45.400 align:middle line:90%
So I'll say show options.

00:15:45.400 --> 00:15:47.410 align:middle line:84%
We need to specify
the actual session,

00:15:47.410 --> 00:15:49.030 align:middle line:84%
so we'll say set
session, and I'm

00:15:49.030 --> 00:15:51.730 align:middle line:84%
going to set my
Meterpreter session as that

00:15:51.730 --> 00:15:54.580 align:middle line:84%
is the session I want to run
this particular exploit module

00:15:54.580 --> 00:15:55.510 align:middle line:90%
on.

00:15:55.510 --> 00:15:56.410 align:middle line:90%
There we are.

00:15:56.410 --> 00:15:58.600 align:middle line:84%
And then, I need to
specify my L port

00:15:58.600 --> 00:16:00.820 align:middle line:84%
option because my
sessions are currently

00:16:00.820 --> 00:16:02.080 align:middle line:90%
using one of these ports.

00:16:02.080 --> 00:16:02.622 align:middle line:90%
There we are.

00:16:02.622 --> 00:16:06.340 align:middle line:84%
So might PowerShell session
is currently using port 4444,

00:16:06.340 --> 00:16:10.390 align:middle line:84%
so I'll say set L
port to, maybe, 4422,

00:16:10.390 --> 00:16:11.960 align:middle line:90%
and then I can hit exploit.

00:16:11.960 --> 00:16:13.015 align:middle line:90%
So let's hit Enter.

00:16:13.015 --> 00:16:15.770 align:middle line:90%


00:16:15.770 --> 00:16:18.360 align:middle line:84%
All right, so it looks
like this was successful.

00:16:18.360 --> 00:16:19.880 align:middle line:84%
So it's going to
say, reflectively

00:16:19.880 --> 00:16:25.100 align:middle line:84%
injecting the DLL into process
3240 or the process ID 3240.

00:16:25.100 --> 00:16:27.290 align:middle line:84%
Exploit finished,
waiting for hopefully

00:16:27.290 --> 00:16:29.730 align:middle line:84%
privileged payload
execution to complete.

00:16:29.730 --> 00:16:33.050 align:middle line:84%
So it's going to send the
stage, and hopefully, the stage

00:16:33.050 --> 00:16:35.600 align:middle line:84%
is executed on the target,
and we consequently

00:16:35.600 --> 00:16:39.080 align:middle line:84%
receive a Meterpreter session
with elevated privileges.

00:16:39.080 --> 00:16:41.930 align:middle line:84%
So again, the reason
I'm demonstrating this

00:16:41.930 --> 00:16:45.980 align:middle line:84%
is to show you that whenever
you're using Metasploit modules

00:16:45.980 --> 00:16:48.050 align:middle line:84%
for the purpose
of local privilege

00:16:48.050 --> 00:16:50.990 align:middle line:84%
escalation on a Windows
target, the process can

00:16:50.990 --> 00:16:54.740 align:middle line:84%
be a little bit
tedious in regards

00:16:54.740 --> 00:16:56.670 align:middle line:90%
to your chances of success.

00:16:56.670 --> 00:16:59.940 align:middle line:84%
And the reason for that is
fairly simple, and, of course,

00:16:59.940 --> 00:17:01.640 align:middle line:84%
it all comes down
to your ability

00:17:01.640 --> 00:17:06.530 align:middle line:84%
to identify vulnerabilities
within this specific version

00:17:06.530 --> 00:17:08.119 align:middle line:84%
of Windows that
you're targeting.

00:17:08.119 --> 00:17:10.250 align:middle line:84%
In this case, we get
a Meterpreter session,

00:17:10.250 --> 00:17:14.000 align:middle line:84%
and if I say Get user ID, you
can see that it is privileged,

00:17:14.000 --> 00:17:17.089 align:middle line:84%
and we have successfully been
able to elevate our privileges

00:17:17.089 --> 00:17:20.900 align:middle line:84%
by utilizing a kernel exploit
for this specific version

00:17:20.900 --> 00:17:22.280 align:middle line:90%
of Windows 7.

00:17:22.280 --> 00:17:25.310 align:middle line:84%
Right now, this is how to do it
automatically with Metasploit.

00:17:25.310 --> 00:17:27.900 align:middle line:84%
You can see that it's
fairly straightforward.

00:17:27.900 --> 00:17:30.890 align:middle line:84%
You can utilize just
one module to enumerate

00:17:30.890 --> 00:17:32.720 align:middle line:84%
a list of exploit
modules that you

00:17:32.720 --> 00:17:35.420 align:middle line:84%
can use against this
specific version of Windows.

00:17:35.420 --> 00:17:38.040 align:middle line:84%
And using the exploit
module is fairly simple.

00:17:38.040 --> 00:17:40.790 align:middle line:84%
You just need to set
the session ID, as well

00:17:40.790 --> 00:17:43.580 align:middle line:84%
as the payload options
like your IP addresses,

00:17:43.580 --> 00:17:47.510 align:middle line:84%
as well as the port that
you want to listen on.

00:17:47.510 --> 00:17:50.540 align:middle line:84%
So I'll put this
in the background.

00:17:50.540 --> 00:17:51.500 align:middle line:90%
There we are.

00:17:51.500 --> 00:17:53.540 align:middle line:84%
And if I list out my
sessions again, you

00:17:53.540 --> 00:17:59.090 align:middle line:84%
can now see I have Meterpreter--
my Meterpreter session 3, which

00:17:59.090 --> 00:18:01.800 align:middle line:84%
is unprivileged, and then I have
another Meterpreter session,

00:18:01.800 --> 00:18:03.830 align:middle line:90%
which is currently privileged.

00:18:03.830 --> 00:18:06.470 align:middle line:84%
And we're just going to
maintain access to both of them

00:18:06.470 --> 00:18:09.890 align:middle line:84%
as we are now going to perform
manual privilege escalation.

00:18:09.890 --> 00:18:12.740 align:middle line:84%
So I'm going to switch
over to session 3, which

00:18:12.740 --> 00:18:13.610 align:middle line:90%
is unprivileged.

00:18:13.610 --> 00:18:16.760 align:middle line:84%
And, of course, I'll verify
that is the case, getuid.

00:18:16.760 --> 00:18:19.190 align:middle line:84%
We're currently logged on
as the accountant, right?

00:18:19.190 --> 00:18:21.950 align:middle line:84%
So this is where we can
start exploring tools

00:18:21.950 --> 00:18:25.310 align:middle line:84%
like the Windows
exploit suggest.

00:18:25.310 --> 00:18:27.830 align:middle line:84%
All right, so as I said, the
GitHub repository or the link

00:18:27.830 --> 00:18:30.470 align:middle line:84%
to this GitHub repository
is posted in the slides,

00:18:30.470 --> 00:18:33.000 align:middle line:84%
and if we take a look at the
description, you can see,

00:18:33.000 --> 00:18:34.670 align:middle line:84%
as I mentioned in
the slides, this tool

00:18:34.670 --> 00:18:37.220 align:middle line:84%
compares a target's patch
level against the Microsoft

00:18:37.220 --> 00:18:40.790 align:middle line:84%
vulnerability database in order
to detect potential missing

00:18:40.790 --> 00:18:42.230 align:middle line:90%
patches on the target.

00:18:42.230 --> 00:18:44.510 align:middle line:84%
It requires the system
info command output

00:18:44.510 --> 00:18:47.490 align:middle line:84%
from a Windows host
in order to compare

00:18:47.490 --> 00:18:50.750 align:middle line:84%
to that of the Microsoft
security bulletin database

00:18:50.750 --> 00:18:53.220 align:middle line:84%
and determine the patch
level of the host.

00:18:53.220 --> 00:18:55.520 align:middle line:84%
So what this means
is that firstly,

00:18:55.520 --> 00:18:57.140 align:middle line:84%
you need to clone
this repository.

00:18:57.140 --> 00:18:59.360 align:middle line:84%
As you can see, it's
a Python 2 script.

00:18:59.360 --> 00:19:02.690 align:middle line:84%
You then need to run the
script with the update flag.

00:19:02.690 --> 00:19:06.560 align:middle line:84%
That will download the
Microsoft Vulnerability Database

00:19:06.560 --> 00:19:11.120 align:middle line:84%
and it's going to be
stored in an XLSX file

00:19:11.120 --> 00:19:15.410 align:middle line:84%
format, after which you can
then run the Windows exploit

00:19:15.410 --> 00:19:16.730 align:middle line:90%
suggester Python script.

00:19:16.730 --> 00:19:20.245 align:middle line:84%
Specify the database
that you just downloaded,

00:19:20.245 --> 00:19:22.370 align:middle line:84%
and that, of course, is
the vulnerability database.

00:19:22.370 --> 00:19:25.550 align:middle line:84%
You then need to specify
the system info argument

00:19:25.550 --> 00:19:28.670 align:middle line:84%
and then specify a text file
that contains the system

00:19:28.670 --> 00:19:31.460 align:middle line:84%
info or the output of
the system info command

00:19:31.460 --> 00:19:33.920 align:middle line:84%
that you've obtained
from the Windows target.

00:19:33.920 --> 00:19:36.770 align:middle line:84%
All right, so I have already
cloned this repository

00:19:36.770 --> 00:19:40.790 align:middle line:84%
on my system, and let's
get started firstly

00:19:40.790 --> 00:19:43.800 align:middle line:84%
by getting the actual
system info output.

00:19:43.800 --> 00:19:46.220 align:middle line:84%
So I currently have
access via Meterpreter,

00:19:46.220 --> 00:19:48.440 align:middle line:84%
and I'll just open up
a shell session here

00:19:48.440 --> 00:19:51.440 align:middle line:84%
to obtain a Windows command
prompt or a Windows command

00:19:51.440 --> 00:19:52.580 align:middle line:90%
shell session.

00:19:52.580 --> 00:19:53.370 align:middle line:90%
There we are.

00:19:53.370 --> 00:19:55.430 align:middle line:84%
So you can see, that's
a command shell session,

00:19:55.430 --> 00:20:01.470 align:middle line:84%
and I can then say sysinfo,
or system info rather,

00:20:01.470 --> 00:20:02.310 align:middle line:90%
and we'll hit Enter.

00:20:02.310 --> 00:20:05.680 align:middle line:90%


00:20:05.680 --> 00:20:07.330 align:middle line:84%
And this is the
information that you

00:20:07.330 --> 00:20:09.340 align:middle line:90%
need to copy into a text file.

00:20:09.340 --> 00:20:12.520 align:middle line:84%
So the reason this
information is very important

00:20:12.520 --> 00:20:15.820 align:middle line:84%
is because it actually contains
a list of hotfixes that have

00:20:15.820 --> 00:20:17.650 align:middle line:90%
been installed right over here.

00:20:17.650 --> 00:20:20.650 align:middle line:84%
And based on this, the
Windows exploits suggester

00:20:20.650 --> 00:20:23.800 align:middle line:84%
will determine what
exploits can be

00:20:23.800 --> 00:20:26.290 align:middle line:84%
used against this specific
version of Windows

00:20:26.290 --> 00:20:29.780 align:middle line:84%
with these hotfixes
installed, which is fantastic.

00:20:29.780 --> 00:20:32.588 align:middle line:84%
So I'll just copy this
information, like so.

00:20:32.588 --> 00:20:33.130 align:middle line:90%
There we are.

00:20:33.130 --> 00:20:36.110 align:middle line:84%
Copy, so I'll just
copy it there.

00:20:36.110 --> 00:20:39.785 align:middle line:84%
And what I'll do is I'll
terminate that channel,

00:20:39.785 --> 00:20:41.950 align:middle line:84%
and I'll go back into
my Meterpreter session,

00:20:41.950 --> 00:20:45.430 align:middle line:84%
and I'll open up a
new terminal here.

00:20:45.430 --> 00:20:47.830 align:middle line:84%
And I'll head over
onto my desktop,

00:20:47.830 --> 00:20:50.140 align:middle line:84%
and I'm going to create
a new text file with Vim.

00:20:50.140 --> 00:20:53.230 align:middle line:84%
So I'm going to just call
this Windows 7 dot txt,

00:20:53.230 --> 00:20:56.080 align:middle line:84%
and within this file, I'm going
to paste in what I copied.

00:20:56.080 --> 00:20:56.740 align:middle line:90%
There we are.

00:20:56.740 --> 00:21:00.670 align:middle line:84%
You can see all the information
has been copied successfully.

00:21:00.670 --> 00:21:03.520 align:middle line:84%
I'll then write in
quit, and you can

00:21:03.520 --> 00:21:06.490 align:middle line:84%
see that it's stored on my
desktop right over here.

00:21:06.490 --> 00:21:08.320 align:middle line:84%
All right, so now
that we have that,

00:21:08.320 --> 00:21:10.300 align:middle line:84%
I'm just going to
navigate to the directory

00:21:10.300 --> 00:21:13.540 align:middle line:84%
where I stored the Windows
exploits suggester script,

00:21:13.540 --> 00:21:16.000 align:middle line:84%
or where I cloned the
GitHub repository 2, which

00:21:16.000 --> 00:21:18.610 align:middle line:84%
is under-- in my case,
under Windows-Enum,

00:21:18.610 --> 00:21:22.480 align:middle line:84%
and then Windows exploit
suggester right over there.

00:21:22.480 --> 00:21:26.710 align:middle line:84%
All right, and as I said, within
this particular directory,

00:21:26.710 --> 00:21:30.190 align:middle line:84%
disregard these TXT
files here as these

00:21:30.190 --> 00:21:33.070 align:middle line:84%
are TXT files that
contain system information

00:21:33.070 --> 00:21:36.170 align:middle line:90%
for my previous engagements.

00:21:36.170 --> 00:21:38.870 align:middle line:84%
So you'll really just have
the Python script here.

00:21:38.870 --> 00:21:41.240 align:middle line:84%
You'll not have the
database at all.

00:21:41.240 --> 00:21:43.660 align:middle line:84%
So in your case,
during your first run,

00:21:43.660 --> 00:21:46.510 align:middle line:84%
you want to run Windows
exploit suggester dot py

00:21:46.510 --> 00:21:49.120 align:middle line:84%
and then update,
and that's going

00:21:49.120 --> 00:21:51.340 align:middle line:84%
to download a new
vulnerability database.

00:21:51.340 --> 00:21:51.970 align:middle line:90%
There we are.

00:21:51.970 --> 00:21:53.560 align:middle line:84%
You can see it's
going to be written

00:21:53.560 --> 00:21:56.710 align:middle line:84%
to the latest date or the
date when you actually

00:21:56.710 --> 00:21:57.580 align:middle line:90%
run the command.

00:21:57.580 --> 00:22:03.190 align:middle line:84%
In this case, I'm recording this
on the 26th of December, 2021.

00:22:03.190 --> 00:22:05.830 align:middle line:84%
So in order to run
this now, I can simply

00:22:05.830 --> 00:22:08.530 align:middle line:84%
say Windows exploits
suggester dot py,

00:22:08.530 --> 00:22:12.190 align:middle line:84%
and then I specify the
database, which, in this case,

00:22:12.190 --> 00:22:17.080 align:middle line:84%
is going to be the latest one,
so that I'm going to say 2021,

00:22:17.080 --> 00:22:22.120 align:middle line:84%
and we are currently in
December, so December the 26th.

00:22:22.120 --> 00:22:25.660 align:middle line:84%
And then I specify the system
info file, which we just

00:22:25.660 --> 00:22:29.500 align:middle line:84%
created, which is stored on
my desktop under the name

00:22:29.500 --> 00:22:32.700 align:middle line:84%
Windows 7 dot txt, and
that's pretty much it.

00:22:32.700 --> 00:22:35.500 align:middle line:84%
So once you hit
Enter, it's going

00:22:35.500 --> 00:22:37.360 align:middle line:90%
to say initiating winsploit.

00:22:37.360 --> 00:22:39.760 align:middle line:84%
The database file
detected as XLS

00:22:39.760 --> 00:22:42.580 align:middle line:84%
and it's then going to
essentially enumerate

00:22:42.580 --> 00:22:46.480 align:middle line:84%
a list of vulnerabilities here
that this particular version

00:22:46.480 --> 00:22:48.940 align:middle line:90%
of Windows is vulnerable to.

00:22:48.940 --> 00:22:51.250 align:middle line:84%
So there are quite
a few in this case.

00:22:51.250 --> 00:22:56.260 align:middle line:84%
Now, in this particular case,
or in the case of this tool,

00:22:56.260 --> 00:22:58.270 align:middle line:84%
the exploits listed
at the very top

00:22:58.270 --> 00:23:01.810 align:middle line:84%
are the ones that have the
highest chances of successfully

00:23:01.810 --> 00:23:02.810 align:middle line:90%
being exploited.

00:23:02.810 --> 00:23:04.940 align:middle line:84%
So let me just zoom
out a little bit here,

00:23:04.940 --> 00:23:08.710 align:middle line:84%
so the actual text is
rendered correctly.

00:23:08.710 --> 00:23:11.890 align:middle line:84%
You can see right over
here the system info input

00:23:11.890 --> 00:23:14.680 align:middle line:84%
file read successfully,
querying the database

00:23:14.680 --> 00:23:16.690 align:middle line:84%
file for potential
vulnerabilities,

00:23:16.690 --> 00:23:19.990 align:middle line:84%
comparing the two
hotfixes against the 386

00:23:19.990 --> 00:23:25.750 align:middle line:84%
potential bulletins with a
database of 137 known exploits,

00:23:25.750 --> 00:23:28.570 align:middle line:84%
and then, of course, you
can see that it will sort it

00:23:28.570 --> 00:23:32.470 align:middle line:84%
based on the ExploitDB
proof of concept code,

00:23:32.470 --> 00:23:36.360 align:middle line:84%
and that can be identified
using the E option.

00:23:36.360 --> 00:23:38.400 align:middle line:84%
If you see the M
option, that tells you

00:23:38.400 --> 00:23:40.890 align:middle line:84%
that there is a Metasploit
module available,

00:23:40.890 --> 00:23:43.500 align:middle line:84%
and if there is an asterisk,
that tells you that there

00:23:43.500 --> 00:23:45.540 align:middle line:90%
is a missing bulletin.

00:23:45.540 --> 00:23:48.990 align:middle line:84%
All right, so starting off with
the first most vulnerability,

00:23:48.990 --> 00:23:52.707 align:middle line:84%
this is the MS16-135
vulnerability.

00:23:52.707 --> 00:23:54.540 align:middle line:84%
So it gives you a bit
of a description here.

00:23:54.540 --> 00:23:57.360 align:middle line:84%
It says this is a security
update for Windows kernel mode

00:23:57.360 --> 00:23:58.180 align:middle line:90%
drivers.

00:23:58.180 --> 00:24:01.410 align:middle line:84%
So this is indeed a kernel
exploit or a vulnerability

00:24:01.410 --> 00:24:03.210 align:middle line:90%
within the Windows kernel.

00:24:03.210 --> 00:24:06.840 align:middle line:84%
And you can see it provides
you with ExploitDB code

00:24:06.840 --> 00:24:09.360 align:middle line:84%
here that you can use
to essentially exploit

00:24:09.360 --> 00:24:13.860 align:middle line:84%
the target, as well as a GitHub
repository that contains more

00:24:13.860 --> 00:24:16.800 align:middle line:84%
information about this
particular exploit

00:24:16.800 --> 00:24:18.210 align:middle line:84%
or this particular
vulnerability,

00:24:18.210 --> 00:24:20.580 align:middle line:84%
and then, of course,
this has the CVE code.

00:24:20.580 --> 00:24:23.130 align:middle line:84%
So this vulnerability was
discovered or disclosed

00:24:23.130 --> 00:24:27.750 align:middle line:84%
in 2016, as we can tell from the
Microsoft vulnerability ID as

00:24:27.750 --> 00:24:29.850 align:middle line:90%
well as the CVE code here.

00:24:29.850 --> 00:24:31.830 align:middle line:84%
If we take a look at
the ExploitDB code,

00:24:31.830 --> 00:24:35.080 align:middle line:84%
we can see that in
this particular case,

00:24:35.080 --> 00:24:38.290 align:middle line:84%
this is for the
Microsoft Windows kernel,

00:24:38.290 --> 00:24:42.150 align:middle line:84%
and this allows us to perform
privilege escalation right

00:24:42.150 --> 00:24:42.720 align:middle line:90%
over here.

00:24:42.720 --> 00:24:45.660 align:middle line:84%
So we can learn more
about this exploit

00:24:45.660 --> 00:24:49.230 align:middle line:84%
by copying the Microsoft
vulnerability ID there and just

00:24:49.230 --> 00:24:52.270 align:middle line:84%
performing a quick
Google search on it.

00:24:52.270 --> 00:24:52.930 align:middle line:90%
There we go.

00:24:52.930 --> 00:24:55.960 align:middle line:84%
So we can click on the
GitHub repository here,

00:24:55.960 --> 00:24:57.490 align:middle line:90%
which I wanted to demonstrate.

00:24:57.490 --> 00:25:01.020 align:middle line:84%
So I already have the Windows
kernel exploits GitHub

00:25:01.020 --> 00:25:03.240 align:middle line:90%
repository open by SecWiki.

00:25:03.240 --> 00:25:08.520 align:middle line:84%
This is a verifiable source
of Windows kernel exploits

00:25:08.520 --> 00:25:14.940 align:middle line:84%
that actually contains a list
of Windows kernel exploits,

00:25:14.940 --> 00:25:18.250 align:middle line:90%
as well as the actual CVE.

00:25:18.250 --> 00:25:20.658 align:middle line:84%
So if I just take
a step back here,

00:25:20.658 --> 00:25:22.200 align:middle line:84%
you can see that
they're sorted based

00:25:22.200 --> 00:25:27.520 align:middle line:84%
on CVE as well as the Microsoft
vulnerability identifier code.

00:25:27.520 --> 00:25:32.670 align:middle line:84%
And, in this case, we're looking
for the MS16-135 exploit,

00:25:32.670 --> 00:25:36.750 align:middle line:90%
so MS16-135.

00:25:36.750 --> 00:25:37.300 align:middle line:90%
There we are.

00:25:37.300 --> 00:25:38.290 align:middle line:90%
That's the one here.

00:25:38.290 --> 00:25:40.470 align:middle line:84%
And the great thing about
this GitHub repository

00:25:40.470 --> 00:25:42.240 align:middle line:84%
is it provides you
with the c code

00:25:42.240 --> 00:25:44.190 align:middle line:84%
that you can actually
go through and verify

00:25:44.190 --> 00:25:47.100 align:middle line:84%
that indeed this
particular executable

00:25:47.100 --> 00:25:49.920 align:middle line:84%
or this particular exploit
code does what it's supposed to

00:25:49.920 --> 00:25:52.650 align:middle line:84%
and isn't doing anything
malicious, which is

00:25:52.650 --> 00:25:54.360 align:middle line:90%
why I'm recommending it to you.

00:25:54.360 --> 00:25:57.850 align:middle line:84%
And you can then utilize this
code and compile it yourself.

00:25:57.850 --> 00:26:00.480 align:middle line:84%
I will not be covering
the actual compilation

00:26:00.480 --> 00:26:02.500 align:middle line:90%
of exploits within this course.

00:26:02.500 --> 00:26:05.450 align:middle line:84%
As I said, I'll be working
on that in another course

00:26:05.450 --> 00:26:08.400 align:middle line:84%
where we will be taking a
look at exploiting Windows

00:26:08.400 --> 00:26:10.650 align:middle line:84%
from the context
of buffer overflows

00:26:10.650 --> 00:26:12.570 align:middle line:84%
and how to write
your own exploits.

00:26:12.570 --> 00:26:16.050 align:middle line:84%
In this case, we'll be utilizing
the pre-built executable right

00:26:16.050 --> 00:26:21.330 align:middle line:84%
over here, so for 41015.exe
and the documentation

00:26:21.330 --> 00:26:23.040 align:middle line:84%
for this vulnerability
provides you

00:26:23.040 --> 00:26:27.150 align:middle line:84%
with information
regarding how to use it.

00:26:27.150 --> 00:26:29.070 align:middle line:84%
You can see it tells
you this exploit works

00:26:29.070 --> 00:26:31.500 align:middle line:84%
on all 64-bit
vulnerable targets,

00:26:31.500 --> 00:26:35.080 align:middle line:84%
and we can essentially
obtain a system shell.

00:26:35.080 --> 00:26:38.280 align:middle line:84%
So, in this case, it's
utilizing the PowerShell script,

00:26:38.280 --> 00:26:42.180 align:middle line:90%
which you can also utilize.

00:26:42.180 --> 00:26:44.580 align:middle line:84%
All you need to do
is just execute it,

00:26:44.580 --> 00:26:47.340 align:middle line:84%
after which it'll then provide
you with an elevated command

00:26:47.340 --> 00:26:48.330 align:middle line:90%
shell session.

00:26:48.330 --> 00:26:49.980 align:middle line:84%
And it provides you
with instructions

00:26:49.980 --> 00:26:52.980 align:middle line:84%
for multiple versions of
Windows, ranging from Windows 7

00:26:52.980 --> 00:26:56.070 align:middle line:84%
to a specific version
of Windows 10.

00:26:56.070 --> 00:26:57.720 align:middle line:84%
All right, so to
use this exploit,

00:26:57.720 --> 00:26:59.940 align:middle line:84%
I'm just going to download
the prebuilt binary

00:26:59.940 --> 00:27:01.840 align:middle line:90%
or the compiled binary here.

00:27:01.840 --> 00:27:04.045 align:middle line:84%
So I'll click on
that here, and we'll

00:27:04.045 --> 00:27:05.295 align:middle line:90%
give this a couple of seconds.

00:27:05.295 --> 00:27:10.180 align:middle line:90%


00:27:10.180 --> 00:27:10.680 align:middle line:90%
All right.

00:27:10.680 --> 00:27:13.940 align:middle line:84%
We'll then click on
Download, and I'm just

00:27:13.940 --> 00:27:16.700 align:middle line:84%
going to save it within
my downloads directory.

00:27:16.700 --> 00:27:19.760 align:middle line:84%
So we know that this
specific version of Windows

00:27:19.760 --> 00:27:22.700 align:middle line:84%
that I'm targeting is vulnerable
to this particular exploit,

00:27:22.700 --> 00:27:25.490 align:middle line:84%
so realistically,
all I need to do

00:27:25.490 --> 00:27:28.910 align:middle line:84%
is transfer this executable
onto the target system

00:27:28.910 --> 00:27:31.940 align:middle line:84%
and execute it, and I should
have elevated privileges.

00:27:31.940 --> 00:27:36.290 align:middle line:84%
Now, it's very important to
note that this, again, really

00:27:36.290 --> 00:27:39.890 align:middle line:84%
does not take into consideration
antivirus detection,

00:27:39.890 --> 00:27:42.290 align:middle line:84%
so you have to be very
cognizant of that.

00:27:42.290 --> 00:27:44.720 align:middle line:84%
As I said, we'll be
covering antivirus detection

00:27:44.720 --> 00:27:45.590 align:middle line:90%
in its own--

00:27:45.590 --> 00:27:49.640 align:middle line:84%
or bypassing antivirus in its
own course because that is

00:27:49.640 --> 00:27:54.020 align:middle line:84%
quite a lengthy subject, one
that I cannot cover in-depth

00:27:54.020 --> 00:27:55.230 align:middle line:90%
right now.

00:27:55.230 --> 00:27:55.730 align:middle line:90%
All right.

00:27:55.730 --> 00:27:59.000 align:middle line:84%
So, again, you can go through
the list of vulnerabilities

00:27:59.000 --> 00:28:02.780 align:middle line:84%
displayed or enumerated with
the Windows exploit suggester,

00:28:02.780 --> 00:28:06.020 align:middle line:84%
and you can take a look at some
of the other vulnerabilities

00:28:06.020 --> 00:28:08.870 align:middle line:84%
and exploits, and you can
test them out for yourself.

00:28:08.870 --> 00:28:12.620 align:middle line:84%
In my case, what I'll do is
I'll use my Meterpreter access

00:28:12.620 --> 00:28:16.070 align:middle line:84%
to upload this into the temp
directory within the Windows

00:28:16.070 --> 00:28:16.790 align:middle line:90%
system.

00:28:16.790 --> 00:28:21.650 align:middle line:84%
So the temp directory is stored
within the root of the Windows

00:28:21.650 --> 00:28:22.340 align:middle line:90%
file system.

00:28:22.340 --> 00:28:25.040 align:middle line:84%
So I can navigate to
the root of the C drive,

00:28:25.040 --> 00:28:27.290 align:middle line:84%
and then I can create
the temp directory

00:28:27.290 --> 00:28:29.030 align:middle line:90%
if it doesn't exist already.

00:28:29.030 --> 00:28:30.830 align:middle line:84%
However, in this
case, if I list out

00:28:30.830 --> 00:28:32.600 align:middle line:84%
of the contents of
the C drive, you

00:28:32.600 --> 00:28:36.050 align:middle line:84%
can see we have the temp
directory right over here.

00:28:36.050 --> 00:28:38.720 align:middle line:84%
So I can navigate
into the directory,

00:28:38.720 --> 00:28:42.290 align:middle line:84%
into the temp directory,
so I'll say, cd Temp.

00:28:42.290 --> 00:28:43.070 align:middle line:90%
There we are.

00:28:43.070 --> 00:28:45.290 align:middle line:84%
List out the contents
of the temp directory.

00:28:45.290 --> 00:28:47.570 align:middle line:84%
We have nothing within
that directory, right?

00:28:47.570 --> 00:28:50.420 align:middle line:84%
And the reason why I'm
using the temp directory

00:28:50.420 --> 00:28:54.410 align:middle line:84%
is because you never want to
use the home directory of a user

00:28:54.410 --> 00:28:57.230 align:middle line:84%
account because if you're
transferring your exploit code

00:28:57.230 --> 00:28:59.870 align:middle line:84%
or exploit files into a
directory that's frequently

00:28:59.870 --> 00:29:03.200 align:middle line:84%
accessed by legitimate
users on the target system,

00:29:03.200 --> 00:29:06.020 align:middle line:84%
then there's a good chance
that you'll be detected.

00:29:06.020 --> 00:29:08.330 align:middle line:84%
So always store any
files that you're

00:29:08.330 --> 00:29:11.480 align:middle line:84%
transferring onto a Windows
system into the temp directory.

00:29:11.480 --> 00:29:13.850 align:middle line:84%
And the same goes
for Linux systems,

00:29:13.850 --> 00:29:16.440 align:middle line:84%
and we'll be exploring
that once we get there.

00:29:16.440 --> 00:29:19.610 align:middle line:84%
So I can say upload
and I stored--

00:29:19.610 --> 00:29:22.370 align:middle line:84%
or we downloaded the
prebuilt or precompiled

00:29:22.370 --> 00:29:26.010 align:middle line:84%
exploit or executable
in the downloads folder.

00:29:26.010 --> 00:29:28.760 align:middle line:84%
So I'll say upload that
particular executable.

00:29:28.760 --> 00:29:29.550 align:middle line:90%
There we are.

00:29:29.550 --> 00:29:32.640 align:middle line:84%
So that's uploaded, and
I can also say shell.

00:29:32.640 --> 00:29:36.560 align:middle line:84%
And again, I've used I've
utilized this particular kernel

00:29:36.560 --> 00:29:38.690 align:middle line:84%
exploit before, and it
really is effective,

00:29:38.690 --> 00:29:42.260 align:middle line:84%
and in my experience, it hasn't
crashed any Windows system

00:29:42.260 --> 00:29:43.520 align:middle line:90%
that I've run it on.

00:29:43.520 --> 00:29:45.360 align:middle line:90%
Using it is fairly simple.

00:29:45.360 --> 00:29:48.560 align:middle line:84%
If I say dir, you can see it's
successfully been uploaded.

00:29:48.560 --> 00:29:50.300 align:middle line:90%
To execute it, we'll use--

00:29:50.300 --> 00:29:53.400 align:middle line:84%
we'll just say-- we'll execute
it through the Windows command

00:29:53.400 --> 00:29:53.900 align:middle line:90%
prompt.

00:29:53.900 --> 00:29:59.060 align:middle line:84%
So I'll say 41015.exe,
and if I hit Enter,

00:29:59.060 --> 00:30:01.010 align:middle line:84%
you'll see that
it will provide me

00:30:01.010 --> 00:30:03.410 align:middle line:84%
with documentation
as to how to use

00:30:03.410 --> 00:30:05.840 align:middle line:90%
this particular kernel exploit.

00:30:05.840 --> 00:30:08.570 align:middle line:84%
So it says please enter an
operating system version.

00:30:08.570 --> 00:30:10.640 align:middle line:84%
The following operating
system versions

00:30:10.640 --> 00:30:14.840 align:middle line:84%
are supported, Windows 7,
Windows 8.1, Windows 10 prior

00:30:14.840 --> 00:30:21.500 align:middle line:84%
to build release 14393,
and Windows Server 2012 R2.

00:30:21.500 --> 00:30:25.070 align:middle line:84%
So to use it, you simply
just execute the executable

00:30:25.070 --> 00:30:27.950 align:middle line:84%
and specify the version of
Windows that you're exploiting.

00:30:27.950 --> 00:30:34.910 align:middle line:84%
So again, I can simply just
say 41015.exe, and, of course,

00:30:34.910 --> 00:30:37.310 align:middle line:84%
you can rename this
to anything you want.

00:30:37.310 --> 00:30:38.690 align:middle line:90%
And I can hit seven.

00:30:38.690 --> 00:30:39.650 align:middle line:90%
I'll hit Enter.

00:30:39.650 --> 00:30:41.870 align:middle line:84%
Now, don't worry if it
doesn't give you any output.

00:30:41.870 --> 00:30:43.655 align:middle line:90%
This is exactly how this works.

00:30:43.655 --> 00:30:45.530 align:middle line:84%
So I'm going to give
this a couple of seconds

00:30:45.530 --> 00:30:47.510 align:middle line:84%
to actually complete,
after which you should

00:30:47.510 --> 00:30:49.760 align:middle line:84%
be provided with a
command shell session

00:30:49.760 --> 00:30:52.040 align:middle line:90%
with elevated privileges.

00:30:52.040 --> 00:30:53.780 align:middle line:84%
All right, so after
a couple of seconds,

00:30:53.780 --> 00:30:56.150 align:middle line:84%
you will see that you'll be
provided with a new command

00:30:56.150 --> 00:31:00.890 align:middle line:84%
shell session here, and I
can simply say who am I,

00:31:00.890 --> 00:31:03.060 align:middle line:84%
and you can see
anti-authority system.

00:31:03.060 --> 00:31:05.720 align:middle line:84%
So we've successfully been
able to elevate our privileges

00:31:05.720 --> 00:31:08.990 align:middle line:84%
by utilizing a kernel
exploit that we

00:31:08.990 --> 00:31:11.210 align:middle line:90%
obtained from a public source.

00:31:11.210 --> 00:31:13.160 align:middle line:84%
And, of course, as
I said, you can also

00:31:13.160 --> 00:31:15.020 align:middle line:84%
utilize the
Metasploit framework,

00:31:15.020 --> 00:31:17.450 align:middle line:84%
and that will automate
this entire process.

00:31:17.450 --> 00:31:20.120 align:middle line:84%
But as you can see, if
you perform it manually

00:31:20.120 --> 00:31:22.280 align:middle line:84%
and you enumerate the
vulnerabilities that

00:31:22.280 --> 00:31:25.370 align:middle line:84%
affect the specific version of
Windows that you're targeting,

00:31:25.370 --> 00:31:28.910 align:middle line:84%
you'll be able to get a much
broader scope in regards

00:31:28.910 --> 00:31:32.120 align:middle line:84%
to what types of exploits
are available for you

00:31:32.120 --> 00:31:36.890 align:middle line:84%
or what types of exploits are
available at your disposal.

00:31:36.890 --> 00:31:38.930 align:middle line:84%
So, as I said,
definitely try out

00:31:38.930 --> 00:31:42.230 align:middle line:84%
or experiment with this
within your own home lab.

00:31:42.230 --> 00:31:45.590 align:middle line:84%
I would recommend
downloading the Windows

00:31:45.590 --> 00:31:49.910 align:middle line:84%
VMs or multiple versions or
multiple releases of Windows

00:31:49.910 --> 00:31:51.560 align:middle line:90%
from the Microsoft website.

00:31:51.560 --> 00:31:54.620 align:middle line:84%
They allow you to
download the VMs for free,

00:31:54.620 --> 00:31:57.810 align:middle line:84%
and the licenses are
limited for 90 days.

00:31:57.810 --> 00:31:59.480 align:middle line:84%
So you can download
multiple versions

00:31:59.480 --> 00:32:03.050 align:middle line:84%
and test kernel
exploitation on both of them

00:32:03.050 --> 00:32:04.790 align:middle line:90%
or on all of these versions.

00:32:04.790 --> 00:32:07.100 align:middle line:84%
Now, as I said, I
really don't recommend

00:32:07.100 --> 00:32:09.740 align:middle line:84%
running kernel exploits in
a production environment

00:32:09.740 --> 00:32:13.050 align:middle line:84%
or in an enterprise environment
unless you've tested them

00:32:13.050 --> 00:32:16.470 align:middle line:84%
as I have just done with this
particular kernel exploit,

00:32:16.470 --> 00:32:19.350 align:middle line:84%
and I do know that it
is relatively stable

00:32:19.350 --> 00:32:22.480 align:middle line:84%
and I haven't experienced
any crashes with it before.

00:32:22.480 --> 00:32:24.330 align:middle line:84%
All right, so this
is going to conclude

00:32:24.330 --> 00:32:28.230 align:middle line:84%
the practical demonstration
side of this video.

00:32:28.230 --> 00:32:28.730 align:middle line:90%
All right.

00:32:28.730 --> 00:32:33.080 align:middle line:84%
So now that we've explored
kernel exploitation on Windows,

00:32:33.080 --> 00:32:36.830 align:middle line:84%
we can move on to the next
privilege escalation vector

00:32:36.830 --> 00:32:40.410 align:middle line:84%
that we can use on Windows
systems, and that, of course,

00:32:40.410 --> 00:32:44.630 align:middle line:84%
is bypassing UAC or bypassing
user access control.

00:32:44.630 --> 00:32:47.660 align:middle line:84%
And again, that is one of my
favorite privilege escalation

00:32:47.660 --> 00:32:49.590 align:middle line:90%
vectors, and you will see why.

00:32:49.590 --> 00:32:53.260 align:middle line:84%
So I'll see you
in the next video.

00:32:53.260 --> 00:32:54.000 align:middle line:90%