WEBVTT

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


00:00:04.850 --> 00:00:07.760 align:middle line:90%
[MUSIC PLAYING]

00:00:07.760 --> 00:00:10.200 align:middle line:90%


00:00:10.200 --> 00:00:13.200 align:middle line:84%
Exploiting WebDAV
with Metasploit.

00:00:13.200 --> 00:00:15.720 align:middle line:84%
In the previous video,
we explored the process

00:00:15.720 --> 00:00:18.960 align:middle line:84%
of how we can authenticate
to a WebDAV server,

00:00:18.960 --> 00:00:22.230 align:middle line:84%
and upload a web shell
in order to perform,

00:00:22.230 --> 00:00:25.530 align:middle line:84%
or in order to execute system
commands on the target,

00:00:25.530 --> 00:00:28.080 align:middle line:84%
and of course, that
process was multifaceted.

00:00:28.080 --> 00:00:30.780 align:middle line:84%
It involved performing
a brute force in order

00:00:30.780 --> 00:00:34.770 align:middle line:84%
to identify the WebDAV
credentials, after which we can

00:00:34.770 --> 00:00:37.230 align:middle line:84%
utilize, or we utilize
those credentials

00:00:37.230 --> 00:00:39.540 align:middle line:84%
to authenticate to
the WebDAV server

00:00:39.540 --> 00:00:44.910 align:middle line:84%
and utilize Cadaver to upload
the web shell onto the dev test

00:00:44.910 --> 00:00:45.420 align:middle line:90%
server.

00:00:45.420 --> 00:00:45.920 align:middle line:90%
Right?

00:00:45.920 --> 00:00:51.570 align:middle line:84%
Now we can also utilize the
Metasploit framework in order

00:00:51.570 --> 00:00:53.910 align:middle line:84%
to exploit WebDAV,
and of course, that

00:00:53.910 --> 00:00:56.100 align:middle line:84%
can be done through
a plethora of ways,

00:00:56.100 --> 00:00:58.530 align:middle line:84%
and we'll be exploring two
techniques that can be used

00:00:58.530 --> 00:01:00.850 align:middle line:90%
to essentially achieve this.

00:01:00.850 --> 00:01:04.560 align:middle line:84%
Now we don't really have any
other slides to go through.

00:01:04.560 --> 00:01:07.470 align:middle line:84%
As I said, we're going to be
utilizing a very similar lab

00:01:07.470 --> 00:01:11.460 align:middle line:84%
environment to the previous
video, with a few small changes

00:01:11.460 --> 00:01:13.600 align:middle line:84%
and you'll actually
see them in play.

00:01:13.600 --> 00:01:14.100 align:middle line:90%
All right.

00:01:14.100 --> 00:01:17.250 align:middle line:84%
So start up the lab
environment, and I'll also

00:01:17.250 --> 00:01:20.970 align:middle line:84%
get my instance
started up, and we

00:01:20.970 --> 00:01:23.410 align:middle line:84%
can get started with the
practical demonstration.

00:01:23.410 --> 00:01:28.680 align:middle line:84%
So I'll see you back
in the lab environment.

00:01:28.680 --> 00:01:29.180 align:middle line:90%
All right.

00:01:29.180 --> 00:01:31.220 align:middle line:84%
So I'm back within
the lab environment

00:01:31.220 --> 00:01:33.888 align:middle line:84%
and you will be provided
with the target IP

00:01:33.888 --> 00:01:35.430 align:middle line:84%
address, and of
course, in your case,

00:01:35.430 --> 00:01:36.555 align:middle line:90%
it's going to be different.

00:01:36.555 --> 00:01:37.130 align:middle line:90%
Right?

00:01:37.130 --> 00:01:38.690 align:middle line:84%
Now as I said, this
lab environment

00:01:38.690 --> 00:01:41.000 align:middle line:84%
is very similar to
the previous video,

00:01:41.000 --> 00:01:44.330 align:middle line:84%
and we have a
Windows target that's

00:01:44.330 --> 00:01:48.140 align:middle line:84%
running Microsoft IS that
has WebDAV configured to run,

00:01:48.140 --> 00:01:51.570 align:middle line:84%
and the WebDAV credentials
are also the same.

00:01:51.570 --> 00:01:57.290 align:middle line:84%
So the username is Bob, and the
password is password_123321.

00:01:57.290 --> 00:01:59.900 align:middle line:84%
The only difference with this
particular lab environment

00:01:59.900 --> 00:02:03.170 align:middle line:84%
is that the target, more
specifically, the WebDAV server

00:02:03.170 --> 00:02:08.750 align:middle line:84%
has been configured to execute
specific types of ASP payloads,

00:02:08.750 --> 00:02:10.280 align:middle line:90%
or ASP files.

00:02:10.280 --> 00:02:14.030 align:middle line:84%
In the previous video, we
were able to execute ASP files

00:02:14.030 --> 00:02:15.590 align:middle line:90%
or ASP payloads.

00:02:15.590 --> 00:02:17.390 align:middle line:84%
The only difference
was if we try

00:02:17.390 --> 00:02:21.140 align:middle line:84%
to utilize an ASP payload
that would provide us

00:02:21.140 --> 00:02:24.410 align:middle line:84%
with a meterpreter session,
that particular web

00:02:24.410 --> 00:02:27.380 align:middle line:84%
server or Microsoft
IS server would not--

00:02:27.380 --> 00:02:31.550 align:middle line:84%
will essentially would not be
able to essentially execute

00:02:31.550 --> 00:02:35.160 align:middle line:84%
that particular file primarily
because of its functionality,

00:02:35.160 --> 00:02:35.660 align:middle line:90%
right?

00:02:35.660 --> 00:02:37.998 align:middle line:84%
In this case, we
are able to do that

00:02:37.998 --> 00:02:40.040 align:middle line:84%
and of course, we'll go
through the same process.

00:02:40.040 --> 00:02:43.250 align:middle line:84%
We can start off by performing
an Nmap scan on the target,

00:02:43.250 --> 00:02:47.000 align:middle line:84%
just to confirm you know
that IS is indeed running,

00:02:47.000 --> 00:02:48.860 align:middle line:90%
and WebDAV is configured to run.

00:02:48.860 --> 00:02:52.160 align:middle line:84%
So we will say Nmap,
and we can say SV,

00:02:52.160 --> 00:02:54.540 align:middle line:90%
and we can run this on port 80.

00:02:54.540 --> 00:02:55.040 align:middle line:90%
Right?

00:02:55.040 --> 00:02:58.220 align:middle line:84%
And we can also use
the script, HTTP enum.

00:02:58.220 --> 00:03:03.290 align:middle line:84%
So HTTP enum, and I'll paste
in the target IP there.

00:03:03.290 --> 00:03:06.710 align:middle line:84%
And we'll give this a couple
of seconds to complete.

00:03:06.710 --> 00:03:07.210 align:middle line:90%
All right.

00:03:07.210 --> 00:03:08.990 align:middle line:90%
The Nmap scan is complete.

00:03:08.990 --> 00:03:11.560 align:middle line:84%
And as you can see, we
have WebDAV running,

00:03:11.560 --> 00:03:16.150 align:middle line:84%
and it actually requires
credentials or authentication.

00:03:16.150 --> 00:03:20.390 align:middle line:84%
So if I open up my
Firefox browser here

00:03:20.390 --> 00:03:24.010 align:middle line:84%
and I paste in the target IP,
and try and access the WebDAV

00:03:24.010 --> 00:03:26.650 align:middle line:84%
directory, you will see
that the credentials are

00:03:26.650 --> 00:03:30.490 align:middle line:84%
pretty much the same as we had
in the previous environment,

00:03:30.490 --> 00:03:32.510 align:middle line:84%
or in the previous
lab environment.

00:03:32.510 --> 00:03:38.680 align:middle line:84%
So I can say Bob,
password_123321 hit Enter.

00:03:38.680 --> 00:03:40.940 align:middle line:84%
And we're successfully
been able to authenticate.

00:03:40.940 --> 00:03:41.440 align:middle line:90%
Right?

00:03:41.440 --> 00:03:45.910 align:middle line:84%
So let's get started with how
we can obtain a meterpreter

00:03:45.910 --> 00:03:50.260 align:middle line:84%
session, or really, a reverse
shell on the target system

00:03:50.260 --> 00:03:51.610 align:middle line:90%
with Metasploit.

00:03:51.610 --> 00:03:55.780 align:middle line:84%
The first technique will involve
generating the ASP payload

00:03:55.780 --> 00:03:58.180 align:middle line:90%
ourselves, with MSFvenom.

00:03:58.180 --> 00:04:00.550 align:middle line:84%
Now if you want to learn
more about Metasploit,

00:04:00.550 --> 00:04:03.400 align:middle line:84%
or the Metasploit framework,
you can check out my Metasploit

00:04:03.400 --> 00:04:05.140 align:middle line:90%
framework course on INE.

00:04:05.140 --> 00:04:07.450 align:middle line:84%
It's an extremely
comprehensive course

00:04:07.450 --> 00:04:11.060 align:middle line:84%
that will make you proficient at
using the Metasploit framework.

00:04:11.060 --> 00:04:15.010 align:middle line:84%
So again, in this case, I'll
also explain as I move along.

00:04:15.010 --> 00:04:19.000 align:middle line:84%
All right so MSFvenom is
a tool, Metasploit tool

00:04:19.000 --> 00:04:22.810 align:middle line:84%
that allows you to generate a
payload that will essentially

00:04:22.810 --> 00:04:26.440 align:middle line:84%
provide you with reverse
shell access or remote access

00:04:26.440 --> 00:04:27.890 align:middle line:90%
to a target system.

00:04:27.890 --> 00:04:30.980 align:middle line:84%
And in this case, we're going
to obtain a meterpreter session,

00:04:30.980 --> 00:04:34.000 align:middle line:84%
which is really just an
advanced reverse shell that

00:04:34.000 --> 00:04:38.110 align:middle line:84%
allows us to perform additional
functionality like upload

00:04:38.110 --> 00:04:41.980 align:middle line:84%
files, download files from the
target, et cetera, et cetera.

00:04:41.980 --> 00:04:44.800 align:middle line:84%
So in order to generate
the ASP payload,

00:04:44.800 --> 00:04:49.390 align:middle line:84%
we're going to say MSFvenom,
and we can then say Payload.

00:04:49.390 --> 00:04:52.700 align:middle line:84%
We will then be using a
Windows meterpreter payload,

00:04:52.700 --> 00:04:54.430 align:middle line:90%
and this is a staged payload.

00:04:54.430 --> 00:04:57.490 align:middle line:84%
So we'll say
meterpreter Reverse TCP.

00:04:57.490 --> 00:04:59.980 align:middle line:84%
We then need to
provide our IP address,

00:04:59.980 --> 00:05:02.570 align:middle line:84%
and this is the [INAUDIBLE]
next IP address.

00:05:02.570 --> 00:05:05.120 align:middle line:84%
So I'm just going to
open up a new tab here.

00:05:05.120 --> 00:05:07.330 align:middle line:84%
And I'm going to
type in ifconfig,

00:05:07.330 --> 00:05:11.710 align:middle line:84%
and my IP address is on
the interface ethernet 1.

00:05:11.710 --> 00:05:14.433 align:middle line:84%
There's my IP there,
and that is what

00:05:14.433 --> 00:05:15.850 align:middle line:84%
I'm going to set
here because this

00:05:15.850 --> 00:05:18.460 align:middle line:84%
is the IP that the payload
is going to connect

00:05:18.460 --> 00:05:20.290 align:middle line:90%
to when it's executed, right?

00:05:20.290 --> 00:05:23.230 align:middle line:84%
The L Port is the port that
this particular payload

00:05:23.230 --> 00:05:25.420 align:middle line:90%
is going to connect to.

00:05:25.420 --> 00:05:28.850 align:middle line:84%
So this has to be a port that's
currently open on your system.

00:05:28.850 --> 00:05:31.180 align:middle line:84%
In this case, I'll
just use port 1234

00:05:31.180 --> 00:05:33.050 align:middle line:90%
for the sake of simplicity.

00:05:33.050 --> 00:05:36.370 align:middle line:84%
We then need to specify the
file format, which in this case

00:05:36.370 --> 00:05:39.370 align:middle line:84%
is going to be ASP,
and we can output that

00:05:39.370 --> 00:05:42.530 align:middle line:84%
into the actual payload,
or the payload name.

00:05:42.530 --> 00:05:46.870 align:middle line:84%
And in this case, we will
call this meterpreter.asp

00:05:46.870 --> 00:05:51.750 align:middle line:84%
or we can simply just
call it shell.asp.

00:05:51.750 --> 00:05:55.510 align:middle line:84%
We'll give this a couple
of seconds to generate.

00:05:55.510 --> 00:05:56.010 align:middle line:90%
All right.

00:05:56.010 --> 00:05:57.990 align:middle line:84%
So that is generated
successfully.

00:05:57.990 --> 00:06:01.140 align:middle line:84%
It will select the
architecture as 32-bit.

00:06:01.140 --> 00:06:05.610 align:middle line:84%
It is always recommended to use
the 32-bit meterpreter payload

00:06:05.610 --> 00:06:07.830 align:middle line:84%
here, primarily because
if you're not familiar

00:06:07.830 --> 00:06:10.050 align:middle line:84%
or if you're not sure
what architecture

00:06:10.050 --> 00:06:13.620 align:middle line:84%
they operate the target
operating system is, 32-bit

00:06:13.620 --> 00:06:15.420 align:middle line:84%
will work either
way irregardless

00:06:15.420 --> 00:06:18.520 align:middle line:84%
of whether the system
is 32-bit or 64-bit.

00:06:18.520 --> 00:06:19.020 align:middle line:90%
All right?

00:06:19.020 --> 00:06:21.720 align:middle line:84%
So that is generated
and it's stored

00:06:21.720 --> 00:06:23.130 align:middle line:90%
within our home directory.

00:06:23.130 --> 00:06:25.320 align:middle line:90%
So there it is, shell.asp.

00:06:25.320 --> 00:06:28.500 align:middle line:84%
So we can now utilize
Cadaver, and I'm just going

00:06:28.500 --> 00:06:31.380 align:middle line:90%
to copy the IP address here.

00:06:31.380 --> 00:06:32.670 align:middle line:90%
That is the target IP.

00:06:32.670 --> 00:06:35.550 align:middle line:84%
So I'm going to say Cadaver,
as we did previously.

00:06:35.550 --> 00:06:39.560 align:middle line:84%
Cadaver, and we are
going to say HTTP--

00:06:39.560 --> 00:06:43.050 align:middle line:84%
specify the target IP and the
folder, which in this case

00:06:43.050 --> 00:06:46.860 align:middle line:84%
is WebDAV, hit Enter,
the username is Bob,

00:06:46.860 --> 00:06:51.430 align:middle line:84%
and the password
is password_123321.

00:06:51.430 --> 00:06:51.930 align:middle line:90%
All right.

00:06:51.930 --> 00:06:52.597 align:middle line:90%
So there we are.

00:06:52.597 --> 00:06:54.870 align:middle line:84%
We get the actual
DAV pseudo shell,

00:06:54.870 --> 00:06:56.670 align:middle line:84%
and we can list
out the files here.

00:06:56.670 --> 00:06:58.710 align:middle line:84%
And we have the
same files that we

00:06:58.710 --> 00:07:02.080 align:middle line:84%
had when we explored this
folder through our browser.

00:07:02.080 --> 00:07:05.280 align:middle line:84%
So we can upload the shell
that we created by saying Put,

00:07:05.280 --> 00:07:07.350 align:middle line:84%
and the directory
where it stored

00:07:07.350 --> 00:07:11.550 align:middle line:84%
is under root, and
shell.asp and we hit Enter.

00:07:11.550 --> 00:07:13.800 align:middle line:84%
All right, so that has
been uploaded successfully.

00:07:13.800 --> 00:07:15.270 align:middle line:84%
And of course, we
can confirm that

00:07:15.270 --> 00:07:19.050 align:middle line:84%
by refreshing the actual
directory listing of the WebDAV

00:07:19.050 --> 00:07:20.970 align:middle line:84%
directory through
our browser, and you

00:07:20.970 --> 00:07:22.930 align:middle line:90%
can see we have shell.asp.

00:07:22.930 --> 00:07:23.430 align:middle line:90%
Right.

00:07:23.430 --> 00:07:25.990 align:middle line:84%
So we the next step
would be to click on it,

00:07:25.990 --> 00:07:27.760 align:middle line:84%
and that will
essentially execute it.

00:07:27.760 --> 00:07:30.420 align:middle line:84%
But before we
actually execute it,

00:07:30.420 --> 00:07:33.630 align:middle line:84%
we need to set up a
listener or a handler that

00:07:33.630 --> 00:07:35.400 align:middle line:84%
will receive the
reverse connection

00:07:35.400 --> 00:07:39.000 align:middle line:84%
from the actual target
system, and then

00:07:39.000 --> 00:07:42.300 align:middle line:84%
send the stage that will then
provide us with an meterpreter

00:07:42.300 --> 00:07:43.830 align:middle line:90%
session when executed.

00:07:43.830 --> 00:07:46.980 align:middle line:84%
In order to do this, we will
need to start up a Metasploit

00:07:46.980 --> 00:07:50.140 align:middle line:84%
framework console session,
and in order to do this,

00:07:50.140 --> 00:07:52.410 align:middle line:84%
I'm just going to start
the PostgreSQL Database

00:07:52.410 --> 00:07:55.200 align:middle line:84%
Service because Metasploit, the
Metasploit framework console

00:07:55.200 --> 00:07:58.050 align:middle line:84%
requires the actual
Metasploit framework database

00:07:58.050 --> 00:07:58.800 align:middle line:90%
to be started.

00:07:58.800 --> 00:08:01.140 align:middle line:84%
So I'll say Service
PostgreSQL Start,

00:08:01.140 --> 00:08:03.250 align:middle line:90%
and I'll just say MSF console.

00:08:03.250 --> 00:08:03.750 align:middle line:90%
Right?

00:08:03.750 --> 00:08:06.300 align:middle line:90%
So MSF console, there we go.

00:08:06.300 --> 00:08:08.580 align:middle line:84%
We'll give this a couple
of seconds to start up.

00:08:08.580 --> 00:08:15.960 align:middle line:90%


00:08:15.960 --> 00:08:16.460 align:middle line:90%
All right.

00:08:16.460 --> 00:08:18.770 align:middle line:84%
So in order to set
up our handler,

00:08:18.770 --> 00:08:21.350 align:middle line:90%
we can say use multi handler.

00:08:21.350 --> 00:08:24.470 align:middle line:84%
This is a Metasploit
module that essentially

00:08:24.470 --> 00:08:29.660 align:middle line:84%
is used to set up a listener
for the malicious payload

00:08:29.660 --> 00:08:31.080 align:middle line:90%
that you have created.

00:08:31.080 --> 00:08:33.350 align:middle line:84%
In this case, we
utilized the payload

00:08:33.350 --> 00:08:36.860 align:middle line:84%
or the payload that we use to
generate our malicious ASP file

00:08:36.860 --> 00:08:38.870 align:middle line:90%
was--

00:08:38.870 --> 00:08:41.059 align:middle line:84%
so in order to set, it
will say set payload

00:08:41.059 --> 00:08:45.020 align:middle line:84%
and it was Windows
meterpreter reverse TCP.

00:08:45.020 --> 00:08:47.210 align:middle line:84%
And of course, this has
to be the same payload

00:08:47.210 --> 00:08:51.095 align:middle line:84%
that you had specified when
generating the actual ASP file.

00:08:51.095 --> 00:08:52.970 align:middle line:84%
So remember, when we
were generating it here,

00:08:52.970 --> 00:08:56.480 align:middle line:84%
with MSFvenom, makes sure
that the payload you specify

00:08:56.480 --> 00:08:59.600 align:middle line:84%
is the same one used to
generate the ASP file, right?

00:08:59.600 --> 00:09:02.360 align:middle line:84%
And then of course, we need
to set up the L host option as

00:09:02.360 --> 00:09:04.320 align:middle line:90%
well as the L port option.

00:09:04.320 --> 00:09:07.670 align:middle line:84%
So I'll just go back in
there and we'll hit Enter.

00:09:07.670 --> 00:09:10.010 align:middle line:84%
We can then show
the options here,

00:09:10.010 --> 00:09:12.710 align:middle line:84%
and the options we need to
specify is the L host option.

00:09:12.710 --> 00:09:14.880 align:middle line:84%
This is just going
to be our IP address.

00:09:14.880 --> 00:09:17.480 align:middle line:84%
So L host, paste that
in there, and then

00:09:17.480 --> 00:09:21.860 align:middle line:90%
we specify the L port as 1234.

00:09:21.860 --> 00:09:23.610 align:middle line:84%
Remember, they have
to be the same options

00:09:23.610 --> 00:09:26.790 align:middle line:84%
you used when you were
generating your malicious ASP

00:09:26.790 --> 00:09:29.130 align:middle line:90%
payload with MSFvenom.

00:09:29.130 --> 00:09:30.660 align:middle line:90%
And we can then hit Run.

00:09:30.660 --> 00:09:32.790 align:middle line:84%
That is going to start up
the listener, or rather

00:09:32.790 --> 00:09:34.800 align:middle line:84%
the reverse TCP
handler, and it's now

00:09:34.800 --> 00:09:39.510 align:middle line:84%
going to wait for a connection
from the actual ASP payload

00:09:39.510 --> 00:09:40.480 align:middle line:90%
that we generated.

00:09:40.480 --> 00:09:42.670 align:middle line:84%
So whenever it's
executed on the target,

00:09:42.670 --> 00:09:46.200 align:middle line:84%
it will connect back to this
particular reverse TCP handler.

00:09:46.200 --> 00:09:48.360 align:middle line:84%
So in order to
execute it, we can

00:09:48.360 --> 00:09:50.400 align:middle line:84%
head over into the
WebDAV directory,

00:09:50.400 --> 00:09:52.440 align:middle line:90%
and click on shell.asp.

00:09:52.440 --> 00:09:55.350 align:middle line:84%
You can see it's being
executed, and if we go back

00:09:55.350 --> 00:09:58.080 align:middle line:84%
to our terminal, you can see
it's going to say sending stage

00:09:58.080 --> 00:10:00.690 align:middle line:84%
and then tell us, meterpreter
session one opened,

00:10:00.690 --> 00:10:04.330 align:middle line:84%
and we have successfully gained
access to the target system.

00:10:04.330 --> 00:10:04.830 align:middle line:90%
All right?

00:10:04.830 --> 00:10:07.680 align:middle line:84%
So we can confirm this
by saying Sysinfo.

00:10:07.680 --> 00:10:11.820 align:middle line:84%
And you can see that the system
is a Windows 2016, or Windows

00:10:11.820 --> 00:10:14.040 align:middle line:90%
Server 2016 system.

00:10:14.040 --> 00:10:16.560 align:middle line:84%
It's a 64-bit system
and currently,

00:10:16.560 --> 00:10:18.270 align:middle line:84%
we have two logged
on users and we

00:10:18.270 --> 00:10:21.910 align:middle line:84%
can get our current privileges
by typing in get user ID.

00:10:21.910 --> 00:10:24.240 align:middle line:84%
And we currently have
elevated privileges,

00:10:24.240 --> 00:10:27.070 align:middle line:84%
as our privileges or
anti-authority system.

00:10:27.070 --> 00:10:29.260 align:middle line:84%
So in the case of this
particular system,

00:10:29.260 --> 00:10:31.230 align:middle line:84%
we do not need to
elevate our privileges.

00:10:31.230 --> 00:10:34.150 align:middle line:84%
But again, this is set
up for demonstration.

00:10:34.150 --> 00:10:34.650 align:middle line:90%
All right?

00:10:34.650 --> 00:10:38.140 align:middle line:84%
So this is one of the
techniques that you can utilize.

00:10:38.140 --> 00:10:40.440 align:middle line:84%
You can go through the
process of generating

00:10:40.440 --> 00:10:45.240 align:middle line:84%
your payload manually, and then
uploading it using Cadaver.

00:10:45.240 --> 00:10:47.830 align:middle line:84%
There is another technique
that you can utilize.

00:10:47.830 --> 00:10:51.060 align:middle line:84%
And again, this technique
will essentially

00:10:51.060 --> 00:10:55.590 align:middle line:84%
involve utilizing a
Metasploit framework module,

00:10:55.590 --> 00:10:57.330 align:middle line:84%
and this module
essentially allows

00:10:57.330 --> 00:10:59.770 align:middle line:84%
us to automate this
entire process.

00:10:59.770 --> 00:11:01.570 align:middle line:90%
So what I'll do is I'll exit.

00:11:01.570 --> 00:11:04.350 align:middle line:84%
And that will kill that
particular meterpreter session

00:11:04.350 --> 00:11:07.470 align:middle line:84%
and we can confirm that that
is the case by listing out

00:11:07.470 --> 00:11:08.400 align:middle line:90%
all sessions.

00:11:08.400 --> 00:11:13.020 align:middle line:84%
The name of the
module is IIS Upload,

00:11:13.020 --> 00:11:15.870 align:middle line:84%
and that will essentially
give us a list of payloads,

00:11:15.870 --> 00:11:17.910 align:middle line:84%
or modules for that
matter, the one we're

00:11:17.910 --> 00:11:22.890 align:middle line:84%
looking for is this one right
via exploit Windows IIS, IIS

00:11:22.890 --> 00:11:24.750 align:middle line:90%
WebDAV upload ASP.

00:11:24.750 --> 00:11:26.880 align:middle line:84%
So that is pretty
self-explanatory.

00:11:26.880 --> 00:11:31.140 align:middle line:84%
This essentially allows
us to upload a malicious

00:11:31.140 --> 00:11:35.420 align:middle line:90%
or a meterpreter ASP file.

00:11:35.420 --> 00:11:37.970 align:middle line:84%
That will provide us with
a meterpreter session

00:11:37.970 --> 00:11:41.180 align:middle line:84%
onto the WebDAV server
automatically, right?

00:11:41.180 --> 00:11:43.440 align:middle line:90%
And we can copy that here.

00:11:43.440 --> 00:11:46.950 align:middle line:84%
So I'll say copy,
and we'll say use.

00:11:46.950 --> 00:11:50.220 align:middle line:84%
And you now need to specify
your payload or the payload

00:11:50.220 --> 00:11:51.280 align:middle line:90%
that you want to use.

00:11:51.280 --> 00:11:52.680 align:middle line:84%
In this case, the
default payload

00:11:52.680 --> 00:11:55.140 align:middle line:84%
is Windows meterpreter
reverse TCP

00:11:55.140 --> 00:11:57.540 align:middle line:84%
because the target
system is 64-bit,

00:11:57.540 --> 00:12:00.300 align:middle line:84%
and we have been able to confirm
that, you can change this

00:12:00.300 --> 00:12:04.080 align:middle line:84%
to Windows x64
meterpreter reverse TCP.

00:12:04.080 --> 00:12:06.420 align:middle line:84%
But in this case, I'll
leave it as is, right?

00:12:06.420 --> 00:12:09.270 align:middle line:84%
So if we say show
options, you can

00:12:09.270 --> 00:12:12.690 align:middle line:84%
see that we need to specify
our IP address as L host.

00:12:12.690 --> 00:12:15.245 align:middle line:84%
You then need to specify
the L port option

00:12:15.245 --> 00:12:16.620 align:middle line:84%
and of course, in
this case, it's

00:12:16.620 --> 00:12:19.530 align:middle line:84%
generating a new ASP
file that it will then

00:12:19.530 --> 00:12:21.450 align:middle line:90%
be uploading onto the target.

00:12:21.450 --> 00:12:24.120 align:middle line:84%
And we have a few options
that we need to specify.

00:12:24.120 --> 00:12:28.290 align:middle line:84%
Because this is also going to
upload the ASP file for you,

00:12:28.290 --> 00:12:30.450 align:middle line:84%
you need to provide
the HTTP password

00:12:30.450 --> 00:12:32.830 align:middle line:84%
and username for
the WebDAV server.

00:12:32.830 --> 00:12:34.420 align:middle line:90%
So let's start off with that.

00:12:34.420 --> 00:12:39.180 align:middle line:84%
So I'm going to say set
HTTP username to Bob,

00:12:39.180 --> 00:12:48.390 align:middle line:84%
and we're going to set the HTTP
password to password_123321.

00:12:48.390 --> 00:12:50.620 align:middle line:84%
All right so those
options are set.

00:12:50.620 --> 00:12:55.380 align:middle line:84%
So if I say show options, the
next option that we need to set

00:12:55.380 --> 00:12:57.970 align:middle line:84%
is the target IP, which
is right over here.

00:12:57.970 --> 00:13:00.700 align:middle line:90%
That's the R host option.

00:13:00.700 --> 00:13:04.150 align:middle line:84%
So I'll copy the target
IP right over here

00:13:04.150 --> 00:13:09.780 align:middle line:84%
and I'll say set R
hosts to the target IP.

00:13:09.780 --> 00:13:12.320 align:middle line:84%
And you can then change
the R port option

00:13:12.320 --> 00:13:16.820 align:middle line:84%
to 443 if the actual WebDAV
server has an SSL certificate,

00:13:16.820 --> 00:13:19.760 align:middle line:84%
and you can then set
the SSL option to true.

00:13:19.760 --> 00:13:22.230 align:middle line:84%
In this case,
everything looks fine.

00:13:22.230 --> 00:13:26.120 align:middle line:84%
As I said, because we're
generating a new ASP payload,

00:13:26.120 --> 00:13:27.860 align:middle line:90%
you can specify a new port.

00:13:27.860 --> 00:13:32.420 align:middle line:84%
In this case, the default port
is port 4444 which is fine.

00:13:32.420 --> 00:13:34.590 align:middle line:84%
We then need to
specify the path.

00:13:34.590 --> 00:13:36.950 align:middle line:90%
This is the path to attempt--

00:13:36.950 --> 00:13:40.070 align:middle line:84%
that this module will attempt
to upload the actual ISP

00:13:40.070 --> 00:13:43.590 align:middle line:84%
file that it will generate,
and in order to set this,

00:13:43.590 --> 00:13:46.530 align:middle line:84%
we need to set up the-- we need
to set it to the following.

00:13:46.530 --> 00:13:49.310 align:middle line:84%
So we will say path,
and that is going

00:13:49.310 --> 00:13:50.900 align:middle line:84%
to be under the
WebDAV directory.

00:13:50.900 --> 00:13:53.730 align:middle line:84%
So WebDAV, and then we can
provide it with the name.

00:13:53.730 --> 00:13:56.520 align:middle line:84%
In this case, I'm just
going to say metasploit.asp.

00:13:56.520 --> 00:13:57.020 align:middle line:90%
All right?

00:13:57.020 --> 00:14:02.180 align:middle line:84%
We can then exploit, and that is
going to start the reverse TCP

00:14:02.180 --> 00:14:02.680 align:middle line:90%
handler.

00:14:02.680 --> 00:14:04.060 align:middle line:90%
It's going to check WebDAV.

00:14:04.060 --> 00:14:05.770 align:middle line:90%
It's then going to authenticate.

00:14:05.770 --> 00:14:08.950 align:middle line:84%
And once it authenticate
successfully,

00:14:08.950 --> 00:14:11.560 align:middle line:84%
it is then going to
upload the actual payload,

00:14:11.560 --> 00:14:13.870 align:middle line:84%
the ASP payload,
and it will then

00:14:13.870 --> 00:14:16.060 align:middle line:90%
rename it into an ASP file.

00:14:16.060 --> 00:14:18.520 align:middle line:84%
It'll then execute
the ASP payload,

00:14:18.520 --> 00:14:23.110 align:middle line:84%
and it'll also delete the
metasploit.asp payload for you

00:14:23.110 --> 00:14:24.530 align:middle line:90%
in order to avoid detection.

00:14:24.530 --> 00:14:25.030 align:middle line:90%
Right?

00:14:25.030 --> 00:14:26.770 align:middle line:84%
So you can see it
sends the stage,

00:14:26.770 --> 00:14:29.330 align:middle line:84%
and then it opens meterpreter
session right over there.

00:14:29.330 --> 00:14:33.350 align:middle line:84%
So sysinfo, and we pretty
much get the same information.

00:14:33.350 --> 00:14:36.530 align:middle line:84%
And if we type in get uid,
anti-authority system,

00:14:36.530 --> 00:14:39.160 align:middle line:84%
so as you can see this
particular Metasploit

00:14:39.160 --> 00:14:42.290 align:middle line:84%
payload automated all that
we had done previously.

00:14:42.290 --> 00:14:44.020 align:middle line:84%
And again, the
reason why I covered

00:14:44.020 --> 00:14:45.790 align:middle line:84%
the manual techniques
is because it's

00:14:45.790 --> 00:14:48.460 align:middle line:84%
very important to
know how to do it

00:14:48.460 --> 00:14:51.700 align:middle line:84%
without the help of
a Metasploit payload.

00:14:51.700 --> 00:14:55.030 align:middle line:84%
And doing it manually also
helps you understand what

00:14:55.030 --> 00:14:56.410 align:middle line:90%
is going on in the background.

00:14:56.410 --> 00:14:56.920 align:middle line:90%
Right?

00:14:56.920 --> 00:15:00.130 align:middle line:84%
So you can utilize the
Metasploit payload in the event

00:15:00.130 --> 00:15:02.870 align:middle line:84%
that you want to essentially
automate this process.

00:15:02.870 --> 00:15:06.050 align:middle line:84%
So if we take a look at
the WebDAV directory here,

00:15:06.050 --> 00:15:09.160 align:middle line:84%
I'll head into
WebDAV, and you can

00:15:09.160 --> 00:15:13.430 align:middle line:84%
see that it actually deleted the
ASP payload that it generated.

00:15:13.430 --> 00:15:16.310 align:middle line:84%
So this module is very,
very helpful in that way.

00:15:16.310 --> 00:15:19.270 align:middle line:84%
Now, of course, you can also
delete it using the cadaver

00:15:19.270 --> 00:15:22.120 align:middle line:84%
utility, or we can
delete the shell.asp

00:15:22.120 --> 00:15:24.860 align:middle line:84%
file that we had uploaded
manually very, very easily.

00:15:24.860 --> 00:15:29.770 align:middle line:84%
So if we list out the Help
menu here, you can see,

00:15:29.770 --> 00:15:31.820 align:middle line:84%
we can look for
the Delete command.

00:15:31.820 --> 00:15:35.960 align:middle line:84%
So I can say Delete
and shell.asp,

00:15:35.960 --> 00:15:37.960 align:middle line:84%
now that's going to delete
it, and of course, we

00:15:37.960 --> 00:15:39.700 align:middle line:90%
can list out the contents now.

00:15:39.700 --> 00:15:41.600 align:middle line:84%
And that has deleted
it successfully.

00:15:41.600 --> 00:15:44.110 align:middle line:84%
So that is always something
that is recommended.

00:15:44.110 --> 00:15:46.240 align:middle line:84%
Once you've gained access
to the target system,

00:15:46.240 --> 00:15:48.970 align:middle line:84%
delete any of the
payloads or exploit files

00:15:48.970 --> 00:15:51.160 align:middle line:84%
that you uploaded
onto the target

00:15:51.160 --> 00:15:54.220 align:middle line:84%
because again, that is something
that can easily be detected.

00:15:54.220 --> 00:15:57.350 align:middle line:84%
So you want to be as
clandestine as possible.

00:15:57.350 --> 00:15:57.850 align:middle line:90%
All right?

00:15:57.850 --> 00:16:00.550 align:middle line:84%
So that is going to conclude
the practical demonstration

00:16:00.550 --> 00:16:03.300 align:middle line:90%
side of this video.

00:16:03.300 --> 00:16:05.360 align:middle line:84%
All right so now
that we've explored

00:16:05.360 --> 00:16:10.250 align:middle line:84%
the process of exploiting WebDAV
running on Microsoft IaaS,

00:16:10.250 --> 00:16:13.790 align:middle line:84%
we can now move on to
exploiting SMB on Windows.

00:16:13.790 --> 00:16:15.650 align:middle line:84%
So in the next video,
we'll get started

00:16:15.650 --> 00:16:18.530 align:middle line:84%
by taking a look at how
to perform a brute force

00:16:18.530 --> 00:16:22.970 align:middle line:84%
attack on SMB, and how to
utilize the credentials to gain

00:16:22.970 --> 00:16:26.420 align:middle line:84%
access to the target system
through the use of the PS Exec

00:16:26.420 --> 00:16:27.330 align:middle line:90%
utility.

00:16:27.330 --> 00:16:30.040 align:middle line:90%
So I'll see you there.