WEBVTT

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


00:00:03.367 --> 00:00:10.110 align:middle line:90%
[AUDIO LOGO]

00:00:10.110 --> 00:00:12.780 align:middle line:84%
Windows post
exploitation modules.

00:00:12.780 --> 00:00:15.840 align:middle line:84%
Welcome to the Windows
post exploitation section

00:00:15.840 --> 00:00:19.470 align:middle line:84%
where we will be focusing on
the various post exploitation

00:00:19.470 --> 00:00:21.390 align:middle line:90%
techniques on Windows.

00:00:21.390 --> 00:00:24.240 align:middle line:84%
And then once we're done with
the Windows post exploitation

00:00:24.240 --> 00:00:26.040 align:middle line:84%
section, we'll then
move on to Linux.

00:00:26.040 --> 00:00:29.340 align:middle line:84%
So to get started
with this section,

00:00:29.340 --> 00:00:33.150 align:middle line:84%
one of the key or one of
the most important elements

00:00:33.150 --> 00:00:36.090 align:middle line:84%
of the Metasploit framework
as we already explored

00:00:36.090 --> 00:00:38.850 align:middle line:84%
is the various
modules available.

00:00:38.850 --> 00:00:41.790 align:middle line:84%
And we've taken a look at how
to utilize exploit modules

00:00:41.790 --> 00:00:45.720 align:middle line:84%
and it's now time to begin
exploring the various post

00:00:45.720 --> 00:00:46.950 align:middle line:90%
exploitation modules.

00:00:46.950 --> 00:00:50.310 align:middle line:84%
And in specific, we're
referring to the Windows post

00:00:50.310 --> 00:00:51.810 align:middle line:90%
exploitation modules.

00:00:51.810 --> 00:00:55.530 align:middle line:84%
So the Metasploit framework,
as we already know,

00:00:55.530 --> 00:00:58.350 align:middle line:84%
provides us with various
post exploitation modules

00:00:58.350 --> 00:01:00.300 align:middle line:90%
for both Windows and Linux.

00:01:00.300 --> 00:01:02.940 align:middle line:84%
We can utilize these
post exploitation modules

00:01:02.940 --> 00:01:05.340 align:middle line:84%
to enumerate information
about the Windows system

00:01:05.340 --> 00:01:07.560 align:middle line:84%
that we currently
have access to,

00:01:07.560 --> 00:01:10.110 align:middle line:84%
and some of this information
that we're interested in

00:01:10.110 --> 00:01:13.510 align:middle line:84%
is, for example, the user
privilege information.

00:01:13.510 --> 00:01:16.620 align:middle line:84%
So we have the ability to
enumerate the user privileges

00:01:16.620 --> 00:01:19.110 align:middle line:84%
for the current user
that we have access

00:01:19.110 --> 00:01:21.330 align:middle line:84%
to within our
Meterpreter session.

00:01:21.330 --> 00:01:23.980 align:middle line:84%
We can also enumerate
the logged on users,

00:01:23.980 --> 00:01:26.400 align:middle line:84%
which is very, very,
very helpful in getting

00:01:26.400 --> 00:01:29.010 align:middle line:84%
an idea of what users
are currently logged in

00:01:29.010 --> 00:01:32.220 align:middle line:84%
as well as users that
have previously logged

00:01:32.220 --> 00:01:33.750 align:middle line:90%
in or recently logged in.

00:01:33.750 --> 00:01:36.120 align:middle line:84%
We can also check
whether the actual target

00:01:36.120 --> 00:01:38.400 align:middle line:84%
system is a virtual
machine, and that

00:01:38.400 --> 00:01:43.350 align:middle line:84%
again, can be important in
staging your next attack

00:01:43.350 --> 00:01:45.120 align:middle line:90%
within the network.

00:01:45.120 --> 00:01:47.790 align:middle line:84%
You can also enumerate the
programs that are currently

00:01:47.790 --> 00:01:50.700 align:middle line:84%
installed on the target
system, which again can be very

00:01:50.700 --> 00:01:52.920 align:middle line:84%
helpful during the
privilege escalation process

00:01:52.920 --> 00:01:55.590 align:middle line:84%
because you may find
a specific version

00:01:55.590 --> 00:01:58.950 align:middle line:84%
or a specific program
that's installed

00:01:58.950 --> 00:02:02.700 align:middle line:84%
that could be vulnerable to a
privilege escalation attack.

00:02:02.700 --> 00:02:05.730 align:middle line:84%
We also have the ability
to enumerate the antivirus

00:02:05.730 --> 00:02:08.680 align:middle line:84%
solutions that are currently
installed on the system,

00:02:08.680 --> 00:02:13.170 align:middle line:84%
giving us an idea of what
we can and cannot do.

00:02:13.170 --> 00:02:15.180 align:middle line:84%
We can also enumerate
the computers that

00:02:15.180 --> 00:02:17.020 align:middle line:90%
are connected to the domain.

00:02:17.020 --> 00:02:20.280 align:middle line:84%
So again, if the target system
is part of a Windows domain,

00:02:20.280 --> 00:02:22.080 align:middle line:84%
we can enumerate
the other computers

00:02:22.080 --> 00:02:24.180 align:middle line:84%
that are a part of the
domain, which again

00:02:24.180 --> 00:02:27.660 align:middle line:84%
can be very helpful in
performing pivoting or getting

00:02:27.660 --> 00:02:31.050 align:middle line:84%
an idea of what other systems
are currently on the target

00:02:31.050 --> 00:02:32.250 align:middle line:90%
network.

00:02:32.250 --> 00:02:34.710 align:middle line:84%
We can also enumerate
the installed patches

00:02:34.710 --> 00:02:37.030 align:middle line:84%
or the installed updates
on the Windows system.

00:02:37.030 --> 00:02:40.540 align:middle line:84%
So we can get an idea of what
patches have been installed,

00:02:40.540 --> 00:02:44.440 align:middle line:84%
which again can be very useful
if we are trying to identify

00:02:44.440 --> 00:02:46.740 align:middle line:84%
what exploits can
actually be used

00:02:46.740 --> 00:02:50.730 align:middle line:84%
to elevate our privileges on
this particular Windows system.

00:02:50.730 --> 00:02:53.350 align:middle line:84%
And of course, you have the
ability to enumerate shares.

00:02:53.350 --> 00:02:55.830 align:middle line:84%
So there are post
exploitation modules

00:02:55.830 --> 00:02:58.660 align:middle line:84%
that can be used to enumerate
all of this information.

00:02:58.660 --> 00:03:02.920 align:middle line:84%
And that's what we are going to
be exploring within this video.

00:03:02.920 --> 00:03:05.955 align:middle line:84%
We are also going to be taking
a look at the various Windows

00:03:05.955 --> 00:03:07.860 align:middle line:84%
Meterpreter commands
that we couldn't

00:03:07.860 --> 00:03:11.190 align:middle line:84%
explore during the Meterpreter
fundamentals video.

00:03:11.190 --> 00:03:13.560 align:middle line:84%
And again, this will
give you an idea

00:03:13.560 --> 00:03:15.060 align:middle line:90%
of what we can do on Windows.

00:03:15.060 --> 00:03:18.150 align:middle line:84%
And then once we move on
to Linux or the Linux post

00:03:18.150 --> 00:03:20.400 align:middle line:84%
exploitation section,
we'll also explore

00:03:20.400 --> 00:03:24.840 align:middle line:84%
the various post exploitation
modules associated with Linux.

00:03:24.840 --> 00:03:27.660 align:middle line:84%
So in this case,
the lab environment

00:03:27.660 --> 00:03:32.430 align:middle line:84%
that we're going to be utilizing
is the Windows HTTP file server

00:03:32.430 --> 00:03:36.360 align:middle line:84%
lab that we utilize when we
were exploiting the HTTP file

00:03:36.360 --> 00:03:37.660 align:middle line:90%
server.

00:03:37.660 --> 00:03:39.820 align:middle line:84%
And again, it's going
to be fairly simple.

00:03:39.820 --> 00:03:41.820 align:middle line:84%
We're going to gain access
to the target system,

00:03:41.820 --> 00:03:44.010 align:middle line:84%
and then we're going
to begin performing

00:03:44.010 --> 00:03:46.830 align:middle line:84%
the local enumeration or
performing enumeration

00:03:46.830 --> 00:03:49.920 align:middle line:84%
with the various post
exploitation modules available.

00:03:49.920 --> 00:03:52.590 align:middle line:84%
All right, so I'll see you
within the lab environment.

00:03:52.590 --> 00:03:55.350 align:middle line:90%


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

00:03:57.940 --> 00:04:01.380 align:middle line:84%
And in this case, we actually
get the target IP address

00:04:01.380 --> 00:04:03.490 align:middle line:84%
specified for us,
which is great.

00:04:03.490 --> 00:04:05.670 align:middle line:84%
So I'm just going to
copy that, and we'll

00:04:05.670 --> 00:04:07.810 align:middle line:90%
open up a terminal here.

00:04:07.810 --> 00:04:08.310 align:middle line:90%
There we go.

00:04:08.310 --> 00:04:10.750 align:middle line:84%
I'll just maximize it and
increase the font size

00:04:10.750 --> 00:04:12.660 align:middle line:90%
so you can see what's going on.

00:04:12.660 --> 00:04:14.470 align:middle line:84%
All right, so
first and foremost,

00:04:14.470 --> 00:04:17.079 align:middle line:84%
we need to start up the
PostgreSQL Database Service.

00:04:17.079 --> 00:04:22.770 align:middle line:84%
So I'm going to say start
service postgresql start

00:04:22.770 --> 00:04:26.310 align:middle line:84%
and we can also execute
the msfconsole command

00:04:26.310 --> 00:04:30.760 align:middle line:84%
by using the double ampersand
commands or keys, if you will.

00:04:30.760 --> 00:04:32.340 align:middle line:84%
So we're going to
say msfconsole,

00:04:32.340 --> 00:04:35.820 align:middle line:84%
and this will essentially start
up both the PostgreSQL database

00:04:35.820 --> 00:04:39.930 align:middle line:84%
server and msfconsole within
a single command, which again

00:04:39.930 --> 00:04:41.440 align:middle line:90%
will save us a lot of time.

00:04:41.440 --> 00:04:44.520 align:middle line:84%
So there we are starting the
Metasploit framework console,

00:04:44.520 --> 00:04:47.070 align:middle line:84%
and we want to create
a workspace here,

00:04:47.070 --> 00:04:52.350 align:middle line:84%
and we are just going
to call it windows_post.

00:04:52.350 --> 00:04:54.000 align:middle line:90%
There we are.

00:04:54.000 --> 00:04:54.840 align:middle line:90%
Fantastic.

00:04:54.840 --> 00:04:57.990 align:middle line:84%
So we are going to set up the
global variable for the RHOSTS

00:04:57.990 --> 00:05:00.570 align:middle line:84%
option so that we
don't need to keep

00:05:00.570 --> 00:05:03.390 align:middle line:84%
typing the IP address
or the target IP

00:05:03.390 --> 00:05:05.340 align:middle line:84%
address whenever
we load a module.

00:05:05.340 --> 00:05:06.240 align:middle line:90%
There we are.

00:05:06.240 --> 00:05:08.070 align:middle line:84%
And as I said, in
this case, we still

00:05:08.070 --> 00:05:09.810 align:middle line:84%
need to gain access
to the target system.

00:05:09.810 --> 00:05:11.310 align:middle line:84%
And in this case,
we are going to be

00:05:11.310 --> 00:05:15.480 align:middle line:84%
exploring the vulnerable
Rejetto HTTP file server.

00:05:15.480 --> 00:05:17.940 align:middle line:84%
So we are just going
to perform a quick Nmap

00:05:17.940 --> 00:05:19.200 align:middle line:90%
scan on the target.

00:05:19.200 --> 00:05:21.060 align:middle line:84%
We're using the
db_map command, which

00:05:21.060 --> 00:05:24.060 align:middle line:84%
allows us to perform an Nmap
scan from within msfconsole

00:05:24.060 --> 00:05:25.890 align:middle line:84%
and consequently
save the Nmap scan

00:05:25.890 --> 00:05:28.750 align:middle line:84%
results into the Metasploit
framework database.

00:05:28.750 --> 00:05:31.470 align:middle line:84%
So I'm going to perform
a service detection scan,

00:05:31.470 --> 00:05:34.890 align:middle line:84%
and I'll provide the
target IP there, hit Enter.

00:05:34.890 --> 00:05:38.270 align:middle line:84%
And I'm just going to
wait for that to complete.

00:05:38.270 --> 00:05:40.810 align:middle line:84%
All right, so once the
Nmap scan is complete,

00:05:40.810 --> 00:05:44.650 align:middle line:84%
as you can see here, we have
the HTTP file server running,

00:05:44.650 --> 00:05:47.240 align:middle line:84%
and this is the Rejetto
HTTP file server

00:05:47.240 --> 00:05:50.500 align:middle line:84%
version 2.3, which as
we know, is vulnerable,

00:05:50.500 --> 00:05:53.290 align:middle line:84%
so we can essentially just
search for the exploit.

00:05:53.290 --> 00:05:57.810 align:middle line:84%
So I'm just going to
say search rejetto.

00:05:57.810 --> 00:05:59.400 align:middle line:84%
And this is the
exploit module that we

00:05:59.400 --> 00:06:02.350 align:middle line:84%
had utilized during the
Windows exploitation section.

00:06:02.350 --> 00:06:05.710 align:middle line:84%
So I'm going to say use,
paste that in there.

00:06:05.710 --> 00:06:09.210 align:middle line:84%
If we show the options
here, the only option

00:06:09.210 --> 00:06:11.620 align:middle line:84%
that we need to specify
is the target IP,

00:06:11.620 --> 00:06:13.860 align:middle line:84%
which is done for
us automatically

00:06:13.860 --> 00:06:17.310 align:middle line:84%
because we set the global
variable for the RHOSTS option.

00:06:17.310 --> 00:06:18.810 align:middle line:90%
So we can just hit run.

00:06:18.810 --> 00:06:24.090 align:middle line:90%


00:06:24.090 --> 00:06:26.740 align:middle line:84%
All right, so it looks like
we get a Meterpreter session.

00:06:26.740 --> 00:06:30.900 align:middle line:84%
So we're just going to wait
for it to actually pop up.

00:06:30.900 --> 00:06:33.210 align:middle line:84%
There we are, so we get
the Meterpreter session

00:06:33.210 --> 00:06:37.380 align:middle line:84%
and we can actually explore
some of the Windows Meterpreter

00:06:37.380 --> 00:06:39.520 align:middle line:84%
commands that we couldn't
explore previously.

00:06:39.520 --> 00:06:43.710 align:middle line:84%
So again, if I type in sysinfo,
which will work either way,

00:06:43.710 --> 00:06:47.440 align:middle line:84%
you can see that the computer
hostname is right over here.

00:06:47.440 --> 00:06:50.470 align:middle line:84%
We then have the operating
system version, in this case,

00:06:50.470 --> 00:06:55.650 align:middle line:84%
we are running a Windows
2012 R2 6.3 build 9600.

00:06:55.650 --> 00:06:59.490 align:middle line:84%
The target operating system
architecture is 64-bit

00:06:59.490 --> 00:07:02.700 align:middle line:84%
and the Meterpreter
architecture is 32-bit.

00:07:02.700 --> 00:07:04.990 align:middle line:90%
So we can actually upgrade that.

00:07:04.990 --> 00:07:07.590 align:middle line:84%
But before we do that
and we'll be exploring

00:07:07.590 --> 00:07:10.350 align:middle line:84%
a post exploitation module
that can automatically

00:07:10.350 --> 00:07:13.200 align:middle line:84%
do that for us, before we do
that, again, if we type in

00:07:13.200 --> 00:07:15.660 align:middle line:84%
get user ID, you can
see that we're currently

00:07:15.660 --> 00:07:18.630 align:middle line:84%
the administrator on
this particular system.

00:07:18.630 --> 00:07:22.530 align:middle line:84%
But if we open up the Help
menu or the documentation

00:07:22.530 --> 00:07:24.780 align:middle line:84%
for Meterpreter, you
can see that we now

00:07:24.780 --> 00:07:26.400 align:middle line:84%
have additional
commands, and this

00:07:26.400 --> 00:07:28.570 align:middle line:84%
is because we are now
on a Windows system.

00:07:28.570 --> 00:07:30.870 align:middle line:84%
So we have the
ability to type in the

00:07:30.870 --> 00:07:32.520 align:middle line:84%
get system command,
which will attempt

00:07:32.520 --> 00:07:35.190 align:middle line:84%
to elevate your privileges
and we'll test that out

00:07:35.190 --> 00:07:35.860 align:middle line:90%
in a second.

00:07:35.860 --> 00:07:38.430 align:middle line:84%
We can also dump the
contents of the SAM database

00:07:38.430 --> 00:07:40.410 align:middle line:90%
using the hashdump command.

00:07:40.410 --> 00:07:42.700 align:middle line:84%
A few others are like
the webcam command.

00:07:42.700 --> 00:07:45.090 align:middle line:84%
So if the target system
has a webcam attached,

00:07:45.090 --> 00:07:49.410 align:middle line:84%
we can essentially list out
the webcams, take a snapshot,

00:07:49.410 --> 00:07:52.250 align:middle line:84%
start a video chat, record
audio from the microphone.

00:07:52.250 --> 00:07:55.020 align:middle line:84%
So there is really, really
cool stuff that we can do here

00:07:55.020 --> 00:07:57.690 align:middle line:84%
when we are again running
on a Windows target

00:07:57.690 --> 00:08:00.480 align:middle line:84%
or when we have an Meterpreter
session on a Windows target.

00:08:00.480 --> 00:08:02.740 align:middle line:84%
We also have some user
interface commands.

00:08:02.740 --> 00:08:06.360 align:middle line:84%
So we can essentially list all
accessible desktops and Windows

00:08:06.360 --> 00:08:11.460 align:middle line:84%
stations, we can also
start a key logger.

00:08:11.460 --> 00:08:14.940 align:middle line:84%
So we can essentially
say keyscan_start,

00:08:14.940 --> 00:08:17.520 align:middle line:84%
and then we can stop
it whenever we are done

00:08:17.520 --> 00:08:20.930 align:middle line:84%
and then dump the
actual keystroke buffer.

00:08:20.930 --> 00:08:24.620 align:middle line:84%
And in this case, we can pretty
much interact with the mouse,

00:08:24.620 --> 00:08:27.830 align:middle line:84%
take a desktop of the screen
or rather a screenshot

00:08:27.830 --> 00:08:28.610 align:middle line:90%
of the desktop.

00:08:28.610 --> 00:08:33.370 align:middle line:84%
So again, if we
type in screenshot,

00:08:33.370 --> 00:08:34.960 align:middle line:84%
give that a few
seconds, you can see

00:08:34.960 --> 00:08:38.650 align:middle line:84%
it's going to be saved within
the actual current working

00:08:38.650 --> 00:08:39.230 align:middle line:90%
directory.

00:08:39.230 --> 00:08:42.980 align:middle line:84%
So if I open up a new tab here
or if I open up the actual File

00:08:42.980 --> 00:08:45.310 align:middle line:84%
Explorer, you can
see that we actually

00:08:45.310 --> 00:08:46.790 align:middle line:90%
get a screenshot saved.

00:08:46.790 --> 00:08:49.180 align:middle line:84%
And you can see, indeed, it
is running Windows Server.

00:08:49.180 --> 00:08:53.500 align:middle line:84%
So Meterpreter on Windows is
really, really, really powerful

00:08:53.500 --> 00:08:56.830 align:middle line:84%
in regards to what we can
do on the target system.

00:08:56.830 --> 00:08:59.290 align:middle line:84%
There are a few other
commands that we can also

00:08:59.290 --> 00:09:03.440 align:middle line:84%
perform or execute, and we'll be
exploring them as we progress.

00:09:03.440 --> 00:09:05.980 align:middle line:84%
But in terms of navigating
the file system,

00:09:05.980 --> 00:09:09.860 align:middle line:84%
it's pretty much the same
on both Windows and Linux.

00:09:09.860 --> 00:09:11.620 align:middle line:84%
So let's explore some
interesting commands

00:09:11.620 --> 00:09:15.040 align:middle line:84%
that we can utilize to perform
some local enumeration manually

00:09:15.040 --> 00:09:17.620 align:middle line:84%
with Meterpreter operator
before we explore the post

00:09:17.620 --> 00:09:19.000 align:middle line:90%
exploitation modules.

00:09:19.000 --> 00:09:22.510 align:middle line:84%
So we can utilize the getsystem
command to essentially

00:09:22.510 --> 00:09:24.040 align:middle line:90%
try and elevate our privileges.

00:09:24.040 --> 00:09:26.290 align:middle line:84%
So if I say
getsystem, you can see

00:09:26.290 --> 00:09:29.920 align:middle line:84%
it's going to say got system via
technique 1, which is the named

00:09:29.920 --> 00:09:33.280 align:middle line:84%
pipe impersonation or token
impersonation privilege

00:09:33.280 --> 00:09:34.670 align:middle line:90%
escalation technique.

00:09:34.670 --> 00:09:37.540 align:middle line:84%
So if I now say getuserid,
you can see we now

00:09:37.540 --> 00:09:39.250 align:middle line:90%
have administrative privileges.

00:09:39.250 --> 00:09:43.600 align:middle line:84%
So we have anti-authority system
privileges which, as we know,

00:09:43.600 --> 00:09:46.820 align:middle line:84%
this is the highest level of
privilege on a Windows system,

00:09:46.820 --> 00:09:47.780 align:middle line:90%
which is great.

00:09:47.780 --> 00:09:50.860 align:middle line:84%
We can also run the hashdump
command to dump hashes.

00:09:50.860 --> 00:09:54.040 align:middle line:84%
And in this case, it looks
like that failed primarily

00:09:54.040 --> 00:09:57.070 align:middle line:84%
because we may not have access
to the SAM database, which

00:09:57.070 --> 00:09:59.410 align:middle line:90%
is perfectly fine.

00:09:59.410 --> 00:10:03.220 align:middle line:84%
A few other really, really
cool commands that we can run

00:10:03.220 --> 00:10:05.540 align:middle line:84%
are commands like the
show_mount command.

00:10:05.540 --> 00:10:09.160 align:middle line:84%
So if I just type
that in, show_mount,

00:10:09.160 --> 00:10:12.670 align:middle line:84%
this will essentially display
a list of mounts or drives

00:10:12.670 --> 00:10:14.030 align:middle line:90%
attached to the system.

00:10:14.030 --> 00:10:16.180 align:middle line:84%
So you can see we
have the C drive here.

00:10:16.180 --> 00:10:19.390 align:middle line:84%
It also tells us the
type, whether it's fixed

00:10:19.390 --> 00:10:21.130 align:middle line:84%
or whether it is
actually removable.

00:10:21.130 --> 00:10:23.050 align:middle line:84%
In the case of removable,
that would typically

00:10:23.050 --> 00:10:25.600 align:middle line:84%
indicate that this
is a USB flash drive

00:10:25.600 --> 00:10:27.880 align:middle line:90%
or an external hard drive.

00:10:27.880 --> 00:10:31.390 align:middle line:84%
So the size is 30 gigabytes
and the amount available

00:10:31.390 --> 00:10:32.950 align:middle line:90%
is eight gigabytes.

00:10:32.950 --> 00:10:35.950 align:middle line:84%
It can also display whether
this particular disk has

00:10:35.950 --> 00:10:38.410 align:middle line:90%
been mapped, which is awesome.

00:10:38.410 --> 00:10:41.890 align:middle line:84%
So that is the process of
essentially enumerating

00:10:41.890 --> 00:10:46.070 align:middle line:84%
the actual mounts and drives
attached to the Windows target.

00:10:46.070 --> 00:10:48.170 align:middle line:84%
We can also run a few
other interesting commands.

00:10:48.170 --> 00:10:50.080 align:middle line:84%
So we list out the
process tree, you

00:10:50.080 --> 00:10:52.990 align:middle line:84%
can see that we have all
of these processes here,

00:10:52.990 --> 00:10:56.410 align:middle line:84%
and they are sorted by
process ID, PPID, name.

00:10:56.410 --> 00:10:59.330 align:middle line:84%
the architecture, session,
user, and the path.

00:10:59.330 --> 00:11:03.010 align:middle line:84%
So if we wanted to migrate
maybe to explore a .exe,

00:11:03.010 --> 00:11:08.020 align:middle line:84%
we can do that by, again,
either utilizing the process ID

00:11:08.020 --> 00:11:09.740 align:middle line:84%
or the actual name
of the process.

00:11:09.740 --> 00:11:14.890 align:middle line:84%
So I can say migrate, and then
to the process ID 2212, which

00:11:14.890 --> 00:11:21.340 align:middle line:84%
is, again, is a 64-bit process,
which means our Meterpreter

00:11:21.340 --> 00:11:23.170 align:middle line:90%
session will also be upgraded.

00:11:23.170 --> 00:11:25.877 align:middle line:84%
So if I say migrate
2212 and hit Enter,

00:11:25.877 --> 00:11:27.460 align:middle line:84%
you can see it's
going to say migrate,

00:11:27.460 --> 00:11:29.170 align:middle line:84%
it's going to
migrate that process.

00:11:29.170 --> 00:11:31.910 align:middle line:84%
There we are, migrations
completed successfully.

00:11:31.910 --> 00:11:34.960 align:middle line:84%
So if I type in
sysinfo, you can see

00:11:34.960 --> 00:11:37.210 align:middle line:84%
that we now have a
64-bit Meterpreter

00:11:37.210 --> 00:11:38.690 align:middle line:90%
session, which is awesome.

00:11:38.690 --> 00:11:40.690 align:middle line:84%
So we can do quite a lot
of interesting things

00:11:40.690 --> 00:11:42.760 align:middle line:84%
that we couldn't do
on a Linux system,

00:11:42.760 --> 00:11:45.670 align:middle line:84%
primarily because
Linux systems are

00:11:45.670 --> 00:11:47.920 align:middle line:84%
different in terms
of the architecture

00:11:47.920 --> 00:11:50.020 align:middle line:90%
and the way they are built.

00:11:50.020 --> 00:11:52.430 align:middle line:84%
So we can pretty much
do what we could before.

00:11:52.430 --> 00:11:54.520 align:middle line:84%
So we can download
files, upload files.

00:11:54.520 --> 00:11:57.580 align:middle line:84%
If I say directory
here or ls, this

00:11:57.580 --> 00:11:59.530 align:middle line:84%
will list out the current
working directory,

00:11:59.530 --> 00:12:02.290 align:middle line:84%
and then I can navigate
to the root of the C drive

00:12:02.290 --> 00:12:05.358 align:middle line:84%
and then list out the
actual directory here

00:12:05.358 --> 00:12:06.400 align:middle line:90%
or the directory is here.

00:12:06.400 --> 00:12:08.240 align:middle line:90%
And we have a flag.txt file.

00:12:08.240 --> 00:12:12.040 align:middle line:84%
So let's actually cut the
content of that flag.txt file

00:12:12.040 --> 00:12:14.290 align:middle line:90%
and we get the flag there.

00:12:14.290 --> 00:12:16.660 align:middle line:84%
We can print out our
current working directory,

00:12:16.660 --> 00:12:19.040 align:middle line:84%
we can download
the flag.txt file.

00:12:19.040 --> 00:12:22.630 align:middle line:84%
So you can say download
flag.txt, that'll download it

00:12:22.630 --> 00:12:24.340 align:middle line:90%
for us onto our local system.

00:12:24.340 --> 00:12:25.810 align:middle line:90%
Really, really simple.

00:12:25.810 --> 00:12:30.010 align:middle line:84%
OK, so that is
Meterpreter on Windows.

00:12:30.010 --> 00:12:32.890 align:middle line:84%
And you can, of course, explore
all of the other commands.

00:12:32.890 --> 00:12:35.740 align:middle line:84%
What we're going to do now
is put this in the background

00:12:35.740 --> 00:12:39.100 align:middle line:84%
because we want to run some
post exploitation modules.

00:12:39.100 --> 00:12:41.080 align:middle line:90%
So I'm going to say sessions.

00:12:41.080 --> 00:12:44.520 align:middle line:84%
And as you can see, we currently
have our Meterpreter session

00:12:44.520 --> 00:12:45.020 align:middle line:90%
here.

00:12:45.020 --> 00:12:47.710 align:middle line:84%
So let's take a look at some
of the post exploitation

00:12:47.710 --> 00:12:49.280 align:middle line:90%
modules we can use.

00:12:49.280 --> 00:12:51.550 align:middle line:84%
So first and
foremost, if you ever

00:12:51.550 --> 00:12:54.940 align:middle line:84%
want to migrate or
essentially change

00:12:54.940 --> 00:12:57.040 align:middle line:84%
the architecture of the
Meterpreter payload,

00:12:57.040 --> 00:12:59.630 align:middle line:84%
we can utilize a
module called upgrade.

00:12:59.630 --> 00:13:01.690 align:middle line:84%
So I'm just going to
search for upgrade here.

00:13:01.690 --> 00:13:08.100 align:middle line:84%
And we can actually
limit this to Windows

00:13:08.100 --> 00:13:11.040 align:middle line:84%
and we should have
the upgrade, we

00:13:11.040 --> 00:13:15.700 align:middle line:84%
should have the upgrade
modules somewhere here.

00:13:15.700 --> 00:13:17.440 align:middle line:84%
For some reason, I
can't see this because

00:13:17.440 --> 00:13:19.810 align:middle line:90%
of the way this is actually--

00:13:19.810 --> 00:13:23.960 align:middle line:84%
I'm just going to zoom
out a little bit here.

00:13:23.960 --> 00:13:26.610 align:middle line:84%
Right, I can't
actually see that here.

00:13:26.610 --> 00:13:29.960 align:middle line:84%
Let's change or get rid
of the platform there.

00:13:29.960 --> 00:13:36.160 align:middle line:84%
If we search upgrade or
migrate, there we are.

00:13:36.160 --> 00:13:39.220 align:middle line:84%
So we have the ability to
migrate or essentially change

00:13:39.220 --> 00:13:40.370 align:middle line:90%
the architecture.

00:13:40.370 --> 00:13:44.150 align:middle line:84%
So there's the architecture
migrate module.

00:13:44.150 --> 00:13:47.140 align:middle line:84%
We also have the
post/windows/manage/migrate

00:13:47.140 --> 00:13:50.200 align:middle line:84%
module, which allows you
to essentially migrate

00:13:50.200 --> 00:13:53.500 align:middle line:84%
your process like we did
manually with the actual

00:13:53.500 --> 00:13:54.770 align:middle line:90%
Meterpreter session.

00:13:54.770 --> 00:13:57.440 align:middle line:84%
So again, if we were to
try and do this here,

00:13:57.440 --> 00:13:59.920 align:middle line:84%
so let's just try and use
this module and let's see.

00:13:59.920 --> 00:14:02.725 align:middle line:84%
Again, we'll say
use show options.

00:14:02.725 --> 00:14:06.050 align:middle line:90%


00:14:06.050 --> 00:14:08.710 align:middle line:84%
In this case, this will allow
us to essentially create

00:14:08.710 --> 00:14:10.880 align:middle line:84%
a new process and
then migrate into it.

00:14:10.880 --> 00:14:13.490 align:middle line:84%
So we can specify the
name of the process.

00:14:13.490 --> 00:14:15.100 align:middle line:84%
It's not required,
but you can if you

00:14:15.100 --> 00:14:19.330 align:middle line:84%
wanted to give it a very
clandestine or name that's

00:14:19.330 --> 00:14:20.950 align:middle line:90%
not easily recognizable.

00:14:20.950 --> 00:14:23.297 align:middle line:84%
You can also specify
the process ID

00:14:23.297 --> 00:14:24.880 align:middle line:84%
of the process you
want to migrate to,

00:14:24.880 --> 00:14:27.370 align:middle line:84%
similar to what we did
within Meterpreter.

00:14:27.370 --> 00:14:31.600 align:middle line:84%
In this case, I'm just going
to set this session to 1,

00:14:31.600 --> 00:14:34.240 align:middle line:90%
and we're just going to run it.

00:14:34.240 --> 00:14:37.170 align:middle line:84%
And in this case, it looks
like it says current server

00:14:37.170 --> 00:14:39.690 align:middle line:90%
process is explorer.exe.

00:14:39.690 --> 00:14:42.780 align:middle line:84%
The reason that failed is
because we are currently we

00:14:42.780 --> 00:14:44.610 align:middle line:90%
already migrated our process.

00:14:44.610 --> 00:14:47.610 align:middle line:84%
So if we check our
sessions, we should still

00:14:47.610 --> 00:14:49.840 align:middle line:84%
have access to our
session one here.

00:14:49.840 --> 00:14:50.530 align:middle line:90%
There we are.

00:14:50.530 --> 00:14:52.300 align:middle line:84%
So I'm just going to put
that in the background.

00:14:52.300 --> 00:14:54.800 align:middle line:84%
And let's take a look at some
of the other post exploitation

00:14:54.800 --> 00:14:56.700 align:middle line:90%
modules we can use.

00:14:56.700 --> 00:15:00.500 align:middle line:84%
All right, so the
first post exploitation

00:15:00.500 --> 00:15:05.370 align:middle line:84%
module we can explore is the
Windows privileges module.

00:15:05.370 --> 00:15:06.660 align:middle line:90%
So we can search for it here.

00:15:06.660 --> 00:15:09.680 align:middle line:84%
So I'm going to say
search win_privs.

00:15:09.680 --> 00:15:12.830 align:middle line:84%
This will essentially
enumerate the privileges

00:15:12.830 --> 00:15:15.030 align:middle line:84%
of the current user
that we have access to.

00:15:15.030 --> 00:15:18.320 align:middle line:84%
So you can see Windows gather
privileges enumeration.

00:15:18.320 --> 00:15:20.990 align:middle line:84%
So we are going to say
use, paste that in there.

00:15:20.990 --> 00:15:23.630 align:middle line:84%
And of course, you can see
this is a post exploitation

00:15:23.630 --> 00:15:25.220 align:middle line:90%
module for Windows.

00:15:25.220 --> 00:15:28.280 align:middle line:84%
So that's the key thing
to keep in mind there.

00:15:28.280 --> 00:15:31.600 align:middle line:84%
Show options, we can
set the session here.

00:15:31.600 --> 00:15:35.830 align:middle line:84%
We're going to set it
to session one, hit run.

00:15:35.830 --> 00:15:39.130 align:middle line:84%
As you can see, this will
list out, first and foremost,

00:15:39.130 --> 00:15:40.810 align:middle line:84%
information about
the current users.

00:15:40.810 --> 00:15:43.300 align:middle line:84%
So it's going to say
is the user admin?

00:15:43.300 --> 00:15:46.180 align:middle line:90%
Yes, the user is admin.

00:15:46.180 --> 00:15:48.340 align:middle line:84%
Do we currently have
system privileges?

00:15:48.340 --> 00:15:49.030 align:middle line:90%
No, we don't.

00:15:49.030 --> 00:15:52.250 align:middle line:84%
But of course, we were able
to elevate our privileges.

00:15:52.250 --> 00:15:53.920 align:middle line:84%
But the technique
through which we

00:15:53.920 --> 00:15:57.220 align:middle line:84%
did that was through token
impersonation, which again

00:15:57.220 --> 00:16:01.000 align:middle line:84%
doesn't give our current user
or rather our current session

00:16:01.000 --> 00:16:02.830 align:middle line:84%
administrative
privileges, it essentially

00:16:02.830 --> 00:16:06.760 align:middle line:84%
means that current process
or we have essentially

00:16:06.760 --> 00:16:10.100 align:middle line:84%
impersonated the token
of an elevated process.

00:16:10.100 --> 00:16:12.790 align:middle line:84%
So we would still have
administrative privileges

00:16:12.790 --> 00:16:14.680 align:middle line:84%
or anti-authority
system privileges

00:16:14.680 --> 00:16:18.520 align:middle line:84%
within that Meterpreter
session, but the actual session

00:16:18.520 --> 00:16:22.000 align:middle line:84%
itself will not be
considered elevated.

00:16:22.000 --> 00:16:24.640 align:middle line:84%
So it's going to say, is it
in the local admin group?

00:16:24.640 --> 00:16:25.450 align:middle line:90%
True.

00:16:25.450 --> 00:16:27.700 align:middle line:90%
Is user access control enabled?

00:16:27.700 --> 00:16:28.330 align:middle line:90%
True.

00:16:28.330 --> 00:16:31.930 align:middle line:84%
That can also be a very good
privilege escalation attack

00:16:31.930 --> 00:16:34.820 align:middle line:84%
vector that we'll probably
explode in the next video.

00:16:34.820 --> 00:16:36.790 align:middle line:84%
And then it gives
you the user ID here,

00:16:36.790 --> 00:16:38.620 align:middle line:84%
and then the actual
Windows privileges

00:16:38.620 --> 00:16:41.980 align:middle line:84%
which can give you an idea
of what you can do currently

00:16:41.980 --> 00:16:44.800 align:middle line:84%
as these are the Windows
privileges associated

00:16:44.800 --> 00:16:46.660 align:middle line:90%
with this particular user.

00:16:46.660 --> 00:16:48.970 align:middle line:84%
All right, so that can be
very helpful in identifying

00:16:48.970 --> 00:16:52.390 align:middle line:84%
what privileges you have and
what privileges you don't have.

00:16:52.390 --> 00:16:56.110 align:middle line:84%
Now the other important
post exploitation module

00:16:56.110 --> 00:16:58.870 align:middle line:84%
is the post
exploitation module that

00:16:58.870 --> 00:17:02.300 align:middle line:84%
allows us to check what users
are currently logged on.

00:17:02.300 --> 00:17:03.730 align:middle line:90%
So we can search for it.

00:17:03.730 --> 00:17:09.810 align:middle line:84%
The name of the module
is enum_logged_on.

00:17:09.810 --> 00:17:13.230 align:middle line:84%
So I'll hit Enter, and there we
are, it's enum_logged_on_users.

00:17:13.230 --> 00:17:15.619 align:middle line:84%
So this will check
and will actually

00:17:15.619 --> 00:17:18.770 align:middle line:84%
tell us whether we have any
currently logged on users

00:17:18.770 --> 00:17:22.849 align:middle line:84%
or it'll essentially enumerate
any of the previously logged

00:17:22.849 --> 00:17:25.790 align:middle line:84%
on users, which again, will give
us an idea of what users are

00:17:25.790 --> 00:17:28.400 align:middle line:84%
frequently logging
on to the system,

00:17:28.400 --> 00:17:31.550 align:middle line:84%
as well as the users that
are currently on there.

00:17:31.550 --> 00:17:35.045 align:middle line:84%
And that can again
help us or give us

00:17:35.045 --> 00:17:37.370 align:middle line:84%
a bit of a heads up in
regards to whether or not

00:17:37.370 --> 00:17:39.620 align:middle line:84%
we are being watched
or whether or not

00:17:39.620 --> 00:17:41.400 align:middle line:84%
our activities
are being noticed.

00:17:41.400 --> 00:17:43.760 align:middle line:84%
So as you can see,
we have the ability

00:17:43.760 --> 00:17:45.890 align:middle line:84%
to set the current
option, which will check

00:17:45.890 --> 00:17:48.980 align:middle line:84%
for the or enumerate the
currently logged on users,

00:17:48.980 --> 00:17:52.100 align:middle line:84%
and then the recent
option here will enumerate

00:17:52.100 --> 00:17:54.150 align:middle line:90%
the recently logged on users.

00:17:54.150 --> 00:17:55.910 align:middle line:84%
So we only need to
set the session.

00:17:55.910 --> 00:17:58.998 align:middle line:84%
In this case, we're going
to set the session to one.

00:17:58.998 --> 00:17:59.540 align:middle line:90%
There we are.

00:17:59.540 --> 00:18:00.260 align:middle line:90%
Fantastic.

00:18:00.260 --> 00:18:03.060 align:middle line:90%
And we can just hit run.

00:18:03.060 --> 00:18:04.590 align:middle line:90%
Give that a few seconds.

00:18:04.590 --> 00:18:05.162 align:middle line:90%
There we are.

00:18:05.162 --> 00:18:07.620 align:middle line:84%
As you can see, it's going to
give you the currently logged

00:18:07.620 --> 00:18:09.870 align:middle line:90%
on users and their SIDs.

00:18:09.870 --> 00:18:11.830 align:middle line:84%
In this case, this
is the administrator.

00:18:11.830 --> 00:18:13.650 align:middle line:84%
That's currently
the logged on user.

00:18:13.650 --> 00:18:17.140 align:middle line:84%
And then the recently logged
on users are provided here.

00:18:17.140 --> 00:18:19.750 align:middle line:84%
So it looks like apart
from the administrator,

00:18:19.750 --> 00:18:23.370 align:middle line:84%
we have only had a few
other service accounts here

00:18:23.370 --> 00:18:24.280 align:middle line:90%
that have logged in.

00:18:24.280 --> 00:18:27.810 align:middle line:84%
So that's a good thing from
an attacker's perspective

00:18:27.810 --> 00:18:29.640 align:middle line:84%
or a penetration
tester's perspective

00:18:29.640 --> 00:18:31.800 align:middle line:84%
because the last
thing you want is

00:18:31.800 --> 00:18:33.810 align:middle line:84%
to have someone
detect your activity

00:18:33.810 --> 00:18:37.230 align:middle line:84%
and consequently
terminate your access.

00:18:37.230 --> 00:18:40.590 align:middle line:84%
So that's a very, very, very
helpful post exploitation

00:18:40.590 --> 00:18:41.500 align:middle line:90%
module.

00:18:41.500 --> 00:18:43.830 align:middle line:84%
Now, the other module
that's really, really

00:18:43.830 --> 00:18:46.680 align:middle line:84%
interesting and really cool
is the Check VM module,

00:18:46.680 --> 00:18:49.680 align:middle line:84%
which will essentially tell you
whether the target system is

00:18:49.680 --> 00:18:51.870 align:middle line:90%
indeed a virtual machine.

00:18:51.870 --> 00:18:54.840 align:middle line:84%
So we can search for
it and say check VM.

00:18:54.840 --> 00:18:57.660 align:middle line:84%
And the one we're looking
for is the Windows one.

00:18:57.660 --> 00:19:00.330 align:middle line:84%
So as you can see, this
post exploitation module

00:19:00.330 --> 00:19:03.240 align:middle line:84%
exists for Solaris
as well as Linux.

00:19:03.240 --> 00:19:05.020 align:middle line:84%
So we'll use the
Windows module here.

00:19:05.020 --> 00:19:08.520 align:middle line:84%
So I'm just going to copy
that and say use, paste that

00:19:08.520 --> 00:19:09.220 align:middle line:90%
in there.

00:19:09.220 --> 00:19:11.550 align:middle line:84%
We can then show the
options for this module,

00:19:11.550 --> 00:19:14.152 align:middle line:84%
and we only need to set
the sessions, which is

00:19:14.152 --> 00:19:15.360 align:middle line:90%
exactly what I'm going to do.

00:19:15.360 --> 00:19:19.590 align:middle line:84%
So we're going to say set
session to one and hit Run.

00:19:19.590 --> 00:19:21.900 align:middle line:84%
It's going to check whether
it's a virtual machine.

00:19:21.900 --> 00:19:23.640 align:middle line:90%
And let's see what it tells us.

00:19:23.640 --> 00:19:27.425 align:middle line:84%
All right, so as you can see,
this is a Xen virtual machine.

00:19:27.425 --> 00:19:28.800 align:middle line:84%
And this information
is important

00:19:28.800 --> 00:19:32.110 align:middle line:84%
because if the target
is a virtual machine,

00:19:32.110 --> 00:19:34.860 align:middle line:84%
then we could potentially
utilize some VM

00:19:34.860 --> 00:19:37.890 align:middle line:84%
breakout exploit modules
to essentially break out

00:19:37.890 --> 00:19:40.830 align:middle line:84%
of the virtual machine and
consequently gain access

00:19:40.830 --> 00:19:42.750 align:middle line:84%
to the host
operating system that

00:19:42.750 --> 00:19:44.638 align:middle line:90%
is hosting the virtual machine.

00:19:44.638 --> 00:19:46.680 align:middle line:84%
But again, that is a bit
of an advanced technique

00:19:46.680 --> 00:19:49.750 align:middle line:84%
that we'll not be
covering in this course.

00:19:49.750 --> 00:19:51.720 align:middle line:90%
But that is possible.

00:19:51.720 --> 00:19:54.990 align:middle line:84%
So we've been able to
enumerate the user privileges,

00:19:54.990 --> 00:19:58.080 align:middle line:84%
we've also been able to get an
idea of the currently logged

00:19:58.080 --> 00:20:01.410 align:middle line:84%
on users, and we have
also been able to get

00:20:01.410 --> 00:20:04.690 align:middle line:84%
an idea of whether the target
is indeed a virtual machine.

00:20:04.690 --> 00:20:06.660 align:middle line:84%
Let's take a look
at how to enumerate

00:20:06.660 --> 00:20:09.150 align:middle line:84%
the installed programs
on the target.

00:20:09.150 --> 00:20:12.180 align:middle line:84%
So we can do this by
searching for a module called

00:20:12.180 --> 00:20:13.710 align:middle line:90%
enum_applications.

00:20:13.710 --> 00:20:17.380 align:middle line:90%


00:20:17.380 --> 00:20:17.930 align:middle line:90%
There we are.

00:20:17.930 --> 00:20:19.030 align:middle line:90%
That's the module here.

00:20:19.030 --> 00:20:21.220 align:middle line:84%
This will essentially
tell us what programs are

00:20:21.220 --> 00:20:23.240 align:middle line:90%
installed on the target system.

00:20:23.240 --> 00:20:26.770 align:middle line:84%
So we'll show the options
here, set the session

00:20:26.770 --> 00:20:31.300 align:middle line:84%
to the session ID, which in
this case is 1, and we had Run.

00:20:31.300 --> 00:20:33.907 align:middle line:90%


00:20:33.907 --> 00:20:34.990 align:middle line:90%
All right, so that's done.

00:20:34.990 --> 00:20:37.060 align:middle line:84%
And as you can see, it
tells us right over here

00:20:37.060 --> 00:20:39.970 align:middle line:84%
that these are the
programs installed, as well

00:20:39.970 --> 00:20:43.240 align:middle line:84%
as their versions, which is
very important because if we

00:20:43.240 --> 00:20:47.740 align:middle line:84%
identify a privilege escalation
vulnerability within Mozilla

00:20:47.740 --> 00:20:52.570 align:middle line:84%
Firefox version 80.0.1,
then we could potentially

00:20:52.570 --> 00:20:55.340 align:middle line:84%
utilize Firefox to
elevate our privileges.

00:20:55.340 --> 00:20:57.640 align:middle line:84%
So this information
is very, very useful.

00:20:57.640 --> 00:21:00.130 align:middle line:84%
In this case, we can see
that there's really nothing

00:21:00.130 --> 00:21:04.270 align:middle line:84%
apart from Mozilla Firefox in
regards to third party programs

00:21:04.270 --> 00:21:05.140 align:middle line:90%
here.

00:21:05.140 --> 00:21:08.140 align:middle line:84%
We have a few AWS drivers
which might give us

00:21:08.140 --> 00:21:12.380 align:middle line:84%
an idea of where this
virtual machine is running.

00:21:12.380 --> 00:21:14.980 align:middle line:84%
And in this case, it looks like
the virtual machine is running

00:21:14.980 --> 00:21:18.010 align:middle line:90%
in an AWS cloud environment.

00:21:18.010 --> 00:21:22.040 align:middle line:84%
So that's also another important
piece of information there.

00:21:22.040 --> 00:21:25.720 align:middle line:84%
Now whenever you utilize a
post exploitation module,

00:21:25.720 --> 00:21:27.430 align:middle line:84%
you can see that
the results will

00:21:27.430 --> 00:21:30.430 align:middle line:84%
be stored within the
following directory,

00:21:30.430 --> 00:21:33.460 align:middle line:84%
and you can always
access the locations

00:21:33.460 --> 00:21:36.800 align:middle line:84%
of these particular files by
typing in the loot command.

00:21:36.800 --> 00:21:39.775 align:middle line:84%
So if you created a
workspace and you started up

00:21:39.775 --> 00:21:43.180 align:middle line:84%
the PostgreSQL database
server, then all of this data

00:21:43.180 --> 00:21:45.850 align:middle line:84%
is going to be stored within the
Metasploit framework database

00:21:45.850 --> 00:21:48.520 align:middle line:84%
and you can access that
data by typing in loot.

00:21:48.520 --> 00:21:50.350 align:middle line:84%
And as you can see
here, it's going

00:21:50.350 --> 00:21:56.030 align:middle line:84%
to give you an idea as to what
type of information it is.

00:21:56.030 --> 00:21:58.090 align:middle line:84%
So for example, the
active users can

00:21:58.090 --> 00:22:00.790 align:middle line:84%
be found within
this directory here

00:22:00.790 --> 00:22:02.490 align:middle line:90%
within this particular file.

00:22:02.490 --> 00:22:08.530 align:middle line:84%
So if we open up that directory
within our File Explorer here,

00:22:08.530 --> 00:22:10.930 align:middle line:84%
and I'm just going to
show the hidden files,

00:22:10.930 --> 00:22:14.960 align:middle line:84%
there we are, and we head
over into the MS4 directory,

00:22:14.960 --> 00:22:18.200 align:middle line:84%
there we are, and we take
a look at the loot folder,

00:22:18.200 --> 00:22:20.800 align:middle line:84%
you can see that all of this
information we have enumerated

00:22:20.800 --> 00:22:23.450 align:middle line:84%
is stored for us, which
is very, very helpful.

00:22:23.450 --> 00:22:26.770 align:middle line:84%
So let me just set this
or actually list this out

00:22:26.770 --> 00:22:27.980 align:middle line:90%
as a list here.

00:22:27.980 --> 00:22:31.100 align:middle line:84%
So for example, we can list
out the actual applications

00:22:31.100 --> 00:22:31.600 align:middle line:90%
install.

00:22:31.600 --> 00:22:33.850 align:middle line:84%
So if we open that up, you
can see that information

00:22:33.850 --> 00:22:37.000 align:middle line:84%
is stored for you, which
is excellent all right,

00:22:37.000 --> 00:22:41.920 align:middle line:84%
so let's take a look at a
few other post exploitation

00:22:41.920 --> 00:22:43.540 align:middle line:90%
modules.

00:22:43.540 --> 00:22:48.190 align:middle line:84%
So we can actually check
what antivirus software

00:22:48.190 --> 00:22:51.280 align:middle line:84%
or rather what antivirus
solutions are installed

00:22:51.280 --> 00:22:55.870 align:middle line:84%
on the target system, as well as
enumerate the excluded folders

00:22:55.870 --> 00:22:58.850 align:middle line:84%
that have been specified
within the antivirus system.

00:22:58.850 --> 00:23:01.390 align:middle line:84%
So we can get an idea
of what folders are not

00:23:01.390 --> 00:23:03.970 align:middle line:84%
being scanned by the
antivirus solutions installed.

00:23:03.970 --> 00:23:06.520 align:middle line:84%
So we can search,
we can say search,

00:23:06.520 --> 00:23:11.770 align:middle line:84%
the type is post, because we are
searching for post exploitation

00:23:11.770 --> 00:23:14.320 align:middle line:84%
modules, the
platform is Windows,

00:23:14.320 --> 00:23:18.430 align:middle line:84%
and then we can probably
search av, so antivirus.

00:23:18.430 --> 00:23:23.320 align:middle line:84%
We can probably change that to
something enum, maybe enum av,

00:23:23.320 --> 00:23:23.980 align:middle line:90%
there we are.

00:23:23.980 --> 00:23:26.950 align:middle line:84%
And in this case, we can
enumerate the actual Windows

00:23:26.950 --> 00:23:29.440 align:middle line:90%
antivirus exclusions.

00:23:29.440 --> 00:23:33.250 align:middle line:84%
So Windows Antivirus
or Windows Defender,

00:23:33.250 --> 00:23:37.840 align:middle line:84%
let me just clear that out, is
the default antivirus solution

00:23:37.840 --> 00:23:40.250 align:middle line:90%
installed on Windows systems.

00:23:40.250 --> 00:23:43.660 align:middle line:84%
So if there are any excluded
folders that are not

00:23:43.660 --> 00:23:47.080 align:middle line:84%
being scanned, then that again
can be very useful information

00:23:47.080 --> 00:23:50.230 align:middle line:84%
as we could potentially use
those directories to store

00:23:50.230 --> 00:23:52.420 align:middle line:84%
our exploit code or
any payloads that we

00:23:52.420 --> 00:23:55.730 align:middle line:84%
want to transform the
target and execute on disk.

00:23:55.730 --> 00:24:02.220 align:middle line:84%
So if we show the options
here, you can set the session.

00:24:02.220 --> 00:24:05.760 align:middle line:84%
And you can see it
allows you to specify

00:24:05.760 --> 00:24:09.990 align:middle line:84%
the actual setting for the
following antivirus solution.

00:24:09.990 --> 00:24:15.590 align:middle line:84%
So Windows Defender, we have the
Microsoft Security Essentials

00:24:15.590 --> 00:24:19.640 align:middle line:84%
antivirus system here, as
well as the Symantec Endpoint

00:24:19.640 --> 00:24:21.420 align:middle line:90%
Protection solution.

00:24:21.420 --> 00:24:24.410 align:middle line:84%
So it will enumerate
the excluded folders

00:24:24.410 --> 00:24:27.090 align:middle line:84%
for all of these
antivirus solutions.

00:24:27.090 --> 00:24:29.080 align:middle line:90%
So we're going to hit Run.

00:24:29.080 --> 00:24:32.080 align:middle line:84%
As you can see here, it
says found Windows Defender,

00:24:32.080 --> 00:24:35.890 align:middle line:84%
no extension exclusions for
Windows Defender, no path

00:24:35.890 --> 00:24:37.400 align:middle line:90%
exclusions for Windows Defender.

00:24:37.400 --> 00:24:40.960 align:middle line:84%
So in this case, no excluded
folders or extensions

00:24:40.960 --> 00:24:43.810 align:middle line:84%
have been set, which
means pretty much

00:24:43.810 --> 00:24:46.690 align:middle line:84%
the entire file system is
being scanned and monitored

00:24:46.690 --> 00:24:48.970 align:middle line:90%
by the antivirus solution.

00:24:48.970 --> 00:24:52.570 align:middle line:84%
OK, let's take a look at a
few others like the ability

00:24:52.570 --> 00:24:56.060 align:middle line:84%
to enumerate the computers
that are part of the domain.

00:24:56.060 --> 00:24:59.440 align:middle line:84%
So we can do that by
searching for a module called

00:24:59.440 --> 00:25:00.910 align:middle line:90%
enum_computers.

00:25:00.910 --> 00:25:03.760 align:middle line:90%


00:25:03.760 --> 00:25:06.080 align:middle line:90%
And that's the one there.

00:25:06.080 --> 00:25:09.060 align:middle line:84%
So we're going to say
use, paste that in there,

00:25:09.060 --> 00:25:13.620 align:middle line:84%
show the options, and we
just need to set the session.

00:25:13.620 --> 00:25:15.780 align:middle line:84%
Now I'm not sure whether
this particular target

00:25:15.780 --> 00:25:17.503 align:middle line:84%
system is part of the
domain, but that's

00:25:17.503 --> 00:25:18.420 align:middle line:90%
why we are doing this.

00:25:18.420 --> 00:25:20.910 align:middle line:84%
We want to find this
information or we actually

00:25:20.910 --> 00:25:22.300 align:middle line:90%
want to find out.

00:25:22.300 --> 00:25:23.880 align:middle line:84%
So as you can see,
we had run, and it

00:25:23.880 --> 00:25:26.310 align:middle line:84%
says that this host is
not part of a domain.

00:25:26.310 --> 00:25:29.070 align:middle line:84%
So we know that it's
a sole system that's

00:25:29.070 --> 00:25:32.640 align:middle line:84%
running within AWS, and
it's also a virtual machine.

00:25:32.640 --> 00:25:34.350 align:middle line:84%
That's all that we've
been able to tell.

00:25:34.350 --> 00:25:38.550 align:middle line:84%
And of course, we know that it's
running Windows Server 2012.

00:25:38.550 --> 00:25:42.600 align:middle line:84%
So now let's take a
look at how to enumerate

00:25:42.600 --> 00:25:45.420 align:middle line:84%
the installed patches, which
is very, very important

00:25:45.420 --> 00:25:47.250 align:middle line:90%
during privilege escalation.

00:25:47.250 --> 00:25:50.730 align:middle line:84%
So we can search
for the enum patches

00:25:50.730 --> 00:25:54.270 align:middle line:90%
module, which is enum_patches.

00:25:54.270 --> 00:25:55.710 align:middle line:90%
And that's the one there.

00:25:55.710 --> 00:25:58.680 align:middle line:84%
This will essentially enumerate
or gather the applied patches

00:25:58.680 --> 00:26:00.700 align:middle line:90%
on the target system.

00:26:00.700 --> 00:26:04.700 align:middle line:84%
So we'll use that
module, show the options.

00:26:04.700 --> 00:26:08.570 align:middle line:84%
So we can specify a
comma separated list

00:26:08.570 --> 00:26:12.320 align:middle line:84%
of KB or Microsoft
patches to search for.

00:26:12.320 --> 00:26:15.710 align:middle line:84%
So these are the
actual hotfix IDs here.

00:26:15.710 --> 00:26:17.540 align:middle line:84%
And you can specify
your own list

00:26:17.540 --> 00:26:20.900 align:middle line:84%
if you want to check
whether a specific batch has

00:26:20.900 --> 00:26:22.170 align:middle line:90%
been installed on a target.

00:26:22.170 --> 00:26:24.680 align:middle line:84%
So you can do this, or
this is very important

00:26:24.680 --> 00:26:28.130 align:middle line:84%
if you are trying to identify
whether a particular patch has

00:26:28.130 --> 00:26:31.370 align:middle line:84%
been installed, a patch
that sorted out or fixed

00:26:31.370 --> 00:26:33.680 align:middle line:84%
a vulnerability that
you wanted to exploit.

00:26:33.680 --> 00:26:36.830 align:middle line:84%
So in this case, we can
get rid of the KB list,

00:26:36.830 --> 00:26:38.540 align:middle line:84%
but we can just
leave it as default

00:26:38.540 --> 00:26:43.910 align:middle line:84%
and set the session
to one and hit Run.

00:26:43.910 --> 00:26:48.520 align:middle line:84%
And in this case, it says
known bug in the WMI query,

00:26:48.520 --> 00:26:51.250 align:middle line:84%
try migrating to
another process.

00:26:51.250 --> 00:26:53.150 align:middle line:90%
So let's say session is here.

00:26:53.150 --> 00:26:56.200 align:middle line:84%
And if we head over into
sessions or sessions one,

00:26:56.200 --> 00:26:58.480 align:middle line:84%
we'll list out the
current process tree.

00:26:58.480 --> 00:27:00.700 align:middle line:84%
We can try and migrate
to another process,

00:27:00.700 --> 00:27:03.130 align:middle line:90%
probably svchost.

00:27:03.130 --> 00:27:06.220 align:middle line:84%
And we can do that
to the process

00:27:06.220 --> 00:27:08.380 align:middle line:84%
that has anti-authority
system privileges.

00:27:08.380 --> 00:27:10.060 align:middle line:90%
So that is 896.

00:27:10.060 --> 00:27:17.710 align:middle line:84%
So we're going to
say migrate 896.

00:27:17.710 --> 00:27:19.250 align:middle line:90%
So that completes successfully.

00:27:19.250 --> 00:27:21.960 align:middle line:84%
So I'm going to put
this in the background.

00:27:21.960 --> 00:27:24.360 align:middle line:84%
And we can try and
run that again.

00:27:24.360 --> 00:27:26.340 align:middle line:84%
And it looks like we're
still getting an error.

00:27:26.340 --> 00:27:30.180 align:middle line:84%
All right, so that looks like
it might be an issue within WMI.

00:27:30.180 --> 00:27:35.440 align:middle line:84%
So we might not be able to get
that at this particular point.

00:27:35.440 --> 00:27:39.600 align:middle line:84%
But what we could do in order
to identify this information

00:27:39.600 --> 00:27:42.610 align:middle line:90%
is we could open the session.

00:27:42.610 --> 00:27:44.190 align:middle line:84%
So we're going to
say sessions 1,

00:27:44.190 --> 00:27:47.640 align:middle line:84%
and we can open up a shell
session, which will essentially

00:27:47.640 --> 00:27:50.550 align:middle line:84%
open up a command prompt,
and we can essentially

00:27:50.550 --> 00:27:53.470 align:middle line:84%
get this information
by saying system info.

00:27:53.470 --> 00:27:55.890 align:middle line:84%
So if we type in system
info, and this is a Windows

00:27:55.890 --> 00:27:57.690 align:middle line:84%
native command,
this will give you

00:27:57.690 --> 00:28:00.820 align:middle line:84%
an idea of the installed
patches on the target system.

00:28:00.820 --> 00:28:02.940 align:middle line:84%
So as you can see
here, it provides you

00:28:02.940 --> 00:28:06.250 align:middle line:84%
with a list of all installed
patches on the target system.

00:28:06.250 --> 00:28:09.300 align:middle line:84%
So these are the hot
fixes and the hot fix IDs.

00:28:09.300 --> 00:28:12.490 align:middle line:84%
So if that post exploitation
module fails on you,

00:28:12.490 --> 00:28:17.430 align:middle line:84%
you can always revert to manual
search or manual enumeration.

00:28:17.430 --> 00:28:19.440 align:middle line:84%
So I'm just going to
terminate this channel,

00:28:19.440 --> 00:28:22.440 align:middle line:84%
and we'll put our Meterpreter
session in the background.

00:28:22.440 --> 00:28:25.920 align:middle line:84%
And we can look at or take a
look at a few other modules

00:28:25.920 --> 00:28:28.890 align:middle line:90%
or rather just one or two more.

00:28:28.890 --> 00:28:30.810 align:middle line:84%
The one that we want
to take a look at now

00:28:30.810 --> 00:28:34.110 align:middle line:84%
is the enum_shares module,
which will essentially allow

00:28:34.110 --> 00:28:37.560 align:middle line:90%
us to enumerate any shares.

00:28:37.560 --> 00:28:39.900 align:middle line:84%
So we're going to say
use, paste in that module

00:28:39.900 --> 00:28:45.280 align:middle line:84%
there, show the options, and we
can then specify the session.

00:28:45.280 --> 00:28:48.240 align:middle line:84%
So we're going to
say set session one.

00:28:48.240 --> 00:28:49.740 align:middle line:84%
And the other
options essentially

00:28:49.740 --> 00:28:52.980 align:middle line:84%
allow you to display the
current configured shares

00:28:52.980 --> 00:28:55.350 align:middle line:84%
to essentially enumerate
the shares that

00:28:55.350 --> 00:28:57.190 align:middle line:90%
were entered as UNC ports.

00:28:57.190 --> 00:28:59.490 align:middle line:84%
So the shares that
were entered manually

00:28:59.490 --> 00:29:02.940 align:middle line:84%
within Windows Explorer or
within the File Explorer.

00:29:02.940 --> 00:29:04.960 align:middle line:84%
And then, of course,
the recent shares.

00:29:04.960 --> 00:29:07.190 align:middle line:90%
So we can just hit run.

00:29:07.190 --> 00:29:10.810 align:middle line:84%
And as you can see, it says that
the following shares were found

00:29:10.810 --> 00:29:14.260 align:middle line:84%
and that's the print share which
is used again to facilitate

00:29:14.260 --> 00:29:16.210 align:middle line:90%
the sharing of printers.

00:29:16.210 --> 00:29:19.540 align:middle line:84%
OK, because shares
or the sharing

00:29:19.540 --> 00:29:21.250 align:middle line:84%
of resources on
Windows, as we know,

00:29:21.250 --> 00:29:25.390 align:middle line:84%
is facilitated through SMB,
which we've already explored.

00:29:25.390 --> 00:29:30.070 align:middle line:84%
All right, so that
is pretty much it in

00:29:30.070 --> 00:29:32.740 align:middle line:84%
regards to the post exploitation
modules you can use.

00:29:32.740 --> 00:29:37.000 align:middle line:84%
There are a few others that we
can explore, like the ability

00:29:37.000 --> 00:29:39.560 align:middle line:90%
to check whether RDP is enabled.

00:29:39.560 --> 00:29:41.020 align:middle line:90%
So we can search for that.

00:29:41.020 --> 00:29:44.560 align:middle line:84%
And RDP is essentially the
remote desktop protocol,

00:29:44.560 --> 00:29:47.320 align:middle line:84%
and that protocol is
used to remotely access

00:29:47.320 --> 00:29:48.410 align:middle line:90%
a Windows system.

00:29:48.410 --> 00:29:50.290 align:middle line:84%
And of course, we
can essentially

00:29:50.290 --> 00:29:53.560 align:middle line:84%
get a graphical user
interface instead

00:29:53.560 --> 00:29:54.770 align:middle line:90%
of utilizing a terminal.

00:29:54.770 --> 00:29:57.790 align:middle line:84%
So to check for that,
we can search for RDP

00:29:57.790 --> 00:29:59.935 align:middle line:84%
and limit the platform
maybe to Windows.

00:29:59.935 --> 00:30:02.900 align:middle line:90%


00:30:02.900 --> 00:30:05.070 align:middle line:90%
And we get a few modules here.

00:30:05.070 --> 00:30:07.320 align:middle line:84%
I'm not sure whether
they apply to RDP,

00:30:07.320 --> 00:30:12.110 align:middle line:84%
but we can essentially try and
check with the RDP enabled.

00:30:12.110 --> 00:30:14.720 align:middle line:84%
I believe there was
a module for that.

00:30:14.720 --> 00:30:16.340 align:middle line:84%
But this module
essentially allows you

00:30:16.340 --> 00:30:18.330 align:middle line:90%
to enable RDP on the target.

00:30:18.330 --> 00:30:23.630 align:middle line:84%
So we can say use
and say show options.

00:30:23.630 --> 00:30:26.750 align:middle line:84%
We're going to set
the session to one.

00:30:26.750 --> 00:30:28.970 align:middle line:84%
We don't have the
RDP credentials,

00:30:28.970 --> 00:30:30.540 align:middle line:84%
so we will not be
able to do that.

00:30:30.540 --> 00:30:31.890 align:middle line:90%
So we're going to hit run.

00:30:31.890 --> 00:30:35.030 align:middle line:84%
And as you can see, it
says RDPs already enabled.

00:30:35.030 --> 00:30:39.490 align:middle line:84%
So we could be able to establish
an RDP session with the target

00:30:39.490 --> 00:30:39.990 align:middle line:90%
system.

00:30:39.990 --> 00:30:43.130 align:middle line:84%
But as I said, we
will be exploring RDP

00:30:43.130 --> 00:30:45.250 align:middle line:84%
during the Windows
exploitation section.

00:30:45.250 --> 00:30:47.840 align:middle line:84%
So once we have explored
privilege escalation

00:30:47.840 --> 00:30:50.990 align:middle line:84%
persistence, we'll take a
look at how to enable RDP

00:30:50.990 --> 00:30:53.690 align:middle line:84%
and how to access
the target via RDP.

00:30:53.690 --> 00:30:56.750 align:middle line:84%
All right, so that concludes
the practical demonstration side

00:30:56.750 --> 00:30:59.700 align:middle line:90%
of this video.

00:30:59.700 --> 00:31:03.530 align:middle line:84%
All right, so that was
quite a lot of information.

00:31:03.530 --> 00:31:06.920 align:middle line:84%
But again, it's all extremely
useful during the post

00:31:06.920 --> 00:31:08.540 align:middle line:90%
exploitation phase.

00:31:08.540 --> 00:31:11.210 align:middle line:84%
In the next video, we
are going to be exploring

00:31:11.210 --> 00:31:15.260 align:middle line:84%
the process of elevating our
privileges on a Windows system

00:31:15.260 --> 00:31:18.920 align:middle line:84%
by bypassing UAC or
User Access Control.

00:31:18.920 --> 00:31:22.300 align:middle line:84%
So I'll see you
in the next video.

00:31:22.300 --> 00:31:23.000 align:middle line:90%