WEBVTT

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


00:00:03.381 --> 00:00:06.762 align:middle line:90%
[MUSIC PLAYING]

00:00:06.762 --> 00:00:10.150 align:middle line:90%


00:00:10.150 --> 00:00:14.000 align:middle line:84%
Automating Windows local
enumeration-- in this video,

00:00:14.000 --> 00:00:15.640 align:middle line:84%
we will be exploring
the process of how

00:00:15.640 --> 00:00:18.400 align:middle line:84%
to automate all of the
local enumeration stages

00:00:18.400 --> 00:00:21.680 align:middle line:84%
that we've gone through for
the Windows operating system.

00:00:21.680 --> 00:00:23.240 align:middle line:90%
So why is this important?

00:00:23.240 --> 00:00:26.530 align:middle line:84%
Why would we want to automate
what we can do manually?

00:00:26.530 --> 00:00:30.100 align:middle line:84%
Well, in addition to performing
local enumeration manually,

00:00:30.100 --> 00:00:33.430 align:middle line:84%
we can also automate the process
with the help of a few scripts

00:00:33.430 --> 00:00:35.740 align:middle line:84%
and Metasploit
framework modules.

00:00:35.740 --> 00:00:38.620 align:middle line:84%
While local enumeration
techniques or commands

00:00:38.620 --> 00:00:41.740 align:middle line:84%
are important to know,
as a penetration tester,

00:00:41.740 --> 00:00:44.050 align:middle line:84%
you'll need to be time
or resource efficient

00:00:44.050 --> 00:00:45.490 align:middle line:90%
when it comes down to time.

00:00:45.490 --> 00:00:47.290 align:middle line:84%
And as a result, you
will need to learn

00:00:47.290 --> 00:00:50.110 align:middle line:84%
how to utilize various
automated enumeration scripts

00:00:50.110 --> 00:00:54.490 align:middle line:84%
and tools to speed up the
postexploitation phase.

00:00:54.490 --> 00:00:59.410 align:middle line:84%
Now, in addition to automating
the process of enumeration

00:00:59.410 --> 00:01:02.890 align:middle line:84%
and enumerating information
like system information,

00:01:02.890 --> 00:01:06.670 align:middle line:84%
users, and groups, et cetera,
these automated enumeration

00:01:06.670 --> 00:01:10.060 align:middle line:84%
scripts will also provide you
with additional information

00:01:10.060 --> 00:01:11.680 align:middle line:90%
regarding the target system--

00:01:11.680 --> 00:01:13.990 align:middle line:84%
like privilege escalation
vulnerabilities,

00:01:13.990 --> 00:01:16.600 align:middle line:84%
locally-stored
passwords, et cetera.

00:01:16.600 --> 00:01:18.970 align:middle line:84%
So the crux of what
I'm getting at here

00:01:18.970 --> 00:01:21.160 align:middle line:84%
is that as a penetration
tester, you're

00:01:21.160 --> 00:01:23.170 align:middle line:84%
going to have a fixed
timeline, right?

00:01:23.170 --> 00:01:26.230 align:middle line:84%
And you are going to need
to work based on the time

00:01:26.230 --> 00:01:28.400 align:middle line:90%
parameters allotted to you.

00:01:28.400 --> 00:01:30.970 align:middle line:84%
So when it comes down
to postexploitation

00:01:30.970 --> 00:01:33.520 align:middle line:84%
and, more specifically,
local enumeration,

00:01:33.520 --> 00:01:35.350 align:middle line:84%
while it is
important to know how

00:01:35.350 --> 00:01:37.720 align:middle line:84%
to perform local
enumeration manually,

00:01:37.720 --> 00:01:41.060 align:middle line:84%
you will need to, in most
cases, speed up this process.

00:01:41.060 --> 00:01:43.900 align:middle line:84%
And that can be facilitated
by various automation

00:01:43.900 --> 00:01:47.495 align:middle line:84%
scripts as well as a few
Metasploit framework modules.

00:01:47.495 --> 00:01:49.870 align:middle line:84%
So that's what we're going to
be exploring in this video.

00:01:49.870 --> 00:01:52.480 align:middle line:84%
Now, in regards to the
Windows local enumeration

00:01:52.480 --> 00:01:54.860 align:middle line:84%
scripts that I'm going to be
highlighting in this video,

00:01:54.860 --> 00:01:57.700 align:middle line:84%
I'm going to be covering
one, and this is pretty much

00:01:57.700 --> 00:02:01.930 align:middle line:84%
the most pertinent one to
what we have been doing.

00:02:01.930 --> 00:02:04.320 align:middle line:84%
We will be exploring
other enumeration scripts

00:02:04.320 --> 00:02:06.070 align:middle line:84%
throughout this course,
but for now, we're

00:02:06.070 --> 00:02:07.660 align:middle line:84%
going to start
off with this one.

00:02:07.660 --> 00:02:09.970 align:middle line:84%
So the one we're
going to be exploring

00:02:09.970 --> 00:02:11.350 align:middle line:90%
is called JAWS, right?

00:02:11.350 --> 00:02:15.550 align:middle line:84%
And JAWS is an abbreviation
for Just Another Windows enum

00:02:15.550 --> 00:02:16.480 align:middle line:90%
Script.

00:02:16.480 --> 00:02:18.760 align:middle line:84%
JAWS is a PowerShell
script that is designed

00:02:18.760 --> 00:02:22.960 align:middle line:84%
to help penetration testers
and CTFers quickly identify

00:02:22.960 --> 00:02:26.440 align:middle line:84%
potential privilege escalation
vectors on Windows systems.

00:02:26.440 --> 00:02:29.170 align:middle line:84%
It is written using
PowerShell 2.0

00:02:29.170 --> 00:02:32.530 align:middle line:84%
and should run on every Windows
version since Windows 7.

00:02:32.530 --> 00:02:34.900 align:middle line:84%
So the reason I've
decided to showcase

00:02:34.900 --> 00:02:39.100 align:middle line:84%
this script is primarily
because I use it quite a lot.

00:02:39.100 --> 00:02:41.410 align:middle line:84%
It is designed in PowerShell,
which means, again,

00:02:41.410 --> 00:02:45.460 align:middle line:84%
you don't need to copy over an
executable or any other script

00:02:45.460 --> 00:02:47.090 align:middle line:84%
that's designed in
another language.

00:02:47.090 --> 00:02:51.100 align:middle line:84%
So it will run on every version
of Windows since Windows 10--

00:02:51.100 --> 00:02:53.770 align:middle line:84%
or sorry since
Windows 7, all the way

00:02:53.770 --> 00:02:56.020 align:middle line:90%
to Windows 10 and now 11.

00:02:56.020 --> 00:02:58.360 align:middle line:84%
Furthermore, it doesn't
have any dependencies,

00:02:58.360 --> 00:03:02.350 align:middle line:84%
so you can run it without
installing anything like .NET

00:03:02.350 --> 00:03:04.000 align:middle line:90%
4.5 et cetera.

00:03:04.000 --> 00:03:06.220 align:middle line:84%
So in terms of
compatibility, it will

00:03:06.220 --> 00:03:09.820 align:middle line:84%
work on most Windows systems
that you gain access to.

00:03:09.820 --> 00:03:11.680 align:middle line:84%
I'll be showing you
how to utilize it

00:03:11.680 --> 00:03:14.650 align:middle line:84%
and how we will be transferring
it into the lab environment.

00:03:14.650 --> 00:03:17.570 align:middle line:84%
Now, this video has its
own lab environment,

00:03:17.570 --> 00:03:20.200 align:middle line:84%
so we're not going to be using
the same lab environment we've

00:03:20.200 --> 00:03:23.050 align:middle line:84%
been using in the previous
videos within the Windows

00:03:23.050 --> 00:03:24.950 align:middle line:90%
local enumeration section.

00:03:24.950 --> 00:03:27.160 align:middle line:84%
So we're going to start
off by gaining access

00:03:27.160 --> 00:03:28.270 align:middle line:90%
to the target system.

00:03:28.270 --> 00:03:30.370 align:middle line:84%
We'll obtain an
Meterpreter session,

00:03:30.370 --> 00:03:34.120 align:middle line:84%
and then we'll, firstly, explore
a few Metasploit framework

00:03:34.120 --> 00:03:37.060 align:middle line:84%
postexploitation modules
that will automate

00:03:37.060 --> 00:03:38.650 align:middle line:90%
local enumeration on Windows.

00:03:38.650 --> 00:03:42.100 align:middle line:84%
We'll then move on how to
utilize the JAWS PowerShell

00:03:42.100 --> 00:03:42.760 align:middle line:90%
script.

00:03:42.760 --> 00:03:44.803 align:middle line:84%
All right, so fire up
the lab environment,

00:03:44.803 --> 00:03:46.720 align:middle line:84%
and I'll see you there
in a couple of seconds.

00:03:46.720 --> 00:03:50.850 align:middle line:90%


00:03:50.850 --> 00:03:52.860 align:middle line:84%
All right, so I'm back
in the lab environment.

00:03:52.860 --> 00:03:55.043 align:middle line:84%
And you'll be provided
with the target IP.

00:03:55.043 --> 00:03:57.210 align:middle line:84%
Of course, in your case,
it's going to be different.

00:03:57.210 --> 00:03:58.770 align:middle line:90%
All you need to do is copy it.

00:03:58.770 --> 00:04:00.740 align:middle line:84%
So as I said, this is
a new lab environment

00:04:00.740 --> 00:04:03.720 align:middle line:84%
with a differently
configured target system.

00:04:03.720 --> 00:04:06.080 align:middle line:84%
So the first step that
we need to perform

00:04:06.080 --> 00:04:09.090 align:middle line:84%
is to perform an Nmap
scan on the target system.

00:04:09.090 --> 00:04:12.200 align:middle line:84%
And more specifically, we
are going to be targeting

00:04:12.200 --> 00:04:14.970 align:middle line:84%
or we are interested
in a particular port.

00:04:14.970 --> 00:04:18.472 align:middle line:84%
So this target system
has WinRM enabled.

00:04:18.472 --> 00:04:20.180 align:middle line:84%
If you're not familiar
with what we WinRM

00:04:20.180 --> 00:04:22.610 align:middle line:84%
is as a Windows
protocol, you can

00:04:22.610 --> 00:04:25.160 align:middle line:84%
take a look at the system
and host-based attacks course

00:04:25.160 --> 00:04:26.820 align:middle line:90%
to learn more about it.

00:04:26.820 --> 00:04:31.440 align:middle line:84%
But essentially, it runs on
TCP port 5985 by default.

00:04:31.440 --> 00:04:34.430 align:middle line:84%
So we can perform a quick
service version detection scan

00:04:34.430 --> 00:04:37.490 align:middle line:84%
on that specific
port-- so 5985--

00:04:37.490 --> 00:04:39.780 align:middle line:84%
and we can paste
in the target IP.

00:04:39.780 --> 00:04:42.530 align:middle line:84%
So we are going to be targeting
the WinRM protocol that's

00:04:42.530 --> 00:04:43.500 align:middle line:90%
running on the target.

00:04:43.500 --> 00:04:45.350 align:middle line:84%
So we are just
doing this to ensure

00:04:45.350 --> 00:04:47.460 align:middle line:90%
that it is up and running.

00:04:47.460 --> 00:04:50.158 align:middle line:84%
So we'll give this
a couple of seconds.

00:04:50.158 --> 00:04:50.700 align:middle line:90%
There we are.

00:04:50.700 --> 00:04:54.050 align:middle line:84%
We can see that it is
open, and it is running.

00:04:54.050 --> 00:04:56.300 align:middle line:84%
And don't worry about
the service banner.

00:04:56.300 --> 00:04:59.340 align:middle line:84%
That really isn't
important at this phase.

00:04:59.340 --> 00:05:01.880 align:middle line:84%
So in order to
exploit we WinRM, we

00:05:01.880 --> 00:05:05.390 align:middle line:84%
are going to require legitimate
credentials for the target

00:05:05.390 --> 00:05:06.320 align:middle line:90%
system, right?

00:05:06.320 --> 00:05:09.590 align:middle line:84%
And this lab environment
already has these credentials

00:05:09.590 --> 00:05:12.410 align:middle line:84%
provided to you to actually
streamline the exploitation

00:05:12.410 --> 00:05:13.260 align:middle line:90%
process.

00:05:13.260 --> 00:05:16.130 align:middle line:84%
So the username is going
to be administrator,

00:05:16.130 --> 00:05:18.620 align:middle line:84%
and the password is
Tinkerbell, all right?

00:05:18.620 --> 00:05:21.650 align:middle line:84%
So in order to utilize
WinRM or in order

00:05:21.650 --> 00:05:25.070 align:middle line:84%
to exploit WinRM and
consequently gain a Meterpreter

00:05:25.070 --> 00:05:27.800 align:middle line:84%
session, we are going to
be utilizing a Metasploit

00:05:27.800 --> 00:05:29.370 align:middle line:90%
framework exploit module.

00:05:29.370 --> 00:05:31.460 align:middle line:84%
So I'll open up
MSF console here,

00:05:31.460 --> 00:05:35.560 align:middle line:84%
and we can search for
the module in question.

00:05:35.560 --> 00:05:36.140 align:middle line:90%
There we are.

00:05:36.140 --> 00:05:39.760 align:middle line:84%
And I'll just say
search WinRM, all right?

00:05:39.760 --> 00:05:42.650 align:middle line:84%
And we are going to be utilizing
the following exploit module.

00:05:42.650 --> 00:05:45.610 align:middle line:84%
So this is the exploit
Windows WinRM WinRM script

00:05:45.610 --> 00:05:47.860 align:middle line:90%
exec you module.

00:05:47.860 --> 00:05:51.130 align:middle line:84%
And this requires
legitimate credentials.

00:05:51.130 --> 00:05:54.130 align:middle line:84%
So we are going to say
use for because I'm

00:05:54.130 --> 00:05:55.850 align:middle line:90%
specifying the module ID--

00:05:55.850 --> 00:05:56.755 align:middle line:90%
so use for.

00:05:56.755 --> 00:05:59.600 align:middle line:90%


00:05:59.600 --> 00:06:01.910 align:middle line:84%
It's going to select
that module and it's

00:06:01.910 --> 00:06:03.920 align:middle line:84%
going to specify the
default payload, which

00:06:03.920 --> 00:06:10.430 align:middle line:84%
is a 32-bit Meterpreter payload,
which is perfectly fine.

00:06:10.430 --> 00:06:12.430 align:middle line:84%
If we show the options
for this module,

00:06:12.430 --> 00:06:15.590 align:middle line:84%
we have a couple of options
that we need to configure.

00:06:15.590 --> 00:06:17.750 align:middle line:84%
We firstly need to
set up the target IP

00:06:17.750 --> 00:06:20.900 align:middle line:84%
address, which can be done by
configuring the Rhost option.

00:06:20.900 --> 00:06:24.380 align:middle line:84%
We then need to set the username
and password for the target

00:06:24.380 --> 00:06:27.500 align:middle line:84%
system that we can use to
authenticate with the target

00:06:27.500 --> 00:06:29.280 align:middle line:90%
system via WinRM.

00:06:29.280 --> 00:06:34.200 align:middle line:84%
So I'm going to say set Rhosts
and paste in the target IP.

00:06:34.200 --> 00:06:36.175 align:middle line:84%
We then need to set
up the username.

00:06:36.175 --> 00:06:37.800 align:middle line:84%
So as I said, the
username in this case

00:06:37.800 --> 00:06:39.580 align:middle line:90%
is going to be administrator.

00:06:39.580 --> 00:06:42.150 align:middle line:84%
So this will provide us with
administrative privileges

00:06:42.150 --> 00:06:43.530 align:middle line:90%
on the target system.

00:06:43.530 --> 00:06:50.000 align:middle line:84%
And then the password we will
set to Tinkerbell, all right?

00:06:50.000 --> 00:06:50.570 align:middle line:90%
There we go.

00:06:50.570 --> 00:06:52.730 align:middle line:84%
And we also need to
set one more option,

00:06:52.730 --> 00:06:56.040 align:middle line:84%
and that is the force
Visual Basic script option--

00:06:56.040 --> 00:06:57.267 align:middle line:90%
so force VBS.

00:06:57.267 --> 00:06:58.850 align:middle line:84%
You can see this
will force the module

00:06:58.850 --> 00:07:01.400 align:middle line:90%
to use the VBS command stager.

00:07:01.400 --> 00:07:06.020 align:middle line:84%
So in this case, we're going
to say set force VBS to true

00:07:06.020 --> 00:07:08.270 align:middle line:84%
because it is
currently set to false.

00:07:08.270 --> 00:07:10.340 align:middle line:90%
And we will type in exploit.

00:07:10.340 --> 00:07:13.790 align:middle line:84%
Now, this will take
a couple of seconds

00:07:13.790 --> 00:07:15.470 align:middle line:84%
to, essentially,
send the stager.

00:07:15.470 --> 00:07:17.540 align:middle line:84%
So you can see it's
going to give you--

00:07:17.540 --> 00:07:20.090 align:middle line:84%
it's going to highlight
the progress here.

00:07:20.090 --> 00:07:23.460 align:middle line:84%
In some cases, this might not
work during the first attempt.

00:07:23.460 --> 00:07:25.010 align:middle line:90%
So be cognizant of that.

00:07:25.010 --> 00:07:28.380 align:middle line:84%
If it doesn't work, you can
rerun the exploit module again.

00:07:28.380 --> 00:07:32.540 align:middle line:84%
So once it is sent the
stager, the command stager,

00:07:32.540 --> 00:07:35.780 align:middle line:84%
it should execute it and
we should be provided

00:07:35.780 --> 00:07:38.070 align:middle line:90%
with a Meterpreter session.

00:07:38.070 --> 00:07:40.250 align:middle line:84%
In addition to that,
this module will also

00:07:40.250 --> 00:07:43.850 align:middle line:84%
run the postexploitation
migrate module

00:07:43.850 --> 00:07:47.450 align:middle line:84%
that will migrate our process
from the current process

00:07:47.450 --> 00:07:48.780 align:middle line:90%
into a different process.

00:07:48.780 --> 00:07:50.197 align:middle line:84%
And in this case,
you can see it's

00:07:50.197 --> 00:07:52.140 align:middle line:90%
trying the SVC host process.

00:07:52.140 --> 00:07:54.500 align:middle line:84%
And once it's
successfully migrated,

00:07:54.500 --> 00:07:56.900 align:middle line:84%
it'll provide us with
an elevated Meterpreter

00:07:56.900 --> 00:08:00.780 align:middle line:84%
session with NT authority
system privileges, all right?

00:08:00.780 --> 00:08:04.670 align:middle line:84%
So if I type in
sysinfo, you can see

00:08:04.670 --> 00:08:06.980 align:middle line:84%
that this is a different
target than the one we

00:08:06.980 --> 00:08:08.790 align:middle line:90%
used in the previous video.

00:08:08.790 --> 00:08:14.090 align:middle line:84%
So this is running Windows
Server 2016 build 17,763.

00:08:14.090 --> 00:08:16.370 align:middle line:84%
And we have a 64-bit
Meterpreter session.

00:08:16.370 --> 00:08:18.470 align:middle line:84%
If I type in get
user ID, you can

00:08:18.470 --> 00:08:19.940 align:middle line:84%
see we have the
highest privileges

00:08:19.940 --> 00:08:24.830 align:middle line:84%
available on a Windows system,
which is NT authority system.

00:08:24.830 --> 00:08:26.870 align:middle line:84%
All right, so let's
get started, firstly,

00:08:26.870 --> 00:08:30.770 align:middle line:84%
by taking a look at a
few postexploitation

00:08:30.770 --> 00:08:34.650 align:middle line:84%
Metasploit modules that can
automate what we did previously

00:08:34.650 --> 00:08:37.340 align:middle line:84%
in addition to gathering more
information about the target

00:08:37.340 --> 00:08:38.039 align:middle line:90%
system.

00:08:38.039 --> 00:08:41.090 align:middle line:84%
So this is pertinent
to when you have access

00:08:41.090 --> 00:08:44.780 align:middle line:84%
to the target system via
an Meterpreter session.

00:08:44.780 --> 00:08:46.880 align:middle line:84%
Right now, in the
previous set of videos,

00:08:46.880 --> 00:08:49.010 align:middle line:84%
I didn't highlight
how you can enumerate

00:08:49.010 --> 00:08:53.990 align:middle line:84%
additional information like
displaying the mounted drives

00:08:53.990 --> 00:08:55.050 align:middle line:90%
on the target system.

00:08:55.050 --> 00:08:58.310 align:middle line:84%
So again, if you wanted to get
an idea of the other drives

00:08:58.310 --> 00:09:01.700 align:middle line:84%
that are connected to a
Windows system via Meterpreter,

00:09:01.700 --> 00:09:04.520 align:middle line:84%
you can essentially
say show_mount.

00:09:04.520 --> 00:09:07.430 align:middle line:84%
And that'll tell you the
list of mounts and drives

00:09:07.430 --> 00:09:08.070 align:middle line:90%
that you have.

00:09:08.070 --> 00:09:12.920 align:middle line:84%
So if the target system had an
external hard drive or a flash

00:09:12.920 --> 00:09:16.190 align:middle line:84%
drive connected to it, it'll
actually display that here.

00:09:16.190 --> 00:09:18.410 align:middle line:84%
And it'll also display
where it's been mapped to.

00:09:18.410 --> 00:09:20.930 align:middle line:84%
In this case, we only
have the C drive.

00:09:20.930 --> 00:09:25.340 align:middle line:84%
The size is 30 gigabytes, and
the actual available space

00:09:25.340 --> 00:09:26.840 align:middle line:90%
is 15 gigabytes.

00:09:26.840 --> 00:09:29.120 align:middle line:84%
So again, that's
information that

00:09:29.120 --> 00:09:32.580 align:middle line:84%
might be useful at a
certain point in time.

00:09:32.580 --> 00:09:34.330 align:middle line:84%
Now, let's take a look
at some of the post

00:09:34.330 --> 00:09:35.650 align:middle line:90%
exploitation models.

00:09:35.650 --> 00:09:37.360 align:middle line:84%
In order to do that,
I'm going to put

00:09:37.360 --> 00:09:39.310 align:middle line:84%
this session in the
background, and we

00:09:39.310 --> 00:09:42.600 align:middle line:84%
are going to search for
a specific module here.

00:09:42.600 --> 00:09:45.730 align:middle line:84%
So let's start off
with the win privs

00:09:45.730 --> 00:09:49.640 align:middle line:84%
module, which will essentially
display our user privileges.

00:09:49.640 --> 00:09:50.390 align:middle line:90%
So there we are.

00:09:50.390 --> 00:09:51.180 align:middle line:90%
That's the module.

00:09:51.180 --> 00:09:53.320 align:middle line:90%
So I'll say, use zero.

00:09:53.320 --> 00:09:56.300 align:middle line:84%
And because this is a
postexploitation module,

00:09:56.300 --> 00:09:59.412 align:middle line:84%
we need to set our current
Meterpreter session ID.

00:09:59.412 --> 00:10:01.870 align:middle line:84%
So if we type in sessions, you
can see that our Meterpreter

00:10:01.870 --> 00:10:03.940 align:middle line:90%
session has an ID of one.

00:10:03.940 --> 00:10:09.070 align:middle line:84%
So we will say set session to
one, and we can then hit Run.

00:10:09.070 --> 00:10:12.430 align:middle line:84%
So we did this previously using
the get privs command when

00:10:12.430 --> 00:10:15.790 align:middle line:84%
we were exploring how to
enumerate users and groups

00:10:15.790 --> 00:10:18.760 align:middle line:90%
or user and group information.

00:10:18.760 --> 00:10:20.440 align:middle line:84%
As you can see,
this will give you

00:10:20.440 --> 00:10:21.960 align:middle line:90%
a little bit more information.

00:10:21.960 --> 00:10:23.710 align:middle line:84%
So it'll tell you
whether the current user

00:10:23.710 --> 00:10:27.550 align:middle line:84%
is an administrator, whether
it has anti-authority system

00:10:27.550 --> 00:10:31.150 align:middle line:84%
privileges, whether it is
part of the local admin group,

00:10:31.150 --> 00:10:32.780 align:middle line:90%
whether UAC is enabled.

00:10:32.780 --> 00:10:35.830 align:middle line:84%
So User Access Control is
not enabled in this case,

00:10:35.830 --> 00:10:38.210 align:middle line:84%
and the user ID is
anti-authority system.

00:10:38.210 --> 00:10:40.240 align:middle line:84%
And then, it'll
actually display a list

00:10:40.240 --> 00:10:43.450 align:middle line:84%
of Windows privileges assigned
to the current user you

00:10:43.450 --> 00:10:45.580 align:middle line:90%
have access to.

00:10:45.580 --> 00:10:46.970 align:middle line:90%
So that's one module.

00:10:46.970 --> 00:10:49.960 align:middle line:84%
We can also search for another
one that will essentially

00:10:49.960 --> 00:10:52.480 align:middle line:90%
display the logged on users.

00:10:52.480 --> 00:10:54.700 align:middle line:84%
So we can search for
it, and I believe

00:10:54.700 --> 00:10:55.970 align:middle line:90%
we have already explored it.

00:10:55.970 --> 00:10:58.720 align:middle line:84%
But you can see, there we
are-- post Windows gather

00:10:58.720 --> 00:10:59.920 align:middle line:90%
enum logged on users.

00:10:59.920 --> 00:11:02.080 align:middle line:84%
This will display
or gather the logged

00:11:02.080 --> 00:11:04.360 align:middle line:84%
on users via the
Windows registry.

00:11:04.360 --> 00:11:06.850 align:middle line:84%
So I'll say, use
zero, and we're going

00:11:06.850 --> 00:11:09.070 align:middle line:90%
to set the session to one.

00:11:09.070 --> 00:11:12.224 align:middle line:90%
And I can then hit Run.

00:11:12.224 --> 00:11:14.580 align:middle line:84%
And then we also, as we
already explored this,

00:11:14.580 --> 00:11:16.500 align:middle line:84%
we'll display the
currently logged on users.

00:11:16.500 --> 00:11:20.130 align:middle line:84%
We can see we have antiauthority
system and the administrator.

00:11:20.130 --> 00:11:22.110 align:middle line:84%
And for recently
logged on users,

00:11:22.110 --> 00:11:24.540 align:middle line:84%
we can see that the only user
account that has logged on

00:11:24.540 --> 00:11:26.230 align:middle line:90%
is the administrator user.

00:11:26.230 --> 00:11:30.780 align:middle line:84%
The other ones are network
and service accounts.

00:11:30.780 --> 00:11:34.380 align:middle line:84%
We then have another interesting
postexploitation module

00:11:34.380 --> 00:11:35.970 align:middle line:90%
called check VM, all right?

00:11:35.970 --> 00:11:38.310 align:middle line:90%
So I'll say search and check VM.

00:11:38.310 --> 00:11:40.350 align:middle line:84%
And this will
essentially tell you

00:11:40.350 --> 00:11:43.000 align:middle line:84%
whether the target system
is a virtual machine.

00:11:43.000 --> 00:11:44.785 align:middle line:84%
Now, this might be
important if you

00:11:44.785 --> 00:11:47.160 align:middle line:84%
are trying to understand
whether the system you have just

00:11:47.160 --> 00:11:50.790 align:middle line:84%
exploited is actually running
on a bare metal system

00:11:50.790 --> 00:11:53.010 align:middle line:90%
or it is a virtual machine.

00:11:53.010 --> 00:11:54.630 align:middle line:90%
So I'll say search VM.

00:11:54.630 --> 00:11:56.590 align:middle line:84%
And we are looking for
the Windows module,

00:11:56.590 --> 00:11:59.760 align:middle line:90%
so post Windows gather checkVM.

00:11:59.760 --> 00:12:02.690 align:middle line:90%
And we'll say use two.

00:12:02.690 --> 00:12:03.300 align:middle line:90%
There we are.

00:12:03.300 --> 00:12:08.200 align:middle line:84%
And I'll set the session to
one, and then I can hit Run.

00:12:08.200 --> 00:12:10.700 align:middle line:84%
It's going to check whether the
target is a virtual machine.

00:12:10.700 --> 00:12:13.130 align:middle line:84%
And in this case, you can
see that the target system is

00:12:13.130 --> 00:12:15.330 align:middle line:90%
indeed a zen virtual machine.

00:12:15.330 --> 00:12:18.140 align:middle line:84%
All right, so that
information is very important

00:12:18.140 --> 00:12:20.930 align:middle line:84%
if you're trying to identify
whether you've exploited

00:12:20.930 --> 00:12:24.140 align:middle line:84%
a virtual machine or a
real workstation or laptop

00:12:24.140 --> 00:12:25.920 align:middle line:90%
for that matter.

00:12:25.920 --> 00:12:27.600 align:middle line:84%
We can also-- and
this is something

00:12:27.600 --> 00:12:29.430 align:middle line:84%
that we didn't explore,
but we can also

00:12:29.430 --> 00:12:32.880 align:middle line:84%
enumerate a list of installed
applications or programs

00:12:32.880 --> 00:12:34.505 align:middle line:90%
on the target system.

00:12:34.505 --> 00:12:35.880 align:middle line:84%
This can be very
important if you

00:12:35.880 --> 00:12:39.540 align:middle line:84%
are trying to identify a program
that is installed on a target

00:12:39.540 --> 00:12:43.380 align:middle line:84%
system that might be vulnerable
to a particular exploit--

00:12:43.380 --> 00:12:45.930 align:middle line:84%
more specifically, a
privilege escalation

00:12:45.930 --> 00:12:48.910 align:middle line:84%
exploit or vulnerability
for that matter.

00:12:48.910 --> 00:12:52.950 align:middle line:84%
So we'll search for a module
called enum applications-- so

00:12:52.950 --> 00:12:55.718 align:middle line:90%
enum_applications.

00:12:55.718 --> 00:12:56.760 align:middle line:90%
And that's the one there.

00:12:56.760 --> 00:12:59.080 align:middle line:84%
This is a Windows post
exploitation module.

00:12:59.080 --> 00:13:04.410 align:middle line:84%
So I'll say, use zero to select
it, and set the session to one.

00:13:04.410 --> 00:13:07.120 align:middle line:90%
I will then type in run.

00:13:07.120 --> 00:13:07.705 align:middle line:90%
There we are.

00:13:07.705 --> 00:13:09.700 align:middle line:84%
So it's essentially
going to enumerate

00:13:09.700 --> 00:13:12.560 align:middle line:84%
all installed applications
on the target system.

00:13:12.560 --> 00:13:15.850 align:middle line:84%
And in this case, because
this is a virtual machine,

00:13:15.850 --> 00:13:18.310 align:middle line:84%
it only has the
following programs

00:13:18.310 --> 00:13:22.480 align:middle line:84%
installed-- so AWS PV drivers,
AWS tools for Windows,

00:13:22.480 --> 00:13:24.780 align:middle line:90%
et cetera, et cetera.

00:13:24.780 --> 00:13:26.820 align:middle line:84%
All right, so we
can also utilize

00:13:26.820 --> 00:13:29.130 align:middle line:84%
a few other
postexploitation modules.

00:13:29.130 --> 00:13:32.340 align:middle line:84%
And the one that I'm
going to cover now

00:13:32.340 --> 00:13:34.920 align:middle line:84%
is a postexploitation
module that will essentially

00:13:34.920 --> 00:13:36.960 align:middle line:84%
enumerate all other
computers connected

00:13:36.960 --> 00:13:39.870 align:middle line:84%
to the same network
of the system

00:13:39.870 --> 00:13:41.040 align:middle line:90%
that you've just exploited.

00:13:41.040 --> 00:13:46.740 align:middle line:84%
So we'll search for it by saying
enum search enum_computers.

00:13:46.740 --> 00:13:49.960 align:middle line:90%


00:13:49.960 --> 00:13:52.870 align:middle line:84%
All right, and
we'll say use zero,

00:13:52.870 --> 00:13:55.830 align:middle line:84%
and we're going to set
the session to one.

00:13:55.830 --> 00:13:58.100 align:middle line:90%
And we can then hit Run.

00:13:58.100 --> 00:14:00.140 align:middle line:84%
And you can see that
the target system is not

00:14:00.140 --> 00:14:01.847 align:middle line:84%
part of a domain,
which makes sense,

00:14:01.847 --> 00:14:03.680 align:middle line:84%
again, because this is
running in the cloud.

00:14:03.680 --> 00:14:07.340 align:middle line:84%
If you performed this
or ran this module

00:14:07.340 --> 00:14:10.820 align:middle line:84%
on a target system that is
part of a network or domain,

00:14:10.820 --> 00:14:13.130 align:middle line:84%
it will enumerate
the other systems

00:14:13.130 --> 00:14:15.410 align:middle line:84%
that are connected to that
network, which, again,

00:14:15.410 --> 00:14:17.960 align:middle line:84%
is very important
during the pivoting

00:14:17.960 --> 00:14:19.760 align:middle line:90%
phase of postexploitation.

00:14:19.760 --> 00:14:22.340 align:middle line:90%


00:14:22.340 --> 00:14:26.210 align:middle line:84%
A few other Metasploit modules
that can automate what we were

00:14:26.210 --> 00:14:30.680 align:middle line:84%
able to do previously-- like
enumerating a list of installed

00:14:30.680 --> 00:14:32.900 align:middle line:90%
patches or updates--

00:14:32.900 --> 00:14:37.490 align:middle line:84%
that module, in this case,
is called enum patches.

00:14:37.490 --> 00:14:39.002 align:middle line:90%
So search enum patches.

00:14:39.002 --> 00:14:39.710 align:middle line:90%
And there we are.

00:14:39.710 --> 00:14:44.540 align:middle line:84%
So I'll Just say use zero,
set the session to one,

00:14:44.540 --> 00:14:45.740 align:middle line:90%
and hit Run.

00:14:45.740 --> 00:14:47.360 align:middle line:84%
And that will
essentially automate

00:14:47.360 --> 00:14:49.970 align:middle line:84%
the process of getting a
list of installed patches.

00:14:49.970 --> 00:14:53.150 align:middle line:84%
So in this case, it'll
sort out the information

00:14:53.150 --> 00:14:56.840 align:middle line:84%
based on what is really
important for the penetration

00:14:56.840 --> 00:14:57.440 align:middle line:90%
tester.

00:14:57.440 --> 00:14:59.960 align:middle line:84%
So it'll give you the
hotfix ID, and it'll

00:14:59.960 --> 00:15:01.610 align:middle line:90%
tell you when it was installed.

00:15:01.610 --> 00:15:05.960 align:middle line:84%
Now, when we were performing
local enumeration manually,

00:15:05.960 --> 00:15:08.900 align:middle line:84%
we were able to identify
additional information, which

00:15:08.900 --> 00:15:11.810 align:middle line:84%
is one of the reasons why I
recommend that you learn how

00:15:11.810 --> 00:15:15.230 align:middle line:84%
to perform manual local
enumeration before you actually

00:15:15.230 --> 00:15:17.250 align:middle line:90%
move on to automating it.

00:15:17.250 --> 00:15:20.790 align:middle line:84%
But this information is
still very, very helpful.

00:15:20.790 --> 00:15:24.630 align:middle line:84%
Another post-exploitation module
is the enum shares module,

00:15:24.630 --> 00:15:27.590 align:middle line:84%
which will essentially
enumerate a list of SMB shares

00:15:27.590 --> 00:15:32.240 align:middle line:84%
that is accessible by or
from the target system

00:15:32.240 --> 00:15:33.350 align:middle line:90%
you have exploited.

00:15:33.350 --> 00:15:36.980 align:middle line:84%
And this is, again,
very useful when

00:15:36.980 --> 00:15:39.320 align:middle line:84%
you're working in a
target environment that

00:15:39.320 --> 00:15:42.360 align:middle line:84%
has multiple systems
connected to a network.

00:15:42.360 --> 00:15:44.990 align:middle line:84%
And in some cases, they
could have share set up

00:15:44.990 --> 00:15:47.160 align:middle line:90%
to share files, et cetera.

00:15:47.160 --> 00:15:49.070 align:middle line:84%
So I'll say search,
and we're looking

00:15:49.070 --> 00:15:52.610 align:middle line:90%
for enum shares so enum_shares.

00:15:52.610 --> 00:15:53.940 align:middle line:90%
And that's the module there.

00:15:53.940 --> 00:16:00.110 align:middle line:84%
So I'll say, use zero, set the
session to one, and hit Run.

00:16:00.110 --> 00:16:02.250 align:middle line:84%
And you can see that
no shares were found.

00:16:02.250 --> 00:16:04.130 align:middle line:84%
So again, this is
essentially a list

00:16:04.130 --> 00:16:08.270 align:middle line:84%
of extremely helpful Metasploit
framework postexploitation

00:16:08.270 --> 00:16:11.420 align:middle line:84%
modules for Windows
local enumeration

00:16:11.420 --> 00:16:14.570 align:middle line:84%
or to automate Windows
local enumeration.

00:16:14.570 --> 00:16:17.930 align:middle line:84%
Now, let's move
on to JAWS, which,

00:16:17.930 --> 00:16:22.440 align:middle line:84%
again, is the enumeration
script that I wanted to cover.

00:16:22.440 --> 00:16:24.290 align:middle line:84%
So in order to use
it, you're going

00:16:24.290 --> 00:16:27.080 align:middle line:84%
to need to copy the PowerShell
script from the GitHub

00:16:27.080 --> 00:16:28.040 align:middle line:90%
repository.

00:16:28.040 --> 00:16:31.490 align:middle line:84%
And I've already linked the
link to the GitHub repository

00:16:31.490 --> 00:16:32.610 align:middle line:90%
within the slides.

00:16:32.610 --> 00:16:34.580 align:middle line:84%
So I'll just switch
over to my browser

00:16:34.580 --> 00:16:36.170 align:middle line:84%
because the lab
environment doesn't

00:16:36.170 --> 00:16:38.070 align:middle line:90%
have any internet access.

00:16:38.070 --> 00:16:41.420 align:middle line:84%
So I'm just going to switch
over to my browser on my system,

00:16:41.420 --> 00:16:44.030 align:middle line:84%
and I'll show you how to
copy the PowerShell script

00:16:44.030 --> 00:16:46.740 align:middle line:84%
and then how you can paste it
within the lab environment.

00:16:46.740 --> 00:16:49.080 align:middle line:90%
So let me just switch over.

00:16:49.080 --> 00:16:52.170 align:middle line:84%
All right, so I'm currently
on the JAWS GitHub repository.

00:16:52.170 --> 00:16:55.110 align:middle line:84%
As you can see, it'll give you
a description as to what it is.

00:16:55.110 --> 00:16:58.710 align:middle line:84%
And the GitHub repository only
contains the PowerShell script

00:16:58.710 --> 00:17:00.120 align:middle line:90%
called JAWS enum.

00:17:00.120 --> 00:17:03.510 align:middle line:84%
And it also provides you with
really helpful information

00:17:03.510 --> 00:17:06.750 align:middle line:84%
regarding how to use
this particular tool

00:17:06.750 --> 00:17:09.000 align:middle line:84%
within a command
shell session as well

00:17:09.000 --> 00:17:11.099 align:middle line:90%
as a PowerShell session.

00:17:11.099 --> 00:17:13.270 align:middle line:84%
And it gives you a
list of features here.

00:17:13.270 --> 00:17:15.089 align:middle line:84%
So this is all of
the information

00:17:15.089 --> 00:17:16.859 align:middle line:90%
that it will enumerate for you.

00:17:16.859 --> 00:17:19.920 align:middle line:84%
So it will enumerate network
information, the firewall

00:17:19.920 --> 00:17:23.310 align:middle line:84%
status and rules, running
processes, files and folders

00:17:23.310 --> 00:17:27.089 align:middle line:84%
with full control or modify
access, mapped drives,

00:17:27.089 --> 00:17:29.500 align:middle line:90%
and really a lot of information.

00:17:29.500 --> 00:17:31.740 align:middle line:84%
So you can now
start to understand

00:17:31.740 --> 00:17:33.780 align:middle line:84%
why a tool like this
or a script like this

00:17:33.780 --> 00:17:36.360 align:middle line:84%
is very useful because
it will essentially

00:17:36.360 --> 00:17:39.910 align:middle line:84%
do all of this for you in
terms of local enumeration.

00:17:39.910 --> 00:17:43.530 align:middle line:84%
So it'll enumerate, for
example, system install files,

00:17:43.530 --> 00:17:46.480 align:middle line:84%
stored credentials,
installed applications,

00:17:46.480 --> 00:17:47.470 align:middle line:90%
so on and so forth.

00:17:47.470 --> 00:17:51.310 align:middle line:84%
And you'll actually
see how this works.

00:17:51.310 --> 00:17:54.450 align:middle line:84%
So in order to copy this
to the lab environment,

00:17:54.450 --> 00:17:57.060 align:middle line:84%
because we cannot download the
PowerShell script directly,

00:17:57.060 --> 00:17:59.770 align:middle line:84%
we are going to copy the content
of the PowerShell script.

00:17:59.770 --> 00:18:01.380 align:middle line:84%
So I'm going to
click on it there.

00:18:01.380 --> 00:18:03.610 align:middle line:84%
And this is the script
right over here.

00:18:03.610 --> 00:18:07.260 align:middle line:84%
So we're going to click on
Raw to get the raw output.

00:18:07.260 --> 00:18:09.990 align:middle line:84%
And you're now going to
highlight all of this--

00:18:09.990 --> 00:18:13.840 align:middle line:84%
so control A, and then you
can right click and copy that.

00:18:13.840 --> 00:18:15.990 align:middle line:84%
So once this is copied
I can now switch over

00:18:15.990 --> 00:18:17.700 align:middle line:84%
to my lab environment
where I'll show you

00:18:17.700 --> 00:18:22.008 align:middle line:84%
how to paste this into the
lab environment clipboard.

00:18:22.008 --> 00:18:24.050 align:middle line:84%
All right, so I'm back
within the lab environment

00:18:24.050 --> 00:18:25.370 align:middle line:90%
where we left off from.

00:18:25.370 --> 00:18:28.250 align:middle line:84%
And to paste what we have
copied, what you need to do

00:18:28.250 --> 00:18:32.180 align:middle line:84%
is, on your keyboard, use the
following keyboard combination.

00:18:32.180 --> 00:18:35.420 align:middle line:84%
So Control, Shift,
and Alt, and that

00:18:35.420 --> 00:18:39.870 align:middle line:84%
will open up your
clipboard options here.

00:18:39.870 --> 00:18:43.760 align:middle line:84%
So within your clipboard, the
script content that you copied

00:18:43.760 --> 00:18:45.650 align:middle line:90%
should be pasted automatically.

00:18:45.650 --> 00:18:49.430 align:middle line:84%
If it's not, you can just
hit control V to paste it.

00:18:49.430 --> 00:18:52.280 align:middle line:84%
Once the actual
script that you copied

00:18:52.280 --> 00:18:54.020 align:middle line:84%
is highlighted under
your clipboard,

00:18:54.020 --> 00:18:56.970 align:middle line:84%
that means that you can paste
it into the lab environment.

00:18:56.970 --> 00:19:01.100 align:middle line:84%
So I'll close this side menu by
saying Control, Shift, and Alt

00:19:01.100 --> 00:19:01.860 align:middle line:90%
again.

00:19:01.860 --> 00:19:04.730 align:middle line:84%
And we now need to
create the JAWS script--

00:19:04.730 --> 00:19:06.030 align:middle line:90%
the JAWS PowerShell script.

00:19:06.030 --> 00:19:08.360 align:middle line:84%
So I'll open up a
text editor here

00:19:08.360 --> 00:19:09.570 align:middle line:90%
within the lab environment.

00:19:09.570 --> 00:19:11.390 align:middle line:84%
And I'll just hit
Control V to paste

00:19:11.390 --> 00:19:13.190 align:middle line:90%
in the content of the script.

00:19:13.190 --> 00:19:13.790 align:middle line:90%
There we are.

00:19:13.790 --> 00:19:15.890 align:middle line:84%
Now, if it doesn't copy,
again, you can just

00:19:15.890 --> 00:19:18.965 align:middle line:84%
use Control, Shift, and
Alt. And just make sure

00:19:18.965 --> 00:19:21.150 align:middle line:90%
that that is copied there.

00:19:21.150 --> 00:19:23.630 align:middle line:84%
So again, I can just paste
in the content of the script

00:19:23.630 --> 00:19:24.770 align:middle line:90%
once more.

00:19:24.770 --> 00:19:27.020 align:middle line:84%
And I can then say
Control, Shift, and Alt

00:19:27.020 --> 00:19:27.920 align:middle line:90%
to close that up.

00:19:27.920 --> 00:19:29.900 align:middle line:84%
And I can then say
Control V, and you

00:19:29.900 --> 00:19:32.700 align:middle line:84%
can see that it's now pasted
within the lab environment.

00:19:32.700 --> 00:19:35.460 align:middle line:84%
So this is the entire
PowerShell script here.

00:19:35.460 --> 00:19:37.430 align:middle line:90%
So I can now click on Save.

00:19:37.430 --> 00:19:40.640 align:middle line:84%
And I'm going to save
it on the root, desktop.

00:19:40.640 --> 00:19:42.500 align:middle line:84%
And where you store
it is very important

00:19:42.500 --> 00:19:45.510 align:middle line:84%
because we're going to need to
upload it to the target system.

00:19:45.510 --> 00:19:49.400 align:middle line:84%
So I will call this
file JAWS enum--

00:19:49.400 --> 00:19:54.020 align:middle line:84%
so JAWS-enum.ps1-- because
it's a PowerShell script--

00:19:54.020 --> 00:19:55.150 align:middle line:90%
and hit Save.

00:19:55.150 --> 00:19:57.530 align:middle line:84%
Now that that is done,
we can close that up

00:19:57.530 --> 00:20:00.548 align:middle line:84%
and we can open up our
current Meterpreter session.

00:20:00.548 --> 00:20:01.090 align:middle line:90%
There we are.

00:20:01.090 --> 00:20:03.430 align:middle line:90%
So I'll say sessions one.

00:20:03.430 --> 00:20:06.460 align:middle line:84%
And I'm going to navigate
to the root of the C drive.

00:20:06.460 --> 00:20:08.350 align:middle line:84%
And within the root
of the C drive,

00:20:08.350 --> 00:20:11.770 align:middle line:84%
whenever you're copying over
exploit files or scripts

00:20:11.770 --> 00:20:14.170 align:middle line:84%
that you're using
during a pen test,

00:20:14.170 --> 00:20:16.930 align:middle line:84%
always save them within
the temp directory stored

00:20:16.930 --> 00:20:18.550 align:middle line:90%
within the root of the C drive.

00:20:18.550 --> 00:20:20.530 align:middle line:84%
If the temp directory
doesn't exist,

00:20:20.530 --> 00:20:25.090 align:middle line:84%
you can create it by
saying make directory temp.

00:20:25.090 --> 00:20:27.800 align:middle line:84%
And we're going to upload it
within the temp directory.

00:20:27.800 --> 00:20:29.440 align:middle line:90%
So I'll CD into that directory.

00:20:29.440 --> 00:20:32.920 align:middle line:84%
And then we can utilize the
built-in Meterpreter command

00:20:32.920 --> 00:20:33.850 align:middle line:90%
upload.

00:20:33.850 --> 00:20:36.780 align:middle line:84%
We're then going to specify
where we saved the JAWS enum

00:20:36.780 --> 00:20:37.280 align:middle line:90%
script.

00:20:37.280 --> 00:20:41.740 align:middle line:90%
So root, desktop, JAWS-enum.ps1.

00:20:41.740 --> 00:20:44.050 align:middle line:84%
That is going to upload
the PowerShell script.

00:20:44.050 --> 00:20:46.930 align:middle line:84%
And we can now open up
a command shell session

00:20:46.930 --> 00:20:49.390 align:middle line:90%
by typing in shell.

00:20:49.390 --> 00:20:51.710 align:middle line:84%
And if I type in
DIR, you can see,

00:20:51.710 --> 00:20:53.840 align:middle line:84%
we have it right over
there ready to go.

00:20:53.840 --> 00:20:55.960 align:middle line:84%
So to execute a
PowerShell script

00:20:55.960 --> 00:20:59.590 align:middle line:84%
from within a Windows
command shell session,

00:20:59.590 --> 00:21:01.690 align:middle line:90%
we can type in PowerShell.exe.

00:21:01.690 --> 00:21:04.270 align:middle line:90%


00:21:04.270 --> 00:21:07.510 align:middle line:84%
We then need to set up
the execution policy.

00:21:07.510 --> 00:21:10.390 align:middle line:84%
Because we are running
a PowerShell script,

00:21:10.390 --> 00:21:13.480 align:middle line:84%
Windows by default
doesn't allow users

00:21:13.480 --> 00:21:15.340 align:middle line:90%
to execute PowerShell scripts.

00:21:15.340 --> 00:21:18.070 align:middle line:84%
So we need to set
the execution policy.

00:21:18.070 --> 00:21:21.190 align:middle line:84%
This will essentially allow us
to run the JAWS-enum PowerShell

00:21:21.190 --> 00:21:24.170 align:middle line:90%
script without any issues.

00:21:24.170 --> 00:21:28.940 align:middle line:84%
So I'm going to say
execution, and we're then

00:21:28.940 --> 00:21:32.420 align:middle line:90%
going to say policy bypass.

00:21:32.420 --> 00:21:37.010 align:middle line:84%
We then specify the file that we
would like to execute so file.

00:21:37.010 --> 00:21:39.543 align:middle line:84%
We're then going to
execute JAWS-enum.ps1.

00:21:39.543 --> 00:21:42.810 align:middle line:90%


00:21:42.810 --> 00:21:46.110 align:middle line:84%
We are then going to
output the output--

00:21:46.110 --> 00:21:48.270 align:middle line:84%
or we're going to save
the output produced

00:21:48.270 --> 00:21:51.960 align:middle line:84%
by the JAWS-enum PowerShell
script into another file--

00:21:51.960 --> 00:21:53.020 align:middle line:90%
into a text file.

00:21:53.020 --> 00:21:58.480 align:middle line:84%
So we're going to
say output filename,

00:21:58.480 --> 00:22:00.620 align:middle line:84%
and we're going to specify
the file name here.

00:22:00.620 --> 00:22:02.537 align:middle line:84%
So I'm going to say--
we're going to call this

00:22:02.537 --> 00:22:05.200 align:middle line:90%
JAWS-enum.txt.

00:22:05.200 --> 00:22:07.660 align:middle line:84%
So what we're doing here is
we're essentially saying,

00:22:07.660 --> 00:22:11.560 align:middle line:84%
I want you to execute the
JAWS-enum PowerShell script

00:22:11.560 --> 00:22:15.430 align:middle line:84%
with PowerShell, and I want
you to output the actual output

00:22:15.430 --> 00:22:18.400 align:middle line:84%
produced by the JAWS-enum
PowerShell script into a text

00:22:18.400 --> 00:22:21.010 align:middle line:90%
file called JAWS-enum.txt.

00:22:21.010 --> 00:22:23.930 align:middle line:84%
The reason we are doing
that is primarily because--

00:22:23.930 --> 00:22:27.100 align:middle line:84%
because we're enumerating all
of this information or all

00:22:27.100 --> 00:22:30.350 align:middle line:84%
of the information you saw on
the JAWS GitHub repository,

00:22:30.350 --> 00:22:32.650 align:middle line:84%
it's going to display
a lot of information.

00:22:32.650 --> 00:22:34.210 align:middle line:84%
And we don't want
that information

00:22:34.210 --> 00:22:38.215 align:middle line:84%
to be displayed on our terminal
because we want to analyze it

00:22:38.215 --> 00:22:40.120 align:middle line:84%
within a text file so
that we can actually

00:22:40.120 --> 00:22:42.680 align:middle line:84%
scroll through what
we're interested in.

00:22:42.680 --> 00:22:46.180 align:middle line:84%
And of course, that is also
very important for the purpose

00:22:46.180 --> 00:22:50.140 align:middle line:84%
of record keeping and note
taking during a penetration

00:22:50.140 --> 00:22:51.040 align:middle line:90%
test.

00:22:51.040 --> 00:22:53.250 align:middle line:90%
So hit Enter.

00:22:53.250 --> 00:22:54.750 align:middle line:84%
If it runs successfully,
you can see

00:22:54.750 --> 00:22:57.240 align:middle line:84%
it's going to say
running JAWS enumeration.

00:22:57.240 --> 00:22:58.920 align:middle line:90%
It's then going to go through--

00:22:58.920 --> 00:23:01.980 align:middle line:84%
it's going to perform all
of the enumeration checks

00:23:01.980 --> 00:23:04.540 align:middle line:90%
that we did during this section.

00:23:04.540 --> 00:23:06.840 align:middle line:84%
So it's going to gather
user information.

00:23:06.840 --> 00:23:09.940 align:middle line:84%
It's going to get the processes,
services, and scheduled tasks.

00:23:09.940 --> 00:23:11.560 align:middle line:90%
We also did that manually.

00:23:11.560 --> 00:23:13.620 align:middle line:84%
It's going to gather
installed software.

00:23:13.620 --> 00:23:18.240 align:middle line:84%
It's also going to gather file
system information as well

00:23:18.240 --> 00:23:20.410 align:middle line:84%
as a plethora of
other information.

00:23:20.410 --> 00:23:22.440 align:middle line:84%
Now, I want to just
give you a warning.

00:23:22.440 --> 00:23:24.810 align:middle line:84%
This script will take
a couple of seconds

00:23:24.810 --> 00:23:26.670 align:middle line:84%
to a couple of
minutes to complete.

00:23:26.670 --> 00:23:29.880 align:middle line:84%
Don't worry if it actually gets
stuck at gathering file system

00:23:29.880 --> 00:23:30.750 align:middle line:90%
information.

00:23:30.750 --> 00:23:32.440 align:middle line:90%
Give it a couple of minutes.

00:23:32.440 --> 00:23:34.950 align:middle line:84%
Once it's done, you might
get an error telling you

00:23:34.950 --> 00:23:36.150 align:middle line:90%
that a few checks failed.

00:23:36.150 --> 00:23:37.990 align:middle line:90%
That's perfectly fine.

00:23:37.990 --> 00:23:39.960 align:middle line:84%
It will still
enumerate or automate

00:23:39.960 --> 00:23:44.280 align:middle line:84%
the process of enumerating
a lot of information that's

00:23:44.280 --> 00:23:45.400 align:middle line:90%
very, very useful.

00:23:45.400 --> 00:23:48.720 align:middle line:84%
So again, I'll give this a
couple of minutes, after which,

00:23:48.720 --> 00:23:52.320 align:middle line:84%
we can then download the
JAWS-enum.txt file to our Kali

00:23:52.320 --> 00:23:55.830 align:middle line:84%
Linux system and analyze all
of the information it was able

00:23:55.830 --> 00:23:56.400 align:middle line:90%
to get.

00:23:56.400 --> 00:23:59.810 align:middle line:84%
So I'll just give this
a couple of minutes.

00:23:59.810 --> 00:24:05.195 align:middle line:84%
All right, so JAWS has completed
performing or automating

00:24:05.195 --> 00:24:09.680 align:middle line:84%
all of the information or
the actual local enumeration

00:24:09.680 --> 00:24:10.610 align:middle line:90%
process.

00:24:10.610 --> 00:24:12.980 align:middle line:84%
As I said, it might take
a couple of minutes,

00:24:12.980 --> 00:24:16.410 align:middle line:84%
and you might get an error under
the looking for simple priv esc

00:24:16.410 --> 00:24:16.910 align:middle line:90%
methods.

00:24:16.910 --> 00:24:19.700 align:middle line:84%
That's perfectly
fine-- right over here.

00:24:19.700 --> 00:24:22.430 align:middle line:84%
Once it is done,
if I type in DIR,

00:24:22.430 --> 00:24:26.270 align:middle line:84%
you can see that we have the
JAWS-enum.txt that, again,

00:24:26.270 --> 00:24:30.180 align:middle line:84%
has quite a lot of data as you
can see from the size there.

00:24:30.180 --> 00:24:32.630 align:middle line:84%
So we actually need
to download this

00:24:32.630 --> 00:24:34.200 align:middle line:90%
onto our Kali Linux system.

00:24:34.200 --> 00:24:37.610 align:middle line:84%
So I'm going to hit Control
and C to terminate this channel

00:24:37.610 --> 00:24:40.670 align:middle line:84%
to head back over into
our Meterpreter session,

00:24:40.670 --> 00:24:44.720 align:middle line:84%
after which, if I say LS, you
can see we have JAWS-enum.txt.

00:24:44.720 --> 00:24:53.570 align:middle line:84%
So I'm going to say
download JAWS-enum enum.txt.

00:24:53.570 --> 00:24:54.360 align:middle line:90%
There we are.

00:24:54.360 --> 00:24:57.460 align:middle line:84%
And this should download it to
the root of the Kali Linux file

00:24:57.460 --> 00:24:57.960 align:middle line:90%
system.

00:24:57.960 --> 00:25:00.470 align:middle line:84%
So I open up my File
Manager here, you

00:25:00.470 --> 00:25:02.370 align:middle line:84%
can see there's the
downloaded file.

00:25:02.370 --> 00:25:06.390 align:middle line:84%
So we can open this up in our
text editor, and there you are.

00:25:06.390 --> 00:25:09.620 align:middle line:84%
So this is all of the
output produced by JAWS.

00:25:09.620 --> 00:25:13.130 align:middle line:84%
So you can see that it
will automate information

00:25:13.130 --> 00:25:17.130 align:middle line:84%
like the actual
system information.

00:25:17.130 --> 00:25:18.890 align:middle line:84%
So in this case, it
actually is quite

00:25:18.890 --> 00:25:21.890 align:middle line:84%
inaccurate in regards to the
version of Windows Server,

00:25:21.890 --> 00:25:24.890 align:middle line:84%
but it could actually
be accurate in the fact

00:25:24.890 --> 00:25:26.780 align:middle line:84%
that this is running
on a data center.

00:25:26.780 --> 00:25:29.000 align:middle line:84%
You can see the
architecture is 64-bit.

00:25:29.000 --> 00:25:31.100 align:middle line:90%
The host name is server.

00:25:31.100 --> 00:25:34.490 align:middle line:84%
Current user is, of course,
antiauthority system.

00:25:34.490 --> 00:25:36.630 align:middle line:84%
It will also get the
current date and time.

00:25:36.630 --> 00:25:38.760 align:middle line:84%
It then enumerates
all user accounts.

00:25:38.760 --> 00:25:40.940 align:middle line:84%
So you can see you
have the administrator,

00:25:40.940 --> 00:25:45.770 align:middle line:84%
you have another username called
auditor, a user called demo,

00:25:45.770 --> 00:25:48.110 align:middle line:84%
the guest user account,
and another user account

00:25:48.110 --> 00:25:49.310 align:middle line:90%
called sysadmin.

00:25:49.310 --> 00:25:51.530 align:middle line:84%
It will then
automate or enumerate

00:25:51.530 --> 00:25:53.330 align:middle line:84%
the network information
that we were

00:25:53.330 --> 00:25:58.220 align:middle line:84%
able to perform within the
actual network information

00:25:58.220 --> 00:25:59.490 align:middle line:90%
enumeration video.

00:25:59.490 --> 00:26:02.780 align:middle line:84%
So you can see that it automates
everything for you so that you

00:26:02.780 --> 00:26:04.510 align:middle line:90%
don't need to do it manually--

00:26:04.510 --> 00:26:05.940 align:middle line:90%
just with one check.

00:26:05.940 --> 00:26:07.910 align:middle line:84%
So there's all the
network information.

00:26:07.910 --> 00:26:10.490 align:middle line:84%
There's the netstat
command that we ran,

00:26:10.490 --> 00:26:12.420 align:middle line:84%
and then, of course,
the firewall status.

00:26:12.420 --> 00:26:14.480 align:middle line:84%
You can see Windows
Firewall is disabled.

00:26:14.480 --> 00:26:17.010 align:middle line:84%
And this is something that,
again, is really cool.

00:26:17.010 --> 00:26:19.860 align:middle line:84%
It will also enumerate a
list of firewall rules.

00:26:19.860 --> 00:26:23.180 align:middle line:84%
So these are all of the
firewall rules right over here.

00:26:23.180 --> 00:26:27.320 align:middle line:84%
And then, it'll also enumerate
the contents of the host file

00:26:27.320 --> 00:26:34.190 align:middle line:84%
to show you any specific
hosts and their FQDN--

00:26:34.190 --> 00:26:36.480 align:middle line:90%
or Fully-Qualified Domain Names.

00:26:36.480 --> 00:26:39.140 align:middle line:84%
And then, of course, it'll
enumerate the processes here

00:26:39.140 --> 00:26:41.780 align:middle line:84%
as we were able to
do as well manually.

00:26:41.780 --> 00:26:43.970 align:middle line:84%
And then, of course,
schedule tasks,

00:26:43.970 --> 00:26:46.310 align:middle line:84%
which is quite a lot
of information as we

00:26:46.310 --> 00:26:50.420 align:middle line:84%
saw during these services
or rather the processes

00:26:50.420 --> 00:26:52.050 align:middle line:90%
and services video.

00:26:52.050 --> 00:26:52.850 align:middle line:90%
So there we are.

00:26:52.850 --> 00:26:54.900 align:middle line:84%
These are all these
scheduled tasks.

00:26:54.900 --> 00:26:57.500 align:middle line:84%
And we can scroll right
to when this is done

00:26:57.500 --> 00:26:59.570 align:middle line:90%
enumerating the schedule tasks.

00:26:59.570 --> 00:27:01.320 align:middle line:90%
It'll also enumerate services.

00:27:01.320 --> 00:27:04.220 align:middle line:84%
So you can see how
helpful this script is.

00:27:04.220 --> 00:27:07.430 align:middle line:84%
So this is a list of
all the services and it

00:27:07.430 --> 00:27:09.060 align:middle line:84%
shows you the ones
that are running,

00:27:09.060 --> 00:27:10.760 align:middle line:84%
as well as the ones
that are stopped.

00:27:10.760 --> 00:27:12.110 align:middle line:90%
And you can go through that.

00:27:12.110 --> 00:27:14.090 align:middle line:84%
It'll also enumerate
the installed programs--

00:27:14.090 --> 00:27:17.717 align:middle line:84%
which we did-- install
patches, program folders.

00:27:17.717 --> 00:27:19.550 align:middle line:84%
So this will tell you
where the programs are

00:27:19.550 --> 00:27:25.790 align:middle line:84%
installed for both program files
and program files 86 or x86.

00:27:25.790 --> 00:27:29.330 align:middle line:84%
And then display files with
full control and modify access.

00:27:29.330 --> 00:27:33.080 align:middle line:84%
So this is very useful
during privilege escalation.

00:27:33.080 --> 00:27:34.610 align:middle line:84%
So it'll essentially
tell you what

00:27:34.610 --> 00:27:37.340 align:middle line:84%
folders and files you can
modify or that you actually

00:27:37.340 --> 00:27:39.200 align:middle line:90%
have the permissions to modify.

00:27:39.200 --> 00:27:43.980 align:middle line:84%
And it makes sense that the
only directories we can modify

00:27:43.980 --> 00:27:47.760 align:middle line:84%
belong to the administrator
user as well as a few others.

00:27:47.760 --> 00:27:50.480 align:middle line:90%
It also lists the mapped drives.

00:27:50.480 --> 00:27:53.810 align:middle line:84%
Then, from this point
onwards, all of these checks

00:27:53.810 --> 00:27:56.990 align:middle line:84%
are really useful during
privilege escalation.

00:27:56.990 --> 00:27:59.120 align:middle line:84%
So you can go through
all of them here.

00:27:59.120 --> 00:28:02.000 align:middle line:84%
And right over here,
it is actually done.

00:28:02.000 --> 00:28:04.520 align:middle line:84%
So you can see, it'll
also check the final check

00:28:04.520 --> 00:28:06.950 align:middle line:90%
for auto admin log on.

00:28:06.950 --> 00:28:09.920 align:middle line:84%
And it will essentially check
whether auto admin log on

00:28:09.920 --> 00:28:10.740 align:middle line:90%
is configured.

00:28:10.740 --> 00:28:13.470 align:middle line:84%
And if it is configured, it'll
provide you with the password.

00:28:13.470 --> 00:28:15.530 align:middle line:84%
But in this case, it
looks like it wasn't

00:28:15.530 --> 00:28:16.710 align:middle line:90%
able to get the password.

00:28:16.710 --> 00:28:21.620 align:middle line:84%
So this is the advantage of
utilizing automated enumeration

00:28:21.620 --> 00:28:22.640 align:middle line:90%
scripts like JAWS.

00:28:22.640 --> 00:28:26.870 align:middle line:84%
As I said, there's quite a few
out there that we will also

00:28:26.870 --> 00:28:28.860 align:middle line:90%
be exploring as we progress.

00:28:28.860 --> 00:28:32.690 align:middle line:84%
But JAWS is one that
has helped me previously

00:28:32.690 --> 00:28:36.290 align:middle line:84%
and is extremely
useful to, essentially,

00:28:36.290 --> 00:28:39.650 align:middle line:84%
automate the local enumeration
process on Windows.

00:28:39.650 --> 00:28:41.990 align:middle line:84%
And furthermore, I
really like the output

00:28:41.990 --> 00:28:46.070 align:middle line:84%
that it actually provides me
with because all of the output

00:28:46.070 --> 00:28:48.590 align:middle line:84%
here can actually
be stored or can

00:28:48.590 --> 00:28:53.850 align:middle line:84%
be pasted within my personal
documentation or my notes.

00:28:53.850 --> 00:28:57.200 align:middle line:84%
And it's done or it's actually
output or formatted in a way

00:28:57.200 --> 00:28:58.580 align:middle line:90%
that I can understand.

00:28:58.580 --> 00:29:02.750 align:middle line:84%
So that is how to automate
the local enumeration

00:29:02.750 --> 00:29:05.000 align:middle line:84%
process on Windows,
and that is going

00:29:05.000 --> 00:29:06.950 align:middle line:84%
to conclude the
practical demonstration

00:29:06.950 --> 00:29:09.990 align:middle line:90%
side of this video.

00:29:09.990 --> 00:29:11.810 align:middle line:84%
All right, so now
that we've explored

00:29:11.810 --> 00:29:15.890 align:middle line:84%
the process of performing
local enumeration on Windows,

00:29:15.890 --> 00:29:18.330 align:middle line:84%
we can now turn our
attention to Linux.

00:29:18.330 --> 00:29:21.990 align:middle line:84%
So in the next section, which
is going to be the next video,

00:29:21.990 --> 00:29:23.510 align:middle line:84%
we're going to get
started with how

00:29:23.510 --> 00:29:26.940 align:middle line:84%
to perform local enumeration
on a Linux system.

00:29:26.940 --> 00:29:30.200 align:middle line:84%
So the next section
will essentially

00:29:30.200 --> 00:29:33.860 align:middle line:84%
follow the same structure
that we had within the Windows

00:29:33.860 --> 00:29:35.570 align:middle line:90%
local enumeration section.

00:29:35.570 --> 00:29:37.130 align:middle line:84%
And at the end of
that section, we

00:29:37.130 --> 00:29:39.110 align:middle line:84%
will also be
exploring the process

00:29:39.110 --> 00:29:42.080 align:middle line:84%
of how to automate
Linux local enumeration.

00:29:42.080 --> 00:29:46.360 align:middle line:84%
With that being said, I'll be
seeing you in the next video.

00:29:46.360 --> 00:29:47.000 align:middle line:90%