WEBVTT

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


00:00:10.080 --> 00:00:13.290 align:middle line:84%
Web Application Vulnerability
Scanning with WMAP.

00:00:13.290 --> 00:00:15.660 align:middle line:84%
So now that we've taken
a look at how to identify

00:00:15.660 --> 00:00:18.690 align:middle line:84%
or how to scan and identify
vulnerabilities on Windows

00:00:18.690 --> 00:00:21.480 align:middle line:84%
and Linux systems through
the use of the Metasploit

00:00:21.480 --> 00:00:25.620 align:middle line:84%
Framework, as well as Nessus,
we can also move or turn

00:00:25.620 --> 00:00:27.780 align:middle line:84%
our attention to
web applications

00:00:27.780 --> 00:00:29.970 align:middle line:84%
and how to identify
vulnerabilities

00:00:29.970 --> 00:00:33.090 align:middle line:84%
within web applications,
as well as the web server

00:00:33.090 --> 00:00:34.200 align:middle line:90%
configuration.

00:00:34.200 --> 00:00:36.700 align:middle line:84%
And this is where
WMAP comes into play.

00:00:36.700 --> 00:00:39.930 align:middle line:84%
So first and foremost,
what is WMAP?

00:00:39.930 --> 00:00:43.140 align:middle line:84%
WMAP is essentially a powerful
feature-rich web application

00:00:43.140 --> 00:00:46.650 align:middle line:84%
vulnerability scanner that can
be used to automate web server

00:00:46.650 --> 00:00:49.860 align:middle line:84%
enumeration, as well as
scan web applications

00:00:49.860 --> 00:00:50.978 align:middle line:90%
for vulnerabilities.

00:00:50.978 --> 00:00:52.770 align:middle line:84%
Now when I'm talking
about vulnerabilities,

00:00:52.770 --> 00:00:54.900 align:middle line:84%
I'm simply referring to
common vulnerabilities

00:00:54.900 --> 00:00:58.170 align:middle line:84%
like SQL injection, so
on and so forth, right?

00:00:58.170 --> 00:01:01.710 align:middle line:84%
And as I said, it can also be
used to automate web server

00:01:01.710 --> 00:01:02.400 align:middle line:90%
enumeration.

00:01:02.400 --> 00:01:05.040 align:middle line:84%
So if you remember during
the enumeration section

00:01:05.040 --> 00:01:06.930 align:middle line:84%
of this course, we
explored the process

00:01:06.930 --> 00:01:10.290 align:middle line:84%
of utilizing various
auxiliary modules to enumerate

00:01:10.290 --> 00:01:11.940 align:middle line:90%
information from a web server.

00:01:11.940 --> 00:01:15.720 align:middle line:84%
Well, WMAP can essentially
automate that process

00:01:15.720 --> 00:01:19.530 align:middle line:84%
and can do everything for us
without us having to again,

00:01:19.530 --> 00:01:21.490 align:middle line:90%
load and utilize those modules.

00:01:21.490 --> 00:01:23.520 align:middle line:90%
So it really, really is awesome.

00:01:23.520 --> 00:01:25.650 align:middle line:84%
Another great
thing about WMAP is

00:01:25.650 --> 00:01:28.200 align:middle line:84%
that it's available as
an Metasploit Framework

00:01:28.200 --> 00:01:31.080 align:middle line:84%
plugin, which means it
can be directly loaded

00:01:31.080 --> 00:01:33.630 align:middle line:84%
into the Metasploit
Framework and comes part

00:01:33.630 --> 00:01:36.450 align:middle line:84%
of the Metasploit Framework
package, which means you don't

00:01:36.450 --> 00:01:38.850 align:middle line:84%
need to download the
module or the plugin

00:01:38.850 --> 00:01:41.460 align:middle line:84%
and then transfer it
into the plugins module.

00:01:41.460 --> 00:01:44.430 align:middle line:84%
It already exists within the
Metasploit Framework plugins

00:01:44.430 --> 00:01:48.180 align:middle line:84%
module, which means all that we
need to do is just load it in

00:01:48.180 --> 00:01:49.480 align:middle line:90%
and we can use it.

00:01:49.480 --> 00:01:54.330 align:middle line:84%
And finally, the
WMAP plugin is also--

00:01:54.330 --> 00:01:57.510 align:middle line:84%
or rather, it can also be
integrated with the Metasploit

00:01:57.510 --> 00:01:58.420 align:middle line:90%
Framework database.

00:01:58.420 --> 00:02:00.900 align:middle line:84%
So all the results
from our vulnerability

00:02:00.900 --> 00:02:03.810 align:middle line:84%
scan on a particular
web application

00:02:03.810 --> 00:02:06.690 align:middle line:84%
will be stored within the
Metasploit Framework database.

00:02:06.690 --> 00:02:08.590 align:middle line:90%
So it really, really is awesome.

00:02:08.590 --> 00:02:10.590 align:middle line:84%
Now in terms of
the lab environment

00:02:10.590 --> 00:02:13.620 align:middle line:84%
that we will be using, we
will be using the same lab

00:02:13.620 --> 00:02:17.250 align:middle line:84%
environment that we utilized
during the web server

00:02:17.250 --> 00:02:20.200 align:middle line:84%
enumeration video in
the enumeration section.

00:02:20.200 --> 00:02:23.610 align:middle line:84%
And if you remember, we
were able to enumerate

00:02:23.610 --> 00:02:25.240 align:middle line:90%
quite a lot of information.

00:02:25.240 --> 00:02:28.080 align:middle line:84%
However, we weren't able to
detect any vulnerabilities that

00:02:28.080 --> 00:02:29.250 align:middle line:90%
can be exploited.

00:02:29.250 --> 00:02:32.330 align:middle line:84%
And this is where vulnerability
scanning comes into play.

00:02:32.330 --> 00:02:36.270 align:middle line:84%
So we'll be taking a look at
how to identify vulnerabilities

00:02:36.270 --> 00:02:38.340 align:middle line:84%
within the web
server configuration,

00:02:38.340 --> 00:02:41.370 align:middle line:84%
as well as the web application
that's being hosted on the web

00:02:41.370 --> 00:02:43.230 align:middle line:90%
server with WMAP.

00:02:43.230 --> 00:02:46.590 align:middle line:84%
So I'll see you in
the lab environment.

00:02:46.590 --> 00:02:49.475 align:middle line:84%
All right, so I'm back
within the lab environment.

00:02:49.475 --> 00:02:50.850 align:middle line:84%
And the first
thing we want to do

00:02:50.850 --> 00:02:52.830 align:middle line:84%
is, of course,
identify the target

00:02:52.830 --> 00:02:57.480 align:middle line:84%
IP, which can be done by typing
in ifconfig, hitting Enter.

00:02:57.480 --> 00:03:00.090 align:middle line:84%
And we're interested in
the ethernet 1 interface,

00:03:00.090 --> 00:03:02.200 align:middle line:90%
and this is our IP address.

00:03:02.200 --> 00:03:05.520 align:middle line:84%
The target IP address is
going to be on the same subnet

00:03:05.520 --> 00:03:10.230 align:middle line:84%
under the IP address
192.157.89.3.

00:03:10.230 --> 00:03:13.200 align:middle line:84%
So it's always going to
be on the third IP address

00:03:13.200 --> 00:03:16.170 align:middle line:84%
on this subnet irregardless
of what the subnet is.

00:03:16.170 --> 00:03:19.060 align:middle line:84%
So again, the IP will change
within your lab environment.

00:03:19.060 --> 00:03:22.020 align:middle line:84%
The only thing you need to
do is change the 2 into a 3.

00:03:22.020 --> 00:03:23.278 align:middle line:90%
So we'll copy that.

00:03:23.278 --> 00:03:25.570 align:middle line:84%
The next thing we want to do
is start up the PostgreSQL

00:03:25.570 --> 00:03:27.700 align:middle line:90%
database service.

00:03:27.700 --> 00:03:30.780 align:middle line:84%
So I'm going to say
Service PostgreSQL Start.

00:03:30.780 --> 00:03:32.490 align:middle line:84%
That will start up
the database service

00:03:32.490 --> 00:03:36.010 align:middle line:84%
so that we can interact with the
Metasploit Framework database.

00:03:36.010 --> 00:03:38.580 align:middle line:84%
And once that is done,
we type in MSFConsole

00:03:38.580 --> 00:03:40.860 align:middle line:84%
to launch the Metasploit
Framework console.

00:03:40.860 --> 00:03:43.440 align:middle line:84%
So again, we'll give
that a few seconds there.

00:03:43.440 --> 00:03:57.268 align:middle line:90%


00:03:57.268 --> 00:03:59.060 align:middle line:84%
All right, so the first
thing we want to do

00:03:59.060 --> 00:04:04.490 align:middle line:84%
is set up a workspace for all
our work and for our scanning

00:04:04.490 --> 00:04:07.610 align:middle line:84%
so that all the data is
separated from any other hosts

00:04:07.610 --> 00:04:08.610 align:middle line:90%
that you're working on.

00:04:08.610 --> 00:04:10.880 align:middle line:84%
So we'll say Workspace
Add and we'll just

00:04:10.880 --> 00:04:14.780 align:middle line:90%
call this web_scanning right?

00:04:14.780 --> 00:04:16.500 align:middle line:84%
Just to keep things
nice and simple.

00:04:16.500 --> 00:04:17.149 align:middle line:90%
There we are.

00:04:17.149 --> 00:04:19.339 align:middle line:84%
So we're currently
within that workspace.

00:04:19.339 --> 00:04:22.640 align:middle line:84%
The next thing we want to do
is set up some global variables

00:04:22.640 --> 00:04:24.710 align:middle line:84%
for the RHOST values
so that we don't

00:04:24.710 --> 00:04:27.770 align:middle line:84%
need to, again, set the
RHOST value whenever

00:04:27.770 --> 00:04:29.060 align:middle line:90%
we use a new module.

00:04:29.060 --> 00:04:31.350 align:middle line:84%
So I'm going to again,
specify the IP and, of course,

00:04:31.350 --> 00:04:33.020 align:middle line:90%
change the 2 into a 3.

00:04:33.020 --> 00:04:36.050 align:middle line:84%
We hit Enter, and that should
set up the global variable

00:04:36.050 --> 00:04:38.300 align:middle line:84%
for the RHOST option
so that again, we

00:04:38.300 --> 00:04:40.640 align:middle line:84%
don't need to type
in the target IP

00:04:40.640 --> 00:04:42.285 align:middle line:90%
whenever we're using a module.

00:04:42.285 --> 00:04:43.160 align:middle line:90%
All right, excellent.

00:04:43.160 --> 00:04:47.780 align:middle line:84%
So we can load up the WMAP
module by typing in Load

00:04:47.780 --> 00:04:49.430 align:middle line:90%
and then WMAP.

00:04:49.430 --> 00:04:51.470 align:middle line:84%
Once we hit Enter,
it'll tell you

00:04:51.470 --> 00:04:55.400 align:middle line:84%
the plugin is successfully
loaded-- there we are, WMAP.

00:04:55.400 --> 00:04:59.390 align:middle line:84%
And in order to use it, what we
can do is simply type in WMAP.

00:04:59.390 --> 00:05:01.250 align:middle line:84%
And then, of course,
underscore, and you

00:05:01.250 --> 00:05:04.250 align:middle line:84%
can use Tab or to completion to
list out the various commands

00:05:04.250 --> 00:05:05.480 align:middle line:90%
that you can run.

00:05:05.480 --> 00:05:08.120 align:middle line:84%
All right, so we have
the WMAP Modules command,

00:05:08.120 --> 00:05:13.260 align:middle line:84%
we have Nodes, Run, Sites, WMAP
Targets, WMAP Vulnerability.

00:05:13.260 --> 00:05:15.230 align:middle line:90%
So we can utilize any of these.

00:05:15.230 --> 00:05:18.650 align:middle line:84%
However, because we're doing
this in a structured way, what

00:05:18.650 --> 00:05:22.070 align:middle line:84%
we want to do is firstly,
take a look at our sites.

00:05:22.070 --> 00:05:25.350 align:middle line:84%
Because we want to add
a site as our target.

00:05:25.350 --> 00:05:27.140 align:middle line:84%
So I'll open up
the documentation

00:05:27.140 --> 00:05:29.180 align:middle line:90%
for the WMAP Sites command.

00:05:29.180 --> 00:05:30.140 align:middle line:90%
I'll hit Enter.

00:05:30.140 --> 00:05:33.680 align:middle line:84%
So this particular command
is used to specify a site.

00:05:33.680 --> 00:05:36.680 align:middle line:84%
So we can use this to add a
site that we want to scan.

00:05:36.680 --> 00:05:39.110 align:middle line:84%
You also have the
ability to delete sites.

00:05:39.110 --> 00:05:41.900 align:middle line:84%
And again, that is
in the event that you

00:05:41.900 --> 00:05:46.220 align:middle line:84%
want to delete another site or
a site that you're done with.

00:05:46.220 --> 00:05:48.830 align:middle line:84%
And then of course, you can
list out the available sites

00:05:48.830 --> 00:05:50.210 align:middle line:90%
and then display the structure.

00:05:50.210 --> 00:05:52.150 align:middle line:84%
In our case, we're
going to add our sites.

00:05:52.150 --> 00:05:53.870 align:middle line:90%
So I'm going to say WMAP Sites.

00:05:53.870 --> 00:05:55.280 align:middle line:90%
And we'll say Add.

00:05:55.280 --> 00:06:00.540 align:middle line:84%
And to do this, we can type in
the IP address right over here.

00:06:00.540 --> 00:06:03.860 align:middle line:84%
So I'll again, type in the
target IP address there.

00:06:03.860 --> 00:06:06.320 align:middle line:90%
So WMAP Sites A, hit Enter.

00:06:06.320 --> 00:06:08.420 align:middle line:84%
That's going to
say Site Created.

00:06:08.420 --> 00:06:10.880 align:middle line:84%
We then need to set
up our target, right?

00:06:10.880 --> 00:06:16.040 align:middle line:84%
So we can open up the WMAP
Targets, the WMAP Targets

00:06:16.040 --> 00:06:19.280 align:middle line:84%
command, and we can open
up the documentation.

00:06:19.280 --> 00:06:23.180 align:middle line:84%
This allows us to
specify the target URLs

00:06:23.180 --> 00:06:26.700 align:middle line:84%
that we want to again, perform
a vulnerability scan on.

00:06:26.700 --> 00:06:28.960 align:middle line:84%
So we can define
the target site.

00:06:28.960 --> 00:06:30.500 align:middle line:90%
So it's very simple.

00:06:30.500 --> 00:06:31.820 align:middle line:90%
We can either use a V--

00:06:31.820 --> 00:06:35.810 align:middle line:84%
Virtual Host URL space
Virtual Host et cetera.

00:06:35.810 --> 00:06:38.780 align:middle line:84%
And we can also
define the target IDs

00:06:38.780 --> 00:06:41.120 align:middle line:84%
if we want to change
up the various IDs

00:06:41.120 --> 00:06:43.820 align:middle line:90%
for the various targets.

00:06:43.820 --> 00:06:45.710 align:middle line:84%
And that, of course,
is in the event

00:06:45.710 --> 00:06:49.190 align:middle line:84%
that you have more than one
target configured, right?

00:06:49.190 --> 00:06:51.110 align:middle line:84%
Because whenever
you perform a scan,

00:06:51.110 --> 00:06:53.900 align:middle line:84%
the scan will go through
all the targets in the order

00:06:53.900 --> 00:06:54.780 align:middle line:90%
that they are sorted.

00:06:54.780 --> 00:06:58.040 align:middle line:84%
So it'll start off with
target 1, 2, 3, et cetera.

00:06:58.040 --> 00:07:00.920 align:middle line:84%
And then you can also
clean out your targets.

00:07:00.920 --> 00:07:02.510 align:middle line:84%
So again, if you
want to start afresh

00:07:02.510 --> 00:07:05.060 align:middle line:84%
with a new list of targets,
you can use the Clean option

00:07:05.060 --> 00:07:07.320 align:middle line:90%
to delete your current list.

00:07:07.320 --> 00:07:11.780 align:middle line:84%
So to add one, we're
going to say wmap_targets.

00:07:11.780 --> 00:07:13.460 align:middle line:84%
And we're going to
specify the T option.

00:07:13.460 --> 00:07:15.410 align:middle line:84%
And because we're
specifying the URL now,

00:07:15.410 --> 00:07:19.790 align:middle line:84%
we need to say HTTP, because we
know the target server or web

00:07:19.790 --> 00:07:21.350 align:middle line:90%
server is running on port 80.

00:07:21.350 --> 00:07:24.590 align:middle line:84%
And of course, we'll change
the IP to a 3 at the end.

00:07:24.590 --> 00:07:27.350 align:middle line:84%
And then you can specify
a specific directory

00:07:27.350 --> 00:07:29.430 align:middle line:84%
that you want to scan
for, but in our case,

00:07:29.430 --> 00:07:34.460 align:middle line:84%
we are starting off just
basically within the root

00:07:34.460 --> 00:07:35.400 align:middle line:90%
of the web server.

00:07:35.400 --> 00:07:38.640 align:middle line:84%
So we're actually targeting
the web application itself.

00:07:38.640 --> 00:07:40.580 align:middle line:84%
And we hit Enter,
so that's going

00:07:40.580 --> 00:07:43.160 align:middle line:84%
to say WMAP Targets
has been added.

00:07:43.160 --> 00:07:45.530 align:middle line:84%
And we can then,
again, check our sites

00:07:45.530 --> 00:07:49.550 align:middle line:84%
by saying WMAP Sites and
L. That will list them out.

00:07:49.550 --> 00:07:51.830 align:middle line:84%
You can see that it's
going to show you

00:07:51.830 --> 00:07:54.740 align:middle line:84%
the sites that you've added
and the port and protocol,

00:07:54.740 --> 00:07:57.560 align:middle line:84%
as well as the pages in forms
that it's currently scanned.

00:07:57.560 --> 00:08:00.980 align:middle line:84%
This will be enumerated
once we perform the scan.

00:08:00.980 --> 00:08:03.770 align:middle line:84%
You can also, again, do
the same for targets.

00:08:03.770 --> 00:08:08.000 align:middle line:84%
So we'll say WMAP Targets, and
then, of course, L, hit Enter.

00:08:08.000 --> 00:08:09.680 align:middle line:84%
As you can see, this
will also display

00:08:09.680 --> 00:08:13.500 align:middle line:84%
the target IP, the port where
the SSL has been configured.

00:08:13.500 --> 00:08:16.370 align:middle line:84%
And then the path if you've
specified a specific path

00:08:16.370 --> 00:08:19.230 align:middle line:84%
that you want to perform
the vulnerability scan on.

00:08:19.230 --> 00:08:19.730 align:middle line:90%
All right.

00:08:19.730 --> 00:08:22.010 align:middle line:84%
So as I mentioned
previously, WMAP

00:08:22.010 --> 00:08:25.400 align:middle line:84%
utilizes the in-built Metasploit
Framework auxiliary modules

00:08:25.400 --> 00:08:27.680 align:middle line:84%
to perform
vulnerability scanning.

00:08:27.680 --> 00:08:30.830 align:middle line:84%
And of course, they are
very useful in identifying

00:08:30.830 --> 00:08:32.250 align:middle line:90%
various vulnerabilities.

00:08:32.250 --> 00:08:36.020 align:middle line:84%
Now, in order to actually
define or to set up

00:08:36.020 --> 00:08:39.530 align:middle line:84%
the specific modules that we
want to use based on the target

00:08:39.530 --> 00:08:43.679 align:middle line:84%
web application, we need to
utilize a specific command

00:08:43.679 --> 00:08:44.179 align:middle line:90%
here.

00:08:44.179 --> 00:08:49.790 align:middle line:84%
And that command is the WMAP
T option or WMAP Run T option.

00:08:49.790 --> 00:08:52.490 align:middle line:84%
And what this will do
is it'll essentially

00:08:52.490 --> 00:08:57.070 align:middle line:84%
check for the various auxiliary
modules that would essentially

00:08:57.070 --> 00:09:00.280 align:middle line:84%
makes sense, or rather
would be useful in regards

00:09:00.280 --> 00:09:00.940 align:middle line:90%
to our targets.

00:09:00.940 --> 00:09:03.100 align:middle line:84%
It will search for
only the modules

00:09:03.100 --> 00:09:06.370 align:middle line:84%
that again, will be able
to enumerate information

00:09:06.370 --> 00:09:07.230 align:middle line:90%
from all targets.

00:09:07.230 --> 00:09:10.060 align:middle line:84%
So it's not going to use any
other type of auxiliary modules

00:09:10.060 --> 00:09:12.490 align:middle line:84%
that may be target
the IIS web server.

00:09:12.490 --> 00:09:16.600 align:middle line:84%
So again, we can do
this by saying WMAP.

00:09:16.600 --> 00:09:18.910 align:middle line:84%
And then under
that, we'll say Run.

00:09:18.910 --> 00:09:22.510 align:middle line:84%
And then open you can open up
the documentation for the WMAP

00:09:22.510 --> 00:09:23.343 align:middle line:90%
Run command.

00:09:23.343 --> 00:09:24.760 align:middle line:84%
And as you can
see, this will show

00:09:24.760 --> 00:09:28.660 align:middle line:84%
you the all enabled modules
for your particular target.

00:09:28.660 --> 00:09:30.860 align:middle line:84%
And in our case, we
haven't done that yet.

00:09:30.860 --> 00:09:33.190 align:middle line:84%
So the next step
would be to do that.

00:09:33.190 --> 00:09:36.080 align:middle line:84%
And then once we've
done that, it's

00:09:36.080 --> 00:09:39.320 align:middle line:84%
going to say we can use the E
option to launch the profile

00:09:39.320 --> 00:09:42.110 align:middle line:84%
modules against all
matched targets, right?

00:09:42.110 --> 00:09:47.210 align:middle line:84%
So no profile will run
all enabled modules

00:09:47.210 --> 00:09:48.720 align:middle line:90%
and so on and so forth.

00:09:48.720 --> 00:09:53.480 align:middle line:84%
So we'll type in WMAP Run and
T to show all enabled modules.

00:09:53.480 --> 00:09:55.730 align:middle line:84%
And then we're just
going to wait for that

00:09:55.730 --> 00:09:57.260 align:middle line:90%
to load the WMAP module.

00:09:57.260 --> 00:10:00.420 align:middle line:84%
So we'll give that
a few seconds.

00:10:00.420 --> 00:10:02.210 align:middle line:84%
All right, so once
that is done, as you

00:10:02.210 --> 00:10:04.940 align:middle line:84%
can see it will display all
the auxiliary modules that

00:10:04.940 --> 00:10:07.640 align:middle line:84%
will be used to, again,
perform the vulnerability

00:10:07.640 --> 00:10:10.910 align:middle line:84%
scan on our target based on
our target configuration.

00:10:10.910 --> 00:10:12.410 align:middle line:84%
So you can see it's
going to tell us

00:10:12.410 --> 00:10:15.260 align:middle line:90%
39 WMAP enabled modules loaded.

00:10:15.260 --> 00:10:18.860 align:middle line:84%
And for example, SSL testing--
because our target does not

00:10:18.860 --> 00:10:22.760 align:middle line:84%
have an SSL certificate-- it's
going to disable SSL modules.

00:10:22.760 --> 00:10:24.440 align:middle line:84%
And then under Web
Server Testing,

00:10:24.440 --> 00:10:27.260 align:middle line:84%
it'll give you an idea of
the various auxiliary modules

00:10:27.260 --> 00:10:28.040 align:middle line:90%
it will use.

00:10:28.040 --> 00:10:31.700 align:middle line:84%
For directory brute forcing, it
will again, do the same thing.

00:10:31.700 --> 00:10:33.300 align:middle line:90%
For unique query testing--

00:10:33.300 --> 00:10:37.407 align:middle line:84%
so this is for SQL Injection
and HTTP Traversal--

00:10:37.407 --> 00:10:38.990 align:middle line:84%
these are the modules
it'll use, which

00:10:38.990 --> 00:10:42.350 align:middle line:84%
can be very helpful in
identifying SQL Injection

00:10:42.350 --> 00:10:45.320 align:middle line:84%
vulnerabilities, so on
and so forth, right?

00:10:45.320 --> 00:10:48.170 align:middle line:84%
So in order to run
our vulnerability scan

00:10:48.170 --> 00:10:49.880 align:middle line:84%
against the target,
all we need to do

00:10:49.880 --> 00:10:55.310 align:middle line:84%
is type in wmap_run and
then E. And because we're

00:10:55.310 --> 00:10:57.560 align:middle line:84%
using our current
profile, we'll hit Enter.

00:10:57.560 --> 00:10:59.690 align:middle line:84%
As you can see,
it's going to use

00:10:59.690 --> 00:11:04.440 align:middle line:84%
all WMAP enabled modules, which
in this case, was about 39.

00:11:04.440 --> 00:11:06.080 align:middle line:90%
So the same thing there.

00:11:06.080 --> 00:11:09.590 align:middle line:84%
And you can see it's going
to start testing the target.

00:11:09.590 --> 00:11:13.070 align:middle line:84%
And it says right over here,
there's no SSL certificate.

00:11:13.070 --> 00:11:15.140 align:middle line:84%
And then it begins
performing its checks

00:11:15.140 --> 00:11:17.100 align:middle line:84%
using the various
auxiliary modules.

00:11:17.100 --> 00:11:20.270 align:middle line:84%
So for example, we get
the web server version

00:11:20.270 --> 00:11:24.350 align:middle line:84%
by utilizing the HTTP
version auxiliary modules.

00:11:24.350 --> 00:11:25.850 align:middle line:84%
So you can see that
this pretty much

00:11:25.850 --> 00:11:29.690 align:middle line:84%
automates whatever we did during
the web server enumeration

00:11:29.690 --> 00:11:30.320 align:middle line:90%
video.

00:11:30.320 --> 00:11:32.420 align:middle line:84%
And in this case,
I'll actually show you

00:11:32.420 --> 00:11:36.080 align:middle line:84%
how to use this information
to identify or detect

00:11:36.080 --> 00:11:38.990 align:middle line:84%
specific vulnerabilities that
we can then exploit, right?

00:11:38.990 --> 00:11:43.330 align:middle line:84%
So it will run all the enabled
modules and right over here,

00:11:43.330 --> 00:11:46.700 align:middle line:84%
it's now at the file and
directory brute force stage.

00:11:46.700 --> 00:11:48.920 align:middle line:84%
So it's going to utilize
all of the modules there

00:11:48.920 --> 00:11:51.840 align:middle line:84%
to essentially
detect and identify

00:11:51.840 --> 00:11:53.840 align:middle line:84%
various directories
on the web server,

00:11:53.840 --> 00:11:56.400 align:middle line:84%
as well as various
files on the web server.

00:11:56.400 --> 00:11:58.680 align:middle line:84%
So this is going to
take a few minutes.

00:11:58.680 --> 00:12:01.510 align:middle line:84%
I'm just going to wait
for it to complete.

00:12:01.510 --> 00:12:03.970 align:middle line:84%
All right, so the
scanning is complete.

00:12:03.970 --> 00:12:07.290 align:middle line:84%
And as you can see, there's
quite a lot of information

00:12:07.290 --> 00:12:08.580 align:middle line:90%
that's output.

00:12:08.580 --> 00:12:11.550 align:middle line:84%
And all of this information,
again, is quite important

00:12:11.550 --> 00:12:13.090 align:middle line:84%
and we'll get to
that in a second.

00:12:13.090 --> 00:12:16.950 align:middle line:84%
So we start off with the
results at the beginning here.

00:12:16.950 --> 00:12:21.390 align:middle line:84%
You can see that under the
various HTTP enumeration

00:12:21.390 --> 00:12:26.010 align:middle line:84%
modules, we also have one here
called the Auxiliary Scanner

00:12:26.010 --> 00:12:28.230 align:middle line:84%
HTTP Options module,
which will essentially

00:12:28.230 --> 00:12:33.030 align:middle line:84%
check for the enabled
HTTP methods, or rather--

00:12:33.030 --> 00:12:34.170 align:middle line:90%
yeah, exactly.

00:12:34.170 --> 00:12:37.510 align:middle line:84%
The HTTP methods allowed
on this web server,

00:12:37.510 --> 00:12:39.210 align:middle line:84%
we can see that
we have a GET HEAD

00:12:39.210 --> 00:12:42.400 align:middle line:84%
POST, which is interesting, and
we'll get to that in a second.

00:12:42.400 --> 00:12:44.770 align:middle line:84%
And of course the
Options method.

00:12:44.770 --> 00:12:48.540 align:middle line:84%
So with that-- and
again, the POST method

00:12:48.540 --> 00:12:51.460 align:middle line:84%
is particularly important, but
we'll get to that in a second.

00:12:51.460 --> 00:12:55.180 align:middle line:84%
You can see it also goes
through the robots.txt file.

00:12:55.180 --> 00:12:56.290 align:middle line:90%
And in this case--

00:12:56.290 --> 00:12:58.440 align:middle line:84%
and you can see that
we find the data

00:12:58.440 --> 00:13:00.090 align:middle line:84%
and secure directories
that we were

00:13:00.090 --> 00:13:03.360 align:middle line:84%
able to find during the web
server enumeration video.

00:13:03.360 --> 00:13:05.730 align:middle line:84%
And we targeted the
secure directory

00:13:05.730 --> 00:13:09.660 align:middle line:84%
because that actually had
an authentication form.

00:13:09.660 --> 00:13:12.390 align:middle line:84%
However, we were not successful
with our brute force.

00:13:12.390 --> 00:13:15.780 align:middle line:84%
In this particular case, we will
be targeting the data directory

00:13:15.780 --> 00:13:17.250 align:middle line:84%
because that one
looks interesting.

00:13:17.250 --> 00:13:18.990 align:middle line:84%
And we'll actually
take a look at how

00:13:18.990 --> 00:13:21.480 align:middle line:84%
to identify whether
we can do anything

00:13:21.480 --> 00:13:24.330 align:middle line:84%
malicious with that
directory by taking

00:13:24.330 --> 00:13:27.480 align:middle line:84%
a look at the
various HTTP methods

00:13:27.480 --> 00:13:29.680 align:middle line:84%
that are currently enabled
for that directory.

00:13:29.680 --> 00:13:31.470 align:middle line:84%
So we'll get to
that in a second.

00:13:31.470 --> 00:13:32.970 align:middle line:84%
The other information
displayed here

00:13:32.970 --> 00:13:36.040 align:middle line:84%
is really just the
version information.

00:13:36.040 --> 00:13:38.640 align:middle line:84%
So you can see Apache,
the version of Apache.

00:13:38.640 --> 00:13:41.050 align:middle line:84%
And then it performs the
file and directory testing.

00:13:41.050 --> 00:13:44.760 align:middle line:84%
So we're able to identify the
various directories on the web

00:13:44.760 --> 00:13:46.200 align:middle line:90%
server.

00:13:46.200 --> 00:13:49.080 align:middle line:84%
So we have data downloads,
doc icons, et cetera.

00:13:49.080 --> 00:13:52.530 align:middle line:84%
We also have the secure
directory, as well as

00:13:52.530 --> 00:13:54.000 align:middle line:90%
a few others here.

00:13:54.000 --> 00:13:58.140 align:middle line:84%
And we then move on to
the file brute force.

00:13:58.140 --> 00:13:59.610 align:middle line:84%
So these are all
the files that it

00:13:59.610 --> 00:14:02.580 align:middle line:84%
was able to find on
the target web server.

00:14:02.580 --> 00:14:05.550 align:middle line:84%
So we have index.html
Desktop PHP.

00:14:05.550 --> 00:14:08.380 align:middle line:84%
So nothing really
interesting there.

00:14:08.380 --> 00:14:13.170 align:middle line:84%
And then we have the HTTP,
the auxiliary module here.

00:14:13.170 --> 00:14:16.620 align:middle line:84%
Auxiliary Scanner
HTTP, HTTP PUT.

00:14:16.620 --> 00:14:18.480 align:middle line:84%
You can see that
in this case, it

00:14:18.480 --> 00:14:21.450 align:middle line:84%
targets the default
route of the web server

00:14:21.450 --> 00:14:23.500 align:middle line:84%
and it tells us the file
doesn't seem to exist.

00:14:23.500 --> 00:14:27.520 align:middle line:84%
However, we'll actually come
back to this particular module.

00:14:27.520 --> 00:14:30.120 align:middle line:84%
So I'm actually just going to
copy it because we can actually

00:14:30.120 --> 00:14:35.550 align:middle line:84%
use this module to test a few
of the allowed HTTP methods.

00:14:35.550 --> 00:14:38.860 align:middle line:84%
And because we have the
POST method, which is very,

00:14:38.860 --> 00:14:41.490 align:middle line:84%
very interesting and is
very similar to the HTTP PUT

00:14:41.490 --> 00:14:44.430 align:middle line:84%
method-- we'll actually
test that in a few seconds--

00:14:44.430 --> 00:14:46.970 align:middle line:84%
you can see that essentially
goes through all the modules

00:14:46.970 --> 00:14:47.470 align:middle line:90%
here.

00:14:47.470 --> 00:14:49.230 align:middle line:84%
And in this case,
we can see it's

00:14:49.230 --> 00:14:52.360 align:middle line:84%
not vulnerable to SQL Injection
or anything like that.

00:14:52.360 --> 00:14:54.960 align:middle line:84%
You can also list out all
of the vulnerabilities

00:14:54.960 --> 00:14:59.640 align:middle line:84%
that WMAP was able to detect
by firstly typing WMAP

00:14:59.640 --> 00:15:03.040 align:middle line:84%
and then underscore
vulnerabilities.

00:15:03.040 --> 00:15:05.010 align:middle line:84%
And then if we open
up the documentation

00:15:05.010 --> 00:15:06.750 align:middle line:84%
for this particular
command, you can

00:15:06.750 --> 00:15:09.520 align:middle line:84%
see we can list out all the
vulnerabilities using the L

00:15:09.520 --> 00:15:10.020 align:middle line:90%
option.

00:15:10.020 --> 00:15:12.540 align:middle line:84%
So if we hit Enter, these
are all the vulnerabilities

00:15:12.540 --> 00:15:13.660 align:middle line:90%
it was able to find.

00:15:13.660 --> 00:15:17.020 align:middle line:84%
And in this case, it's
mostly just directories here.

00:15:17.020 --> 00:15:19.950 align:middle line:84%
So you can see we have
the Pro directory,

00:15:19.950 --> 00:15:22.090 align:middle line:84%
and then, of course, all
of the other ones here.

00:15:22.090 --> 00:15:24.960 align:middle line:84%
So these are really
not vulnerabilities.

00:15:24.960 --> 00:15:27.540 align:middle line:84%
However, if we take
a look at the output,

00:15:27.540 --> 00:15:29.490 align:middle line:84%
the most important
piece of information

00:15:29.490 --> 00:15:31.650 align:middle line:84%
that we are able
to identify here

00:15:31.650 --> 00:15:34.950 align:middle line:84%
is the various HTTP
options available

00:15:34.950 --> 00:15:37.510 align:middle line:84%
or that can be used
on this web server.

00:15:37.510 --> 00:15:42.540 align:middle line:84%
And as I said, we can utilize
the HTTP PUT auxiliary module

00:15:42.540 --> 00:15:45.960 align:middle line:84%
to actually test whether
or not we can upload or put

00:15:45.960 --> 00:15:47.580 align:middle line:90%
a file within a directory.

00:15:47.580 --> 00:15:50.520 align:middle line:84%
And of course, this
is not a safe method

00:15:50.520 --> 00:15:54.060 align:middle line:84%
to actually have on a web server
or to have configured on a web

00:15:54.060 --> 00:15:56.340 align:middle line:84%
server because attackers
can potentially

00:15:56.340 --> 00:15:59.190 align:middle line:84%
use it to upload
malicious files or they

00:15:59.190 --> 00:16:01.570 align:middle line:90%
can use it to deface a website.

00:16:01.570 --> 00:16:03.270 align:middle line:84%
So in this case,
what we'll do is

00:16:03.270 --> 00:16:05.130 align:middle line:84%
we'll just go back
to the bottom here

00:16:05.130 --> 00:16:07.950 align:middle line:84%
and we will essentially
just say Use and paste

00:16:07.950 --> 00:16:12.000 align:middle line:84%
in the module Auxiliary
Scanner HTTP, HTTP PUT.

00:16:12.000 --> 00:16:15.090 align:middle line:84%
However, before we actually
do that, if we again,

00:16:15.090 --> 00:16:17.530 align:middle line:90%
use the HTTP Options module--

00:16:17.530 --> 00:16:20.700 align:middle line:84%
and then if we show
the options here,

00:16:20.700 --> 00:16:22.140 align:middle line:84%
you can see that
the target IP has

00:16:22.140 --> 00:16:25.050 align:middle line:84%
been configured because of
the global variable we set.

00:16:25.050 --> 00:16:27.630 align:middle line:84%
If we just hit Run on
the default directory,

00:16:27.630 --> 00:16:31.050 align:middle line:84%
you can see for the
root of the web server,

00:16:31.050 --> 00:16:34.140 align:middle line:84%
it currently says that we
have the GET HEAD POST options

00:16:34.140 --> 00:16:34.900 align:middle line:90%
methods.

00:16:34.900 --> 00:16:39.360 align:middle line:84%
So what we can do is let's
actually use the HTTP PUT

00:16:39.360 --> 00:16:43.860 align:middle line:84%
auxiliary module to test various
directories on the web server

00:16:43.860 --> 00:16:46.590 align:middle line:84%
to see whether we can
actually put a file

00:16:46.590 --> 00:16:48.550 align:middle line:90%
within that specific directory.

00:16:48.550 --> 00:16:51.690 align:middle line:84%
So again, if I say
Show Options, you

00:16:51.690 --> 00:16:54.330 align:middle line:84%
can see that the current
action is set to PUT.

00:16:54.330 --> 00:16:57.900 align:middle line:84%
So we can either PUT or DELETE
a particular file or resource

00:16:57.900 --> 00:16:59.220 align:middle line:90%
from a web server.

00:16:59.220 --> 00:17:01.510 align:middle line:84%
And then the file data
is specified here.

00:17:01.510 --> 00:17:03.010 align:middle line:84%
And in this case,
what it's doing is

00:17:03.010 --> 00:17:09.490 align:middle line:84%
it'll try and put a file
called MSF HTTP PUT TEST.TXT.

00:17:09.490 --> 00:17:13.450 align:middle line:84%
And then the actual data
within that particular file

00:17:13.450 --> 00:17:15.220 align:middle line:90%
will be MSF Test File.

00:17:15.220 --> 00:17:17.599 align:middle line:84%
And the path is set to
the root of the web server

00:17:17.599 --> 00:17:19.839 align:middle line:84%
so we can just hit Enter
and run a quick test.

00:17:19.839 --> 00:17:22.869 align:middle line:84%
As you can see, the file
doesn't seem to exist.

00:17:22.869 --> 00:17:25.089 align:middle line:90%
The upload probably failed.

00:17:25.089 --> 00:17:28.690 align:middle line:84%
All right, so that means that
the root of the web server

00:17:28.690 --> 00:17:33.110 align:middle line:84%
currently doesn't allow us
to utilize the PUT method.

00:17:33.110 --> 00:17:36.640 align:middle line:84%
So we can actually change that
to the Data Directory, which

00:17:36.640 --> 00:17:38.020 align:middle line:90%
looked very, very interesting.

00:17:38.020 --> 00:17:42.040 align:middle line:84%
So again, if we set
the path here to Data

00:17:42.040 --> 00:17:44.890 align:middle line:84%
and then we hit
Enter and then Run,

00:17:44.890 --> 00:17:48.580 align:middle line:84%
you can see that it says the
file was uploaded successfully.

00:17:48.580 --> 00:17:51.490 align:middle line:84%
A-ha, so we've been able to
again, test that vulnerability

00:17:51.490 --> 00:17:52.880 align:middle line:90%
and then exploit it.

00:17:52.880 --> 00:17:55.120 align:middle line:84%
And in this case,
we have the ability

00:17:55.120 --> 00:17:59.770 align:middle line:84%
to upload or to actually put a
file within the Data Directory.

00:17:59.770 --> 00:18:01.930 align:middle line:84%
And that's probably
why it was set up.

00:18:01.930 --> 00:18:03.760 align:middle line:84%
And in this case,
what we're doing is

00:18:03.760 --> 00:18:07.570 align:middle line:84%
we're essentially exploiting
a poorly configured web server

00:18:07.570 --> 00:18:10.580 align:middle line:84%
or web application
for that matter.

00:18:10.580 --> 00:18:13.180 align:middle line:84%
Now the HTTP PUT
and POST methods

00:18:13.180 --> 00:18:16.150 align:middle line:84%
are fairly similar in that they
allow us to essentially create

00:18:16.150 --> 00:18:19.840 align:middle line:84%
a new resource or are used
to send or submit data

00:18:19.840 --> 00:18:20.870 align:middle line:90%
to a web server.

00:18:20.870 --> 00:18:23.240 align:middle line:84%
And of course, you should
be familiar with them

00:18:23.240 --> 00:18:26.200 align:middle line:84%
if you've worked with
HTTP, the protocol.

00:18:26.200 --> 00:18:28.600 align:middle line:84%
In this case, what an
attacker would typically

00:18:28.600 --> 00:18:31.960 align:middle line:84%
do is they would
essentially utilize

00:18:31.960 --> 00:18:35.170 align:middle line:84%
this vulnerability or this
misconfiguration to upload

00:18:35.170 --> 00:18:37.870 align:middle line:90%
a web payload here, right?

00:18:37.870 --> 00:18:41.140 align:middle line:84%
So they will essentially specify
the file name and the file data

00:18:41.140 --> 00:18:44.620 align:middle line:84%
and they'll upload a web payload
to the target web server.

00:18:44.620 --> 00:18:47.170 align:middle line:84%
And then they'll set up
their reverse listener here,

00:18:47.170 --> 00:18:49.150 align:middle line:90%
a Meterpreter listener.

00:18:49.150 --> 00:18:52.630 align:middle line:84%
And then whenever they'll browse
to that particular directory

00:18:52.630 --> 00:18:56.260 align:middle line:84%
and to that particular file,
then that particular payload

00:18:56.260 --> 00:18:57.280 align:middle line:90%
will be executed.

00:18:57.280 --> 00:19:01.420 align:middle line:84%
And consequently, the
attacker will actually

00:19:01.420 --> 00:19:04.570 align:middle line:84%
receive a reverse connection
if they actually configured

00:19:04.570 --> 00:19:06.580 align:middle line:90%
a reverse shell payload.

00:19:06.580 --> 00:19:10.720 align:middle line:84%
So in our case, what we can do
is we can actually test and see

00:19:10.720 --> 00:19:13.960 align:middle line:84%
whether this file has actually
been successfully uploaded

00:19:13.960 --> 00:19:17.830 align:middle line:84%
to the target by saying
[? Curl, ?] pasting that,

00:19:17.830 --> 00:19:19.420 align:middle line:90%
and then hitting Enter.

00:19:19.420 --> 00:19:24.340 align:middle line:84%
And as you can see, it displays
the content of the file here.

00:19:24.340 --> 00:19:28.780 align:middle line:84%
Just disregard the actual
syntax formatting here.

00:19:28.780 --> 00:19:30.920 align:middle line:84%
You can see it
says MSF Test File.

00:19:30.920 --> 00:19:33.040 align:middle line:84%
So let's try and change
this up a little bit just

00:19:33.040 --> 00:19:35.060 align:middle line:84%
to confirm that
this is the case.

00:19:35.060 --> 00:19:39.560 align:middle line:84%
So I'll just clear that out and
if we show the options here.

00:19:39.560 --> 00:19:41.780 align:middle line:84%
What we'll do is we'll
change the file data.

00:19:41.780 --> 00:19:45.590 align:middle line:84%
So I'm going to say Set
File Data right over here.

00:19:45.590 --> 00:19:49.790 align:middle line:84%
And we'll put it within
two quotation marks.

00:19:49.790 --> 00:19:53.640 align:middle line:90%
And we'll say, "this does work."

00:19:53.640 --> 00:19:55.880 align:middle line:90%
And we'll then hit Enter.

00:19:55.880 --> 00:19:59.610 align:middle line:84%
And we then want to set the
file name to something else.

00:19:59.610 --> 00:20:06.370 align:middle line:84%
So I'm going to say Set File
Name to maybe something like

00:20:06.370 --> 00:20:09.340 align:middle line:90%
this_works.txt.

00:20:09.340 --> 00:20:11.750 align:middle line:90%
Hit Enter, and lets hit run.

00:20:11.750 --> 00:20:13.930 align:middle line:84%
And as you can see,
it says File Uploaded.

00:20:13.930 --> 00:20:17.230 align:middle line:84%
And we can test and see whether
that actually works by again,

00:20:17.230 --> 00:20:20.460 align:middle line:84%
utilizing [? Curl ?] and
then pasting in that there.

00:20:20.460 --> 00:20:22.640 align:middle line:84%
And as you can see, it
says "this does work."

00:20:22.640 --> 00:20:25.750 align:middle line:84%
So we now have been able
to identify a vulnerability

00:20:25.750 --> 00:20:29.170 align:middle line:84%
by of course, performing
a vulnerability scan

00:20:29.170 --> 00:20:31.360 align:middle line:90%
with the WMAP plugin.

00:20:31.360 --> 00:20:34.390 align:middle line:84%
And in this case, we've been
able to successfully again,

00:20:34.390 --> 00:20:36.430 align:middle line:84%
test a vulnerability
or rather exploit

00:20:36.430 --> 00:20:38.920 align:middle line:84%
it to ensure that we
actually have a vulnerability

00:20:38.920 --> 00:20:40.340 align:middle line:90%
that we can work with.

00:20:40.340 --> 00:20:42.640 align:middle line:84%
And as I said, this
particular vulnerability

00:20:42.640 --> 00:20:46.210 align:middle line:84%
can be extremely harmful because
an attacker can essentially

00:20:46.210 --> 00:20:48.010 align:middle line:90%
upload any malicious file.

00:20:48.010 --> 00:20:50.830 align:middle line:84%
And that file could consequently
provide them with access.

00:20:50.830 --> 00:20:53.890 align:middle line:84%
Now in our case, we don't have
a browser so I actually cannot

00:20:53.890 --> 00:20:55.210 align:middle line:90%
showcase this.

00:20:55.210 --> 00:20:58.360 align:middle line:84%
But it would work fairly similar
in that I would essentially

00:20:58.360 --> 00:21:02.180 align:middle line:84%
just upload a PHP
Meterpreter module here.

00:21:02.180 --> 00:21:04.300 align:middle line:84%
And once that is
uploaded, I simply

00:21:04.300 --> 00:21:08.740 align:middle line:84%
need to navigate to the URL
right over here on my browser.

00:21:08.740 --> 00:21:11.830 align:middle line:84%
And once that is executed,
or rather the PHP module

00:21:11.830 --> 00:21:16.180 align:middle line:84%
is executed, what will happen
is I will get a reverse shell.

00:21:16.180 --> 00:21:19.630 align:middle line:84%
So you can utilize
WMAP to identify

00:21:19.630 --> 00:21:22.690 align:middle line:84%
all sorts of vulnerabilities
within a web application.

00:21:22.690 --> 00:21:26.830 align:middle line:84%
And again, when we're talking
about specific web applications

00:21:26.830 --> 00:21:30.220 align:middle line:84%
or third party solutions like
content management systems,

00:21:30.220 --> 00:21:32.860 align:middle line:84%
we'll be exploring how to
identify vulnerabilities

00:21:32.860 --> 00:21:36.310 align:middle line:84%
within those web applications
and how they can be exploited

00:21:36.310 --> 00:21:37.960 align:middle line:90%
during the exploitation phase.

00:21:37.960 --> 00:21:40.150 align:middle line:84%
For now, all I wanted
to really cover

00:21:40.150 --> 00:21:42.940 align:middle line:84%
was the process of
utilizing WMAP because it

00:21:42.940 --> 00:21:44.480 align:middle line:90%
can be very, very helpful.

00:21:44.480 --> 00:21:47.470 align:middle line:84%
And in our case, we only were
able to find one vulnerability

00:21:47.470 --> 00:21:51.040 align:middle line:84%
because this particular target
web server has really just

00:21:51.040 --> 00:21:53.990 align:middle line:84%
been configured to highlight
a few of these techniques.

00:21:53.990 --> 00:21:58.670 align:middle line:84%
So that is going to conclude
the practical demonstration.

00:21:58.670 --> 00:22:01.720 align:middle line:84%
All right, so that concludes
the vulnerability scanning

00:22:01.720 --> 00:22:03.130 align:middle line:90%
section of this course.

00:22:03.130 --> 00:22:05.800 align:middle line:84%
In the next section,
we'll begin exploring

00:22:05.800 --> 00:22:06.940 align:middle line:90%
[? BlindSide ?] attacks.

00:22:06.940 --> 00:22:09.130 align:middle line:84%
And furthermore,
we'll be taking a look

00:22:09.130 --> 00:22:12.760 align:middle line:84%
at how to generate and
encode Windows and Linux

00:22:12.760 --> 00:22:15.130 align:middle line:84%
payloads with
MSFvenom, as well as

00:22:15.130 --> 00:22:19.090 align:middle line:84%
exploring how we can inject
payloads into Windows

00:22:19.090 --> 00:22:20.650 align:middle line:90%
portable executables.

00:22:20.650 --> 00:22:23.250 align:middle line:90%
So I'll see you there.