WEBVTT

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


00:00:04.830 --> 00:00:07.728 align:middle line:90%
[MUSIC PLAYING]

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


00:00:10.150 --> 00:00:12.220 align:middle line:90%
MSFconsole Fundamentals.

00:00:12.220 --> 00:00:15.220 align:middle line:84%
Now that we've taken a look at
how to install and configure

00:00:15.220 --> 00:00:17.080 align:middle line:84%
the Metasploit Framework,
we can actually

00:00:17.080 --> 00:00:20.710 align:middle line:84%
begin exploring the process
of utilizing or understanding

00:00:20.710 --> 00:00:24.033 align:middle line:84%
how to utilize the
Metasploit Framework console.

00:00:24.033 --> 00:00:25.450 align:middle line:84%
Now, the reason
we need to do this

00:00:25.450 --> 00:00:27.790 align:middle line:84%
is because the
MSFconsole is going

00:00:27.790 --> 00:00:30.070 align:middle line:84%
to be our primary
interface of choice

00:00:30.070 --> 00:00:32.380 align:middle line:84%
when it comes down to
interacting with the Metasploit

00:00:32.380 --> 00:00:35.200 align:middle line:84%
Framework, and it is
the de facto choice

00:00:35.200 --> 00:00:37.100 align:middle line:84%
for many penetration
testers out there.

00:00:37.100 --> 00:00:40.840 align:middle line:84%
So having a good understanding
of how the Metasploit Framework

00:00:40.840 --> 00:00:42.340 align:middle line:84%
works and the
various commands that

00:00:42.340 --> 00:00:44.950 align:middle line:84%
can be utilized to
essentially search

00:00:44.950 --> 00:00:48.310 align:middle line:84%
for modules, use modules,
set module options,

00:00:48.310 --> 00:00:50.530 align:middle line:84%
et cetera is very,
very important

00:00:50.530 --> 00:00:54.130 align:middle line:84%
if you want to be competent
at utilizing the Metasploit

00:00:54.130 --> 00:00:56.380 align:middle line:84%
Framework for
penetration testing.

00:00:56.380 --> 00:00:58.960 align:middle line:84%
Now, I've already explained
what the Metasploit Framework

00:00:58.960 --> 00:01:01.420 align:middle line:84%
console is, but I
can go over it again.

00:01:01.420 --> 00:01:03.040 align:middle line:84%
The Metasploit
Framework console--

00:01:03.040 --> 00:01:06.460 align:middle line:84%
or also known as MSFconsole,
and I'll be frequently referring

00:01:06.460 --> 00:01:08.200 align:middle line:90%
to it as MSFconsole--

00:01:08.200 --> 00:01:10.600 align:middle line:84%
is an easy-to-use,
all-in-one interface

00:01:10.600 --> 00:01:13.630 align:middle line:84%
that provides you with access
to all of the functionality

00:01:13.630 --> 00:01:15.250 align:middle line:90%
of the Metasploit Framework.

00:01:15.250 --> 00:01:17.560 align:middle line:84%
So this is going to
be our command center.

00:01:17.560 --> 00:01:20.140 align:middle line:84%
Everything pertinent
to penetration testing

00:01:20.140 --> 00:01:22.690 align:middle line:84%
can be done through the
Metasploit Framework console.

00:01:22.690 --> 00:01:25.690 align:middle line:84%
So we can search for
modules, we can load modules,

00:01:25.690 --> 00:01:27.910 align:middle line:90%
we can configure module options.

00:01:27.910 --> 00:01:30.040 align:middle line:84%
We can then execute
modules directly

00:01:30.040 --> 00:01:31.810 align:middle line:84%
from the Metasploit
Framework console.

00:01:31.810 --> 00:01:33.800 align:middle line:84%
So it's really,
really important.

00:01:33.800 --> 00:01:36.760 align:middle line:84%
Now, when it comes
down to what exactly

00:01:36.760 --> 00:01:39.070 align:middle line:84%
we need to know to be
comfortable with the Metasploit

00:01:39.070 --> 00:01:41.560 align:middle line:84%
Framework console,
this is a list

00:01:41.560 --> 00:01:44.290 align:middle line:84%
of all of, really, the most
important things that you

00:01:44.290 --> 00:01:47.150 align:middle line:84%
should be able to do,
especially after this video.

00:01:47.150 --> 00:01:50.470 align:middle line:84%
So the first thing you need to
be able to, search for modules.

00:01:50.470 --> 00:01:53.770 align:middle line:84%
You need to know how to select
modules or how to load modules.

00:01:53.770 --> 00:01:56.320 align:middle line:84%
You also need to know how
to configure module options

00:01:56.320 --> 00:01:59.558 align:middle line:84%
and variables, and we'll get
into that in a few seconds.

00:01:59.558 --> 00:02:01.600 align:middle line:84%
You also need to know how
to search for payloads.

00:02:01.600 --> 00:02:04.960 align:middle line:84%
Because, as we've already
explored previously, payloads

00:02:04.960 --> 00:02:08.110 align:middle line:84%
are a vital part or element
of the exploitation process

00:02:08.110 --> 00:02:10.180 align:middle line:84%
and are typically
paired with exploits.

00:02:10.180 --> 00:02:13.450 align:middle line:84%
So knowing how to choose
the correct type of payload

00:02:13.450 --> 00:02:16.270 align:middle line:84%
based on the target operating
system and infrastructure

00:02:16.270 --> 00:02:17.960 align:middle line:90%
is very, very important.

00:02:17.960 --> 00:02:20.980 align:middle line:84%
We'll also be exploring the
process of managing sessions,

00:02:20.980 --> 00:02:22.750 align:middle line:90%
and I'll explore that.

00:02:22.750 --> 00:02:25.750 align:middle line:84%
But we will really be
touching upon sessions

00:02:25.750 --> 00:02:28.750 align:middle line:84%
when we move on
into exploitation

00:02:28.750 --> 00:02:30.790 align:middle line:90%
and post-exploitation.

00:02:30.790 --> 00:02:33.550 align:middle line:84%
We're also going to explore
additional functionality that

00:02:33.550 --> 00:02:35.590 align:middle line:84%
is afforded to us by
the Metasploit Framework

00:02:35.590 --> 00:02:37.490 align:middle line:90%
console that's really helpful.

00:02:37.490 --> 00:02:40.180 align:middle line:84%
And finally, we need to know
how to save our configuration.

00:02:40.180 --> 00:02:43.240 align:middle line:84%
Because all of these
options, or rather,

00:02:43.240 --> 00:02:46.690 align:middle line:84%
the various Metasploit
Framework console variables

00:02:46.690 --> 00:02:48.940 align:middle line:84%
that we can configure
or that we can change

00:02:48.940 --> 00:02:52.240 align:middle line:84%
can be saved into a
configuration file that

00:02:52.240 --> 00:02:54.910 align:middle line:84%
is loaded whenever we start
up the Metasploit Framework

00:02:54.910 --> 00:02:55.570 align:middle line:90%
console.

00:02:55.570 --> 00:02:57.700 align:middle line:84%
And this is useful
so that you don't

00:02:57.700 --> 00:03:00.700 align:middle line:84%
have to keep on
setting these options

00:03:00.700 --> 00:03:04.270 align:middle line:84%
whenever you restart the
Metasploit Framework console.

00:03:04.270 --> 00:03:06.550 align:middle line:84%
So now that we have
an idea of what

00:03:06.550 --> 00:03:10.450 align:middle line:84%
we need to know in order to be
comfortable with MSFconsole,

00:03:10.450 --> 00:03:13.600 align:middle line:84%
let's take a look at
MSF module variables,

00:03:13.600 --> 00:03:16.060 align:middle line:84%
or the Metasploit
Framework module variables.

00:03:16.060 --> 00:03:20.020 align:middle line:84%
Now, when we talk about the
Metasploit Framework modules,

00:03:20.020 --> 00:03:24.040 align:middle line:84%
it's very, very common to
find that various modules,

00:03:24.040 --> 00:03:27.280 align:middle line:84%
like exploit modules and
post-exploitation modules,

00:03:27.280 --> 00:03:31.570 align:middle line:84%
will require information like
the target IP address and port

00:03:31.570 --> 00:03:35.590 align:middle line:84%
in order to initiate a remote
exploit or a remote connection.

00:03:35.590 --> 00:03:36.700 align:middle line:90%
And this makes sense.

00:03:36.700 --> 00:03:40.270 align:middle line:84%
Because, for example, if
I'm using a Windows exploit

00:03:40.270 --> 00:03:42.820 align:middle line:84%
module that is targeting
a version of Windows

00:03:42.820 --> 00:03:45.100 align:middle line:84%
and is exploiting a
vulnerability on a target

00:03:45.100 --> 00:03:45.790 align:middle line:90%
system--

00:03:45.790 --> 00:03:48.700 align:middle line:84%
let's say the service
we're targeting is SMB--

00:03:48.700 --> 00:03:52.750 align:middle line:84%
we require the target
IP address and port

00:03:52.750 --> 00:03:55.510 align:middle line:84%
to be configured in order
for this exploit module

00:03:55.510 --> 00:03:56.740 align:middle line:90%
to run successfully.

00:03:56.740 --> 00:03:58.960 align:middle line:84%
And this is where the
Metasploit Framework module

00:03:58.960 --> 00:04:00.520 align:middle line:90%
variables come into play.

00:04:00.520 --> 00:04:03.670 align:middle line:84%
They allow us to set the
target IP address as well

00:04:03.670 --> 00:04:07.540 align:middle line:84%
as the target port, which in
this case would be port 445.

00:04:07.540 --> 00:04:09.610 align:middle line:84%
So, again, all of
these options can

00:04:09.610 --> 00:04:13.180 align:middle line:84%
be configured through the use of
Metasploit Framework variables.

00:04:13.180 --> 00:04:15.220 align:middle line:84%
And we'll take a look at
some of these variables

00:04:15.220 --> 00:04:16.399 align:middle line:90%
in a few seconds.

00:04:16.399 --> 00:04:19.120 align:middle line:84%
And we will also explore
them practically.

00:04:19.120 --> 00:04:22.390 align:middle line:84%
Now, it's also important to note
that the Metasploit Framework

00:04:22.390 --> 00:04:25.990 align:middle line:84%
console allows you to set
both local variable values

00:04:25.990 --> 00:04:27.670 align:middle line:90%
and global variable values.

00:04:27.670 --> 00:04:31.460 align:middle line:84%
And again, this will really
not make much sense right now.

00:04:31.460 --> 00:04:33.370 align:middle line:84%
But once we move
on to the terminal,

00:04:33.370 --> 00:04:36.730 align:middle line:84%
it will make a
whole lot more sense

00:04:36.730 --> 00:04:41.320 align:middle line:84%
when we start loading modules
or start executing or running

00:04:41.320 --> 00:04:42.920 align:middle line:90%
various exploit modules.

00:04:42.920 --> 00:04:46.250 align:middle line:84%
So let's take a look at
some of these variables

00:04:46.250 --> 00:04:49.750 align:middle line:84%
and what their purpose is in
regards to the type of data

00:04:49.750 --> 00:04:50.710 align:middle line:90%
that they store.

00:04:50.710 --> 00:04:54.010 align:middle line:84%
So if you're familiar with
the Metasploit Framework,

00:04:54.010 --> 00:04:56.830 align:middle line:84%
you should be familiar with
these variables, variables

00:04:56.830 --> 00:05:01.330 align:middle line:84%
like the LHOST, LPORT,
RHOST, RHOSTS, or RPORTs.

00:05:01.330 --> 00:05:04.050 align:middle line:84%
So the LHOST variable
is used to stored

00:05:04.050 --> 00:05:06.210 align:middle line:84%
the IP address of the
attacker system, which

00:05:06.210 --> 00:05:07.770 align:middle line:90%
is going to be our system.

00:05:07.770 --> 00:05:10.800 align:middle line:84%
The LPORT variable is used
to store the port number

00:05:10.800 --> 00:05:13.800 align:middle line:84%
on the attacker system that
will be used to receive

00:05:13.800 --> 00:05:15.030 align:middle line:90%
a reverse connection.

00:05:15.030 --> 00:05:17.970 align:middle line:84%
So the LHOST and
LPORT variables are

00:05:17.970 --> 00:05:21.270 align:middle line:84%
really useful when it comes
down to a particular module that

00:05:21.270 --> 00:05:23.550 align:middle line:84%
is going to provide us
with a reverse shell.

00:05:23.550 --> 00:05:28.080 align:middle line:84%
The way a reverse shell works
is that once the exploit is sent

00:05:28.080 --> 00:05:30.600 align:middle line:84%
or once it's executed
on the target system,

00:05:30.600 --> 00:05:33.660 align:middle line:84%
the payload initiates a
reverse connection back

00:05:33.660 --> 00:05:34.620 align:middle line:90%
to the attacker.

00:05:34.620 --> 00:05:36.900 align:middle line:84%
And in order for
that to be done,

00:05:36.900 --> 00:05:39.390 align:middle line:84%
the payload requires
the attacker's

00:05:39.390 --> 00:05:42.270 align:middle line:84%
IP as well as the port
that is currently listening

00:05:42.270 --> 00:05:43.690 align:middle line:90%
on the attacker system.

00:05:43.690 --> 00:05:47.640 align:middle line:84%
And this is where the LHOST and
LPORT variables come into play.

00:05:47.640 --> 00:05:50.370 align:middle line:84%
You then have the RHOST
and RPORT variables,

00:05:50.370 --> 00:05:54.210 align:middle line:84%
which in the case
of the RHOST is

00:05:54.210 --> 00:05:57.490 align:middle line:84%
used to store the IP address
of the target system or server.

00:05:57.490 --> 00:06:00.630 align:middle line:84%
So this is going to be,
again, the target's IP.

00:06:00.630 --> 00:06:03.750 align:middle line:84%
The RHOSTS option is
used to store the IP

00:06:03.750 --> 00:06:06.760 align:middle line:90%
address of multiple targets.

00:06:06.760 --> 00:06:10.440 align:middle line:84%
So if you're targeting
more than one system,

00:06:10.440 --> 00:06:14.580 align:middle line:84%
then you can specify various or
multiple IP addresses as well

00:06:14.580 --> 00:06:16.150 align:middle line:90%
as an entire network range.

00:06:16.150 --> 00:06:20.100 align:middle line:84%
And that is what the RHOSTS
variable is used to store.

00:06:20.100 --> 00:06:23.430 align:middle line:84%
The RPORT option is used
to store the port number

00:06:23.430 --> 00:06:25.630 align:middle line:84%
that we are targeting
on the target system.

00:06:25.630 --> 00:06:28.740 align:middle line:84%
So, for example, if we go
back to the Windows exploit

00:06:28.740 --> 00:06:31.740 align:middle line:84%
module example, if
we are targeting SMB,

00:06:31.740 --> 00:06:36.090 align:middle line:84%
then we would set the
RPORT value to port 445,

00:06:36.090 --> 00:06:38.860 align:middle line:84%
because that is the
port SMB is running on.

00:06:38.860 --> 00:06:41.280 align:middle line:84%
So, again, it's fairly
simple to understand.

00:06:41.280 --> 00:06:45.030 align:middle line:84%
And it'll make sense once we get
into the Metasploit Framework

00:06:45.030 --> 00:06:45.780 align:middle line:90%
console.

00:06:45.780 --> 00:06:49.030 align:middle line:84%
So let's get started with
the practical demonstration.

00:06:49.030 --> 00:06:53.410 align:middle line:84%
So I'm going to see
you back on my Kali VM.

00:06:53.410 --> 00:06:56.320 align:middle line:84%
All right, so I am
back on my Kali VM.

00:06:56.320 --> 00:06:58.900 align:middle line:84%
And I'm just going to
bring this into fullscreen

00:06:58.900 --> 00:07:00.320 align:middle line:90%
so we can see what's going on.

00:07:00.320 --> 00:07:02.020 align:middle line:84%
So the first thing
I'm going to do

00:07:02.020 --> 00:07:03.670 align:middle line:84%
is, of course,
initialize or start

00:07:03.670 --> 00:07:05.380 align:middle line:84%
up the Metasploit
Framework console.

00:07:05.380 --> 00:07:08.560 align:middle line:84%
So msfconsole and
we'll hit Enter.

00:07:08.560 --> 00:07:10.765 align:middle line:84%
Give that a few
seconds to start it up.

00:07:10.765 --> 00:07:12.640 align:middle line:84%
Again, if this is your
first time running it,

00:07:12.640 --> 00:07:14.290 align:middle line:84%
it will take more
than a few seconds.

00:07:14.290 --> 00:07:16.290 align:middle line:90%
So in my case, there we are.

00:07:16.290 --> 00:07:18.940 align:middle line:84%
We can see starting the
Metasploit Framework console.

00:07:18.940 --> 00:07:22.660 align:middle line:84%
And voila, so it started up and
we get this really cool ASCII

00:07:22.660 --> 00:07:23.410 align:middle line:90%
banner.

00:07:23.410 --> 00:07:24.940 align:middle line:84%
All right, now,
it's very important

00:07:24.940 --> 00:07:27.370 align:middle line:84%
to note that some
key information is

00:07:27.370 --> 00:07:30.310 align:middle line:84%
displayed whenever you start
up the Metasploit Framework

00:07:30.310 --> 00:07:31.420 align:middle line:90%
console.

00:07:31.420 --> 00:07:33.170 align:middle line:84%
That information
is right over here.

00:07:33.170 --> 00:07:35.740 align:middle line:84%
So firstly, it prints out
the version of Metasploit

00:07:35.740 --> 00:07:36.640 align:middle line:90%
that's running.

00:07:36.640 --> 00:07:39.880 align:middle line:84%
And then it prints out
all the available modules

00:07:39.880 --> 00:07:41.960 align:middle line:90%
in their various categories.

00:07:41.960 --> 00:07:45.580 align:middle line:84%
So we have exploit
modules, auxiliary modules,

00:07:45.580 --> 00:07:48.760 align:middle line:84%
post-exploitation modules,
payloads, encoders, nops,

00:07:48.760 --> 00:07:50.380 align:middle line:90%
as well as evasion modules.

00:07:50.380 --> 00:07:53.350 align:middle line:84%
And, of course, the
total amount in regards

00:07:53.350 --> 00:07:57.220 align:middle line:84%
to the number of these
modules is also specified.

00:07:57.220 --> 00:07:58.060 align:middle line:90%
So there we are.

00:07:58.060 --> 00:08:01.570 align:middle line:84%
You can clear the terminal
by typing in or using

00:08:01.570 --> 00:08:05.050 align:middle line:84%
the key binding Control and
L. And that should clear up

00:08:05.050 --> 00:08:07.330 align:middle line:84%
your terminal-- or the
Metasploit Framework console,

00:08:07.330 --> 00:08:10.220 align:middle line:84%
rather, as we are working
within it right now.

00:08:10.220 --> 00:08:13.360 align:middle line:84%
So welcome to the Metasploit
Framework console.

00:08:13.360 --> 00:08:16.300 align:middle line:84%
Now, getting started might
be a little bit confusing

00:08:16.300 --> 00:08:18.050 align:middle line:84%
because you might be
thinking to yourself,

00:08:18.050 --> 00:08:20.000 align:middle line:90%
well, what exactly do I do now?

00:08:20.000 --> 00:08:23.080 align:middle line:84%
Well, you really don't
need to do much in regards

00:08:23.080 --> 00:08:26.710 align:middle line:84%
to essentially setting
up various options.

00:08:26.710 --> 00:08:29.200 align:middle line:84%
The Metasploit
Framework is very useful

00:08:29.200 --> 00:08:31.960 align:middle line:84%
when you essentially
know what you're doing

00:08:31.960 --> 00:08:33.530 align:middle line:84%
and what system
you're targeting.

00:08:33.530 --> 00:08:35.919 align:middle line:84%
However, there's a
few important commands

00:08:35.919 --> 00:08:37.570 align:middle line:90%
that you should be aware of.

00:08:37.570 --> 00:08:39.400 align:middle line:84%
So let's open up
the help menu, which

00:08:39.400 --> 00:08:41.289 align:middle line:90%
can be done by typing in help.

00:08:41.289 --> 00:08:43.179 align:middle line:90%
That's fairly simple.

00:08:43.179 --> 00:08:45.310 align:middle line:84%
So we type in help,
and this will bring up

00:08:45.310 --> 00:08:48.520 align:middle line:84%
a list of commands and
their descriptions in

00:08:48.520 --> 00:08:50.390 align:middle line:84%
regards to what
they are used for.

00:08:50.390 --> 00:08:52.420 align:middle line:84%
So let's take a look
at the core commands.

00:08:52.420 --> 00:08:54.550 align:middle line:84%
You can see it gives
you an idea of all

00:08:54.550 --> 00:08:57.820 align:middle line:84%
of the commands available to
you and what they are used for.

00:08:57.820 --> 00:08:59.530 align:middle line:84%
In our case, we're
really not going

00:08:59.530 --> 00:09:01.010 align:middle line:90%
to go through the documentation.

00:09:01.010 --> 00:09:02.427 align:middle line:84%
I'm going to be
taking you through

00:09:02.427 --> 00:09:04.090 align:middle line:84%
some practical
demonstrations that

00:09:04.090 --> 00:09:07.330 align:middle line:84%
will explain how to utilize
the Metasploit Framework.

00:09:07.330 --> 00:09:09.020 align:middle line:90%
You also have module commands.

00:09:09.020 --> 00:09:10.720 align:middle line:84%
So they are sorted
based on category.

00:09:10.720 --> 00:09:14.170 align:middle line:84%
You have core commands,
module commands, job commands,

00:09:14.170 --> 00:09:16.090 align:middle line:84%
resource script
commands, as well as

00:09:16.090 --> 00:09:18.520 align:middle line:84%
database backend
commands, which we will

00:09:18.520 --> 00:09:21.160 align:middle line:90%
be exploring in the next video.

00:09:21.160 --> 00:09:23.140 align:middle line:84%
You also have a few
other commands here

00:09:23.140 --> 00:09:25.750 align:middle line:90%
and the relevant documentation.

00:09:25.750 --> 00:09:29.650 align:middle line:84%
And as you can see, it
gives you some documentation

00:09:29.650 --> 00:09:32.360 align:middle line:84%
as to what the Metasploit
Framework console is.

00:09:32.360 --> 00:09:35.230 align:middle line:84%
So now that we have
accessed the help menu,

00:09:35.230 --> 00:09:38.710 align:middle line:84%
let's take a look at how
to display some information

00:09:38.710 --> 00:09:39.575 align:middle line:90%
like the version.

00:09:39.575 --> 00:09:41.950 align:middle line:84%
So if we wanted to display
the version of Metasploit that

00:09:41.950 --> 00:09:44.080 align:middle line:84%
is currently running,
we type in version.

00:09:44.080 --> 00:09:46.720 align:middle line:84%
As you can see, it tells us
that we're running the Framework

00:09:46.720 --> 00:09:51.740 align:middle line:84%
version 6.1.13-dev and
the same for the console.

00:09:51.740 --> 00:09:53.650 align:middle line:84%
So that's very important
when it comes down

00:09:53.650 --> 00:09:56.110 align:middle line:84%
to identifying issues
with a particular release.

00:09:56.110 --> 00:09:59.710 align:middle line:84%
Or in the event you want
to essentially roll back

00:09:59.710 --> 00:10:02.710 align:middle line:84%
to a previous version, you can
always use this functionality

00:10:02.710 --> 00:10:04.870 align:middle line:84%
to find out what version
you're currently on,

00:10:04.870 --> 00:10:07.960 align:middle line:84%
in regards to both the
Framework and the console,

00:10:07.960 --> 00:10:10.510 align:middle line:84%
because they are separate
elements, as we've already

00:10:10.510 --> 00:10:11.680 align:middle line:90%
explored.

00:10:11.680 --> 00:10:12.520 align:middle line:90%
OK, cool.

00:10:12.520 --> 00:10:18.610 align:middle line:84%
So we can also go through
the process of showing

00:10:18.610 --> 00:10:20.540 align:middle line:90%
all the available modules.

00:10:20.540 --> 00:10:23.260 align:middle line:84%
So if we say show
all, this will show us

00:10:23.260 --> 00:10:24.850 align:middle line:90%
all the available modules.

00:10:24.850 --> 00:10:28.000 align:middle line:84%
And, of course, we're talking
about exploit modules,

00:10:28.000 --> 00:10:31.030 align:middle line:84%
payloads, and auxiliary
modules, encoders,

00:10:31.030 --> 00:10:32.330 align:middle line:90%
all of that good stuff.

00:10:32.330 --> 00:10:35.380 align:middle line:84%
However, we can also
show or limit the results

00:10:35.380 --> 00:10:37.690 align:middle line:84%
to maybe something
like exploits.

00:10:37.690 --> 00:10:39.430 align:middle line:90%
So we say show exploits.

00:10:39.430 --> 00:10:42.760 align:middle line:84%
This will show us a list
of all available exploits.

00:10:42.760 --> 00:10:44.320 align:middle line:84%
And we'll go through
the structure

00:10:44.320 --> 00:10:46.390 align:middle line:84%
under which the Metasploit
Framework console

00:10:46.390 --> 00:10:47.650 align:middle line:90%
displays modules.

00:10:47.650 --> 00:10:51.460 align:middle line:84%
For now, you can see that the
total number of exploit modules

00:10:51.460 --> 00:10:54.430 align:middle line:90%
is 2,177.

00:10:54.430 --> 00:10:56.950 align:middle line:84%
All right, if we
open up the help menu

00:10:56.950 --> 00:11:00.070 align:middle line:84%
for the show command, which
you can do by using the show -h

00:11:00.070 --> 00:11:05.050 align:middle line:84%
option here, this will
open up the help menu

00:11:05.050 --> 00:11:06.410 align:middle line:90%
for that particular command.

00:11:06.410 --> 00:11:08.380 align:middle line:84%
And this also works
with other commands.

00:11:08.380 --> 00:11:09.910 align:middle line:84%
In the event you
want to learn more

00:11:09.910 --> 00:11:13.000 align:middle line:84%
about a particular command,
that's the way you can do it.

00:11:13.000 --> 00:11:16.960 align:middle line:84%
As you can see, the parameters
for the show command

00:11:16.960 --> 00:11:20.260 align:middle line:84%
are all, encoders, nops,
exploits, payloads, et cetera.

00:11:20.260 --> 00:11:22.510 align:middle line:84%
So we can use the show
command to essentially

00:11:22.510 --> 00:11:26.770 align:middle line:84%
display exploits, payloads,
auxiliary modules, et cetera.

00:11:26.770 --> 00:11:28.430 align:middle line:84%
So that's really
not that important,

00:11:28.430 --> 00:11:30.590 align:middle line:90%
but it will be in a few seconds.

00:11:30.590 --> 00:11:33.980 align:middle line:84%
So let's take a look
at a practical example.

00:11:33.980 --> 00:11:36.790 align:middle line:84%
Let's say we want to
perform some port scanning.

00:11:36.790 --> 00:11:38.380 align:middle line:90%
Well, how do we get started?

00:11:38.380 --> 00:11:42.370 align:middle line:84%
We can get started by searching
for a port-scanning module.

00:11:42.370 --> 00:11:44.890 align:middle line:84%
That can be done by
typing in search.

00:11:44.890 --> 00:11:47.920 align:middle line:84%
And then we can say
portscan, hit Enter.

00:11:47.920 --> 00:11:49.630 align:middle line:84%
And as you can see,
it will display

00:11:49.630 --> 00:11:51.310 align:middle line:90%
a list of matching modules.

00:11:51.310 --> 00:11:53.030 align:middle line:84%
And the way the
Metasploit Framework

00:11:53.030 --> 00:11:56.330 align:middle line:84%
console displays or
sorts out the modules

00:11:56.330 --> 00:11:58.520 align:middle line:84%
is firstly through
an index number.

00:11:58.520 --> 00:12:01.610 align:middle line:84%
That's a unique identifier
for each of these modules.

00:12:01.610 --> 00:12:02.790 align:middle line:90%
You then have the name.

00:12:02.790 --> 00:12:05.000 align:middle line:84%
So this is the name
of a module and this

00:12:05.000 --> 00:12:07.490 align:middle line:84%
is how you will reference
it whenever you're

00:12:07.490 --> 00:12:09.350 align:middle line:90%
trying to use it or to load it.

00:12:09.350 --> 00:12:11.030 align:middle line:84%
And then you have
the disclosure date.

00:12:11.030 --> 00:12:13.820 align:middle line:84%
This is pertinent
to exploit modules.

00:12:13.820 --> 00:12:16.700 align:middle line:84%
You then have the rank in
regards to the functionality

00:12:16.700 --> 00:12:18.170 align:middle line:90%
or chances of success.

00:12:18.170 --> 00:12:19.670 align:middle line:84%
You then have the
description, which

00:12:19.670 --> 00:12:23.630 align:middle line:84%
gives you a description of what
this module is designed to do.

00:12:23.630 --> 00:12:26.580 align:middle line:84%
So if we take a look at
this module right over here,

00:12:26.580 --> 00:12:29.450 align:middle line:84%
we can see that this is
a TCP portscanner module,

00:12:29.450 --> 00:12:31.770 align:middle line:84%
and it's an auxiliary
module at that.

00:12:31.770 --> 00:12:35.400 align:middle line:84%
And in order to use it, we can
copy the name of the module.

00:12:35.400 --> 00:12:36.710 align:middle line:90%
So we can copy that there.

00:12:36.710 --> 00:12:38.270 align:middle line:90%
And then we can say use--

00:12:38.270 --> 00:12:41.690 align:middle line:84%
and paste in the name of
the module and hit Enter.

00:12:41.690 --> 00:12:43.970 align:middle line:84%
Now, you'll see something
interesting happen here.

00:12:43.970 --> 00:12:46.440 align:middle line:84%
Instead of just getting
a simple prompt here,

00:12:46.440 --> 00:12:49.160 align:middle line:84%
we can now see that the
Metasploit Framework console

00:12:49.160 --> 00:12:52.620 align:middle line:84%
prompt now adds the
actual module name here.

00:12:52.620 --> 00:12:55.910 align:middle line:84%
And in this case, it says
we're using an auxiliary module

00:12:55.910 --> 00:12:59.600 align:middle line:84%
and then refers to the specific
auxiliary module we're using.

00:12:59.600 --> 00:13:02.670 align:middle line:84%
And it's highlighted in red,
which means it's active.

00:13:02.670 --> 00:13:06.300 align:middle line:84%
So that means that we're
currently using this module.

00:13:06.300 --> 00:13:08.430 align:middle line:84%
Now, when it comes
down to using a module,

00:13:08.430 --> 00:13:10.130 align:middle line:84%
we need to configure
the options.

00:13:10.130 --> 00:13:14.890 align:middle line:84%
In order to display the options,
we type in show options.

00:13:14.890 --> 00:13:16.345 align:middle line:84%
Once we hit show
options, you can

00:13:16.345 --> 00:13:18.220 align:middle line:84%
see it's going to show
you the module options

00:13:18.220 --> 00:13:19.930 align:middle line:90%
for this particular module.

00:13:19.930 --> 00:13:22.390 align:middle line:84%
And then the options
are sorted into name,

00:13:22.390 --> 00:13:25.060 align:middle line:84%
the current setting,
whether they're required,

00:13:25.060 --> 00:13:26.470 align:middle line:90%
and the description.

00:13:26.470 --> 00:13:30.130 align:middle line:84%
In this case, you can see
that almost all of the options

00:13:30.130 --> 00:13:34.390 align:middle line:84%
have been set apart from
the RHOSTS option, which,

00:13:34.390 --> 00:13:37.600 align:middle line:84%
as we already know, is
used to specify the target

00:13:37.600 --> 00:13:39.700 align:middle line:90%
IP or various IPs.

00:13:39.700 --> 00:13:41.920 align:middle line:84%
So as you can see, the
description is provided here.

00:13:41.920 --> 00:13:44.600 align:middle line:84%
This is used to specify
the target hosts.

00:13:44.600 --> 00:13:48.550 align:middle line:84%
So let's talk about setting
the variables here or setting

00:13:48.550 --> 00:13:49.810 align:middle line:90%
the module options.

00:13:49.810 --> 00:13:53.830 align:middle line:84%
If we want to set the RHOSTS
option to our target IP,

00:13:53.830 --> 00:13:58.450 align:middle line:84%
we can do that by
saying set RHOSTS--

00:13:58.450 --> 00:13:59.880 align:middle line:90%
and then we provide the value.

00:13:59.880 --> 00:14:02.700 align:middle line:84%
In this case, I'm just going
to provide the IP address

00:14:02.700 --> 00:14:07.290 align:middle line:90%
of my router, so 192.168.2.1.

00:14:07.290 --> 00:14:09.300 align:middle line:84%
Once I hit Enter,
it's going to give you

00:14:09.300 --> 00:14:12.480 align:middle line:84%
the confirmation saying RHOSTS
has been set to this value

00:14:12.480 --> 00:14:13.210 align:middle line:90%
here.

00:14:13.210 --> 00:14:16.980 align:middle line:84%
And now we can confirm that
this setting or this option

00:14:16.980 --> 00:14:19.200 align:middle line:84%
has been set by
clearing our terminal

00:14:19.200 --> 00:14:21.390 align:middle line:90%
and then saying show options.

00:14:21.390 --> 00:14:23.880 align:middle line:84%
And as you can see
here, the RHOSTS value

00:14:23.880 --> 00:14:25.830 align:middle line:84%
has been added
that we specified.

00:14:25.830 --> 00:14:29.670 align:middle line:84%
And we pretty much can customize
any of these other values

00:14:29.670 --> 00:14:33.400 align:middle line:84%
by simply saying set and then
specifying the option name.

00:14:33.400 --> 00:14:35.640 align:middle line:84%
So let's say we wanted
to change the target

00:14:35.640 --> 00:14:38.800 align:middle line:84%
port to scan because this
is a portscanner module.

00:14:38.800 --> 00:14:41.530 align:middle line:90%
We can say set PORTS.

00:14:41.530 --> 00:14:45.430 align:middle line:84%
And in this case, we can specify
one port or an entire range

00:14:45.430 --> 00:14:49.040 align:middle line:84%
of ports, and it provides you
with the syntax for doing so.

00:14:49.040 --> 00:14:52.900 align:middle line:84%
So in this case, let's say we
want to scan ports 1 to 1,000.

00:14:52.900 --> 00:14:54.910 align:middle line:84%
And, of course,
these are TCP ports.

00:14:54.910 --> 00:14:55.840 align:middle line:90%
We hit Enter.

00:14:55.840 --> 00:14:57.970 align:middle line:84%
You can see we get a
confirmation of that.

00:14:57.970 --> 00:14:59.620 align:middle line:84%
And then we can
clear our terminal

00:14:59.620 --> 00:15:02.750 align:middle line:84%
and show the options again,
just to make sure that is set.

00:15:02.750 --> 00:15:05.210 align:middle line:84%
And you can see that
that is set correctly.

00:15:05.210 --> 00:15:07.390 align:middle line:84%
And you can go ahead and
customize the other options

00:15:07.390 --> 00:15:07.970 align:middle line:90%
here.

00:15:07.970 --> 00:15:09.640 align:middle line:90%
But for now, this looks fine.

00:15:09.640 --> 00:15:11.860 align:middle line:84%
So all we're going
to do is type run.

00:15:11.860 --> 00:15:15.140 align:middle line:84%
And that is going to execute
this particular module.

00:15:15.140 --> 00:15:17.390 align:middle line:84%
And it'll begin the
portscanning process.

00:15:17.390 --> 00:15:19.270 align:middle line:84%
So, again, give
that a few seconds.

00:15:19.270 --> 00:15:22.660 align:middle line:84%
As you can see, it's starting
to discover various open ports

00:15:22.660 --> 00:15:23.720 align:middle line:90%
on my router.

00:15:23.720 --> 00:15:26.290 align:middle line:90%
So the port 53 is open for DNS.

00:15:26.290 --> 00:15:29.770 align:middle line:84%
We can also see that the router
has a web interface running

00:15:29.770 --> 00:15:30.850 align:middle line:90%
on port 80.

00:15:30.850 --> 00:15:34.570 align:middle line:84%
And it gives you,
essentially, the results here.

00:15:34.570 --> 00:15:37.060 align:middle line:84%
And the module is
currently running.

00:15:37.060 --> 00:15:40.150 align:middle line:84%
Once it is done running, it
should terminate and take you

00:15:40.150 --> 00:15:43.257 align:middle line:84%
back to your Metasploit
Framework console.

00:15:43.257 --> 00:15:45.340 align:middle line:84%
In this case, you can see
that it's still running.

00:15:45.340 --> 00:15:48.350 align:middle line:84%
If you want to terminate
a particular module,

00:15:48.350 --> 00:15:50.860 align:middle line:84%
you can use the
Control-C key binding.

00:15:50.860 --> 00:15:52.750 align:middle line:84%
That will terminate
it, as you can see.

00:15:52.750 --> 00:15:55.120 align:middle line:84%
It catches the interrupt
from the console

00:15:55.120 --> 00:15:58.060 align:middle line:84%
and then it takes us
back to the module here.

00:15:58.060 --> 00:16:04.120 align:middle line:84%
Now, let's say we actually want
to go back or essentially stop

00:16:04.120 --> 00:16:06.110 align:middle line:90%
using this particular module.

00:16:06.110 --> 00:16:08.090 align:middle line:84%
We can do that by
typing in back.

00:16:08.090 --> 00:16:10.870 align:middle line:84%
And as you can
see, now we are not

00:16:10.870 --> 00:16:12.620 align:middle line:90%
using that particular module.

00:16:12.620 --> 00:16:15.910 align:middle line:84%
So that is the process of
searching for using a module

00:16:15.910 --> 00:16:19.960 align:middle line:84%
and then setting the
various module options that

00:16:19.960 --> 00:16:22.210 align:middle line:84%
are required in
order for it to run.

00:16:22.210 --> 00:16:25.240 align:middle line:84%
OK, let's take a look at
a few other search options

00:16:25.240 --> 00:16:26.170 align:middle line:90%
that we can utilize.

00:16:26.170 --> 00:16:29.530 align:middle line:84%
If we open up the
search documentation

00:16:29.530 --> 00:16:33.730 align:middle line:84%
by typing in search -h, you
can see that at the bottom,

00:16:33.730 --> 00:16:35.710 align:middle line:84%
we also have the
ability to search

00:16:35.710 --> 00:16:39.790 align:middle line:84%
for specific CVEs and
the actual platform

00:16:39.790 --> 00:16:42.650 align:middle line:84%
as well as the type of module
that we are looking for.

00:16:42.650 --> 00:16:44.930 align:middle line:90%
So let's use a simple example.

00:16:44.930 --> 00:16:49.300 align:middle line:84%
Let's say we are looking for
CVEs or modules that exploit

00:16:49.300 --> 00:16:51.070 align:middle line:90%
a particular vulnerability.

00:16:51.070 --> 00:16:53.860 align:middle line:84%
And we want to sort
it by the CVE code,

00:16:53.860 --> 00:16:56.200 align:middle line:90%
or rather, the CVE year.

00:16:56.200 --> 00:17:00.760 align:middle line:84%
We can specify CVE and then
maybe the year, maybe 2017.

00:17:00.760 --> 00:17:04.380 align:middle line:84%
And then the type is
going to be an exploit.

00:17:04.380 --> 00:17:07.800 align:middle line:84%
And then the platform,
we can say Windows.

00:17:07.800 --> 00:17:09.690 align:middle line:84%
So essentially, what
we're saying here

00:17:09.690 --> 00:17:14.040 align:middle line:84%
is look for all exploit modules
for the Windows operating

00:17:14.040 --> 00:17:17.430 align:middle line:84%
system that were released
in the year 2017.

00:17:17.430 --> 00:17:18.960 align:middle line:90%
So we hit Enter.

00:17:18.960 --> 00:17:21.930 align:middle line:84%
And as you can see, it lists
or provides us with about 60

00:17:21.930 --> 00:17:22.560 align:middle line:90%
of them.

00:17:22.560 --> 00:17:23.911 align:middle line:90%
And these are various--

00:17:23.911 --> 00:17:25.619 align:middle line:84%
and in this case, you
can see, well, it's

00:17:25.619 --> 00:17:29.070 align:middle line:84%
actually provided us with
various operating systems here.

00:17:29.070 --> 00:17:32.280 align:middle line:84%
If we can just change
that to Windows,

00:17:32.280 --> 00:17:35.580 align:middle line:84%
the platform is Windows,
and hit Enter, there we are.

00:17:35.580 --> 00:17:39.510 align:middle line:84%
So these are the Windows
exploits released in 2017,

00:17:39.510 --> 00:17:40.740 align:middle line:90%
as you can see.

00:17:40.740 --> 00:17:43.500 align:middle line:84%
Their disclosure date may
be a little bit earlier.

00:17:43.500 --> 00:17:46.530 align:middle line:84%
But, again, it
essentially provides you

00:17:46.530 --> 00:17:48.070 align:middle line:90%
with all of these modules.

00:17:48.070 --> 00:17:50.950 align:middle line:84%
So you can search for modules
really, really easily.

00:17:50.950 --> 00:17:52.650 align:middle line:84%
And, again, we'll
be exploring how

00:17:52.650 --> 00:17:55.800 align:middle line:84%
to utilize the search
command as we move along

00:17:55.800 --> 00:17:56.980 align:middle line:90%
through this course.

00:17:56.980 --> 00:18:01.980 align:middle line:84%
So that is how to search
for modules, load modules,

00:18:01.980 --> 00:18:04.410 align:middle line:84%
as well as set the
various module options.

00:18:04.410 --> 00:18:07.560 align:middle line:84%
Now let's take a look at
some advanced commands

00:18:07.560 --> 00:18:10.380 align:middle line:84%
when it comes down
to specific modules,

00:18:10.380 --> 00:18:13.300 align:middle line:84%
and we'll also take
a look at payloads.

00:18:13.300 --> 00:18:15.960 align:middle line:84%
So let's say we
want to search or we

00:18:15.960 --> 00:18:19.510 align:middle line:84%
want to use the
EternalBlue exploit module.

00:18:19.510 --> 00:18:23.340 align:middle line:84%
We can search for it by
saying search eternalblue.

00:18:23.340 --> 00:18:26.010 align:middle line:84%
That is the name of
the exploit itself.

00:18:26.010 --> 00:18:26.765 align:middle line:90%
We hit Enter.

00:18:26.765 --> 00:18:28.890 align:middle line:84%
You can see that it's going
to be the first option.

00:18:28.890 --> 00:18:31.380 align:middle line:84%
This is a Windows
SMB exploit module

00:18:31.380 --> 00:18:35.490 align:middle line:84%
that targets SMB and essentially
provides us-- or essentially

00:18:35.490 --> 00:18:37.260 align:middle line:84%
takes advantage
of a vulnerability

00:18:37.260 --> 00:18:41.310 align:middle line:84%
within an older version of
SMB and allows for remote code

00:18:41.310 --> 00:18:42.310 align:middle line:90%
execution.

00:18:42.310 --> 00:18:44.100 align:middle line:90%
So we can just highlight that.

00:18:44.100 --> 00:18:46.510 align:middle line:90%
We can copy that there.

00:18:46.510 --> 00:18:49.470 align:middle line:84%
Additionally, you can
also load or use a module

00:18:49.470 --> 00:18:51.760 align:middle line:90%
by specifying the identifier.

00:18:51.760 --> 00:18:54.750 align:middle line:84%
So instead of saying
use and then typing

00:18:54.750 --> 00:18:59.490 align:middle line:84%
in the exploit name, we can also
just say use 0 and hit Enter.

00:18:59.490 --> 00:19:04.060 align:middle line:84%
And that is going to select
the exploit module here.

00:19:04.060 --> 00:19:07.150 align:middle line:84%
Now, you can see that this
particular module gives us

00:19:07.150 --> 00:19:09.940 align:middle line:84%
an error message or,
rather, a notice saying,

00:19:09.940 --> 00:19:12.490 align:middle line:84%
No payload is
configured, defaulting

00:19:12.490 --> 00:19:14.035 align:middle line:84%
to
windows/x64/meterpreter/reverse

00:19:14.035 --> 00:19:16.610 align:middle line:90%
tcp.

00:19:16.610 --> 00:19:19.750 align:middle line:84%
So this is, as I said,
where the type of payload

00:19:19.750 --> 00:19:20.890 align:middle line:90%
is very important.

00:19:20.890 --> 00:19:24.220 align:middle line:84%
Now, based on the target
system you are targeting

00:19:24.220 --> 00:19:28.000 align:middle line:84%
and its architecture,
is it 32-bit or 64-bit,

00:19:28.000 --> 00:19:30.790 align:middle line:84%
you're going to need to
change or reconfigure

00:19:30.790 --> 00:19:34.820 align:middle line:84%
the payload for this particular
exploit to something else.

00:19:34.820 --> 00:19:37.930 align:middle line:84%
And, again, based on the type
of connection you want back,

00:19:37.930 --> 00:19:40.120 align:middle line:84%
you can change this
from a Meterpreter

00:19:40.120 --> 00:19:43.280 align:middle line:84%
to maybe a simple reverse
shell if you want to.

00:19:43.280 --> 00:19:45.250 align:middle line:84%
But in this case, as
it says, the default

00:19:45.250 --> 00:19:47.330 align:middle line:84%
is set to this
particular module.

00:19:47.330 --> 00:19:51.280 align:middle line:84%
So if we clear that out
and say show options,

00:19:51.280 --> 00:19:54.740 align:middle line:84%
you can see that we now have
more options than normal.

00:19:54.740 --> 00:19:56.060 align:middle line:90%
And this is not a mistake.

00:19:56.060 --> 00:19:57.530 align:middle line:90%
This is very, very important.

00:19:57.530 --> 00:20:01.610 align:middle line:84%
So you can see that we firstly
have the module options.

00:20:01.610 --> 00:20:03.370 align:middle line:84%
We then have the
payload options,

00:20:03.370 --> 00:20:05.830 align:middle line:84%
and this is where the
Metasploit Framework module

00:20:05.830 --> 00:20:07.660 align:middle line:90%
variables come into play.

00:20:07.660 --> 00:20:09.640 align:middle line:84%
As you can see, we
have the ability

00:20:09.640 --> 00:20:13.450 align:middle line:84%
to set the RHOSTS option as
well as the RPORT option.

00:20:13.450 --> 00:20:15.730 align:middle line:84%
We then need to set
the payload options

00:20:15.730 --> 00:20:18.040 align:middle line:84%
for the reverse connection,
and this will include

00:20:18.040 --> 00:20:19.800 align:middle line:90%
the LHOST and the LPORT.

00:20:19.800 --> 00:20:23.380 align:middle line:84%
So this is where we specify
our attacker IP address--

00:20:23.380 --> 00:20:25.700 align:middle line:84%
as it's called here,
the listen IP address--

00:20:25.700 --> 00:20:28.150 align:middle line:84%
and then the LPORT,
or the listen port,

00:20:28.150 --> 00:20:29.780 align:middle line:90%
for the reverse connection.

00:20:29.780 --> 00:20:31.940 align:middle line:84%
So, again, this is
how you can do it.

00:20:31.940 --> 00:20:34.810 align:middle line:84%
If we want to change the
payload for a particular exploit

00:20:34.810 --> 00:20:37.600 align:middle line:84%
module, we can always
say set payload,

00:20:37.600 --> 00:20:40.480 align:middle line:84%
and then we need to specify
the name of the payload, which

00:20:40.480 --> 00:20:42.220 align:middle line:84%
in this case, we
can say Windows.

00:20:42.220 --> 00:20:44.410 align:middle line:84%
And then we can just
say Meterpreter.

00:20:44.410 --> 00:20:46.810 align:middle line:84%
So we're using a
32-bit Meterpreter

00:20:46.810 --> 00:20:50.410 align:middle line:84%
version, so windows/meterpreter
and so on and so forth.

00:20:50.410 --> 00:20:51.910 align:middle line:84%
And you can then
change the payload.

00:20:51.910 --> 00:20:53.680 align:middle line:84%
And, again, don't
worry about this.

00:20:53.680 --> 00:20:56.840 align:middle line:84%
We will be exploring
it as we move along.

00:20:56.840 --> 00:20:59.890 align:middle line:84%
So that is essentially
how to load a module

00:20:59.890 --> 00:21:04.480 align:middle line:84%
and how payloads can be set for
a particular exploit module.

00:21:04.480 --> 00:21:07.650 align:middle line:84%
And of course, you can set
up the options really simply.

00:21:07.650 --> 00:21:09.400 align:middle line:84%
So, for example, we
can do that right now.

00:21:09.400 --> 00:21:11.380 align:middle line:90%
We can set the RHOSTS to--

00:21:11.380 --> 00:21:13.233 align:middle line:90%
I'll set up my router IP.

00:21:13.233 --> 00:21:14.650 align:middle line:84%
Although it's not
running Windows,

00:21:14.650 --> 00:21:17.270 align:middle line:84%
it should be fine because
we're not going to run it.

00:21:17.270 --> 00:21:21.320 align:middle line:84%
We can then set our
LHOST and LPORT options.

00:21:21.320 --> 00:21:24.130 align:middle line:84%
So, again, in our case, that's
already been set for us.

00:21:24.130 --> 00:21:27.830 align:middle line:84%
That is my attacker IP
or my Kali Linux IP.

00:21:27.830 --> 00:21:30.800 align:middle line:84%
And this particular port
is currently available.

00:21:30.800 --> 00:21:34.330 align:middle line:84%
So if we say show
options, you can

00:21:34.330 --> 00:21:36.790 align:middle line:84%
see that a change has
been highlighted here.

00:21:36.790 --> 00:21:40.210 align:middle line:84%
And then once you're ready
to launch an exploit module,

00:21:40.210 --> 00:21:44.060 align:middle line:84%
all you need to do is type in
exploit or you can type in run.

00:21:44.060 --> 00:21:47.060 align:middle line:84%
And it will exploit or run
that particular exploit module.

00:21:47.060 --> 00:21:48.100 align:middle line:90%
So we can hit run.

00:21:48.100 --> 00:21:50.720 align:middle line:84%
As you can see, it's going
to begin the exploit process.

00:21:50.720 --> 00:21:51.950 align:middle line:90%
And it's going to fail.

00:21:51.950 --> 00:21:53.920 align:middle line:90%
It's going to fail, sorry.

00:21:53.920 --> 00:21:54.790 align:middle line:90%
And there we are.

00:21:54.790 --> 00:21:56.260 align:middle line:90%
The target is not vulnerable.

00:21:56.260 --> 00:21:58.040 align:middle line:90%
And then we can terminate that.

00:21:58.040 --> 00:21:59.770 align:middle line:84%
And as you can see,
exploit completed

00:21:59.770 --> 00:22:01.540 align:middle line:90%
but no session was created.

00:22:01.540 --> 00:22:04.750 align:middle line:84%
And that is essentially
how to search for and load

00:22:04.750 --> 00:22:08.750 align:middle line:84%
a module, how to configure the
options, et cetera, et cetera.

00:22:08.750 --> 00:22:11.710 align:middle line:84%
We also have a few other options
or commands that we can run.

00:22:11.710 --> 00:22:13.450 align:middle line:84%
As I mentioned, we
have the ability

00:22:13.450 --> 00:22:18.220 align:middle line:84%
to set sessions or essentially
monitor or manage sessions.

00:22:18.220 --> 00:22:21.370 align:middle line:84%
We can view the sessions
by typing in sessions.

00:22:21.370 --> 00:22:23.560 align:middle line:84%
And as you can see, we
have no active sessions.

00:22:23.560 --> 00:22:24.770 align:middle line:90%
Don't worry about that.

00:22:24.770 --> 00:22:29.020 align:middle line:84%
We will have active sessions
after the exploitation phase

00:22:29.020 --> 00:22:32.110 align:middle line:84%
once we have established initial
access on our target systems.

00:22:32.110 --> 00:22:34.240 align:middle line:84%
For now, just know
that this will

00:22:34.240 --> 00:22:36.520 align:middle line:84%
display a list of all
your active sessions

00:22:36.520 --> 00:22:39.610 align:middle line:84%
and their session IDs
so that we can navigate

00:22:39.610 --> 00:22:41.890 align:middle line:90%
or we can change between them.

00:22:41.890 --> 00:22:44.680 align:middle line:84%
All right, another
interesting piece

00:22:44.680 --> 00:22:46.870 align:middle line:84%
of functionality that
we have access to

00:22:46.870 --> 00:22:48.820 align:middle line:90%
is the connect command.

00:22:48.820 --> 00:22:51.410 align:middle line:84%
Now, the connect
command is essentially--

00:22:51.410 --> 00:22:53.290 align:middle line:84%
if I bring up the
help menu here--

00:22:53.290 --> 00:22:55.720 align:middle line:84%
is essentially, as it
says here, provides you

00:22:55.720 --> 00:22:57.940 align:middle line:84%
with the ability to
communicate with a host,

00:22:57.940 --> 00:23:01.210 align:middle line:84%
similar to interacting
with or via netcat,

00:23:01.210 --> 00:23:04.360 align:middle line:84%
taking advantage of any
configured session pivoting.

00:23:04.360 --> 00:23:07.000 align:middle line:84%
So this allows you to
essentially perform

00:23:07.000 --> 00:23:07.810 align:middle line:90%
banner-grabbing.

00:23:07.810 --> 00:23:09.370 align:middle line:90%
So if I say connect--

00:23:09.370 --> 00:23:12.700 align:middle line:84%
and all I need to do is specify
the target IP as well as

00:23:12.700 --> 00:23:13.660 align:middle line:90%
the target port.

00:23:13.660 --> 00:23:17.200 align:middle line:84%
It will essentially connect
to the IP and the port,

00:23:17.200 --> 00:23:19.770 align:middle line:84%
similar to netcat, and
will display the banner.

00:23:19.770 --> 00:23:25.360 align:middle line:84%
So if I say connect to
192.168.2.1 on port 80, which

00:23:25.360 --> 00:23:28.930 align:middle line:84%
is my router IP address,
and connect to port 80

00:23:28.930 --> 00:23:31.690 align:middle line:84%
and I hit Enter, you can
see it's going to connect.

00:23:31.690 --> 00:23:34.330 align:middle line:84%
And it tells you what
address it actually--

00:23:34.330 --> 00:23:37.390 align:middle line:84%
what port it used to connect
to from the attacker's IP

00:23:37.390 --> 00:23:39.400 align:middle line:90%
or from the attacker system.

00:23:39.400 --> 00:23:40.120 align:middle line:90%
And there we are.

00:23:40.120 --> 00:23:42.078 align:middle line:84%
Now, in this case, it's
not displaying a banner

00:23:42.078 --> 00:23:44.650 align:middle line:84%
because this is a web server,
which is perfectly fine.

00:23:44.650 --> 00:23:46.540 align:middle line:84%
But this, again,
will be very useful

00:23:46.540 --> 00:23:48.520 align:middle line:84%
as we move into
information gathering.

00:23:48.520 --> 00:23:52.100 align:middle line:84%
So we'll take a look at
that when we get there.

00:23:52.100 --> 00:23:55.690 align:middle line:84%
So, yeah, that is pretty
much all that is required in

00:23:55.690 --> 00:23:59.000 align:middle line:84%
regards to using the Metasploit
Framework for penetration

00:23:59.000 --> 00:23:59.500 align:middle line:90%
testing.

00:23:59.500 --> 00:24:02.350 align:middle line:84%
As I said, we'll be getting
into the nitty-gritty

00:24:02.350 --> 00:24:04.210 align:middle line:84%
as we progress
through this course,

00:24:04.210 --> 00:24:07.240 align:middle line:84%
and everything will start making
sense and most of the commands

00:24:07.240 --> 00:24:09.100 align:middle line:90%
will start becoming demystified.

00:24:09.100 --> 00:24:10.930 align:middle line:84%
And we'll take a
look at how to use

00:24:10.930 --> 00:24:13.300 align:middle line:84%
the Meterpreter, a
Meterpreter session

00:24:13.300 --> 00:24:15.410 align:middle line:84%
and the various commands
that fall under that.

00:24:15.410 --> 00:24:19.160 align:middle line:84%
So do not be alarmed if
this may seem overwhelming.

00:24:19.160 --> 00:24:19.660 align:middle line:90%
Don't worry.

00:24:19.660 --> 00:24:21.920 align:middle line:84%
Everything is going to
make sense as we progress.

00:24:21.920 --> 00:24:25.540 align:middle line:84%
So I'll see you
back on the slides.

00:24:25.540 --> 00:24:28.260 align:middle line:84%
All right, so you should be
familiar with the Metasploit

00:24:28.260 --> 00:24:30.720 align:middle line:84%
Framework console and how
to navigate around it,

00:24:30.720 --> 00:24:33.600 align:middle line:84%
how to search for modules,
how to use them, how to set

00:24:33.600 --> 00:24:37.380 align:middle line:84%
module options, how to execute
them, so on and so forth.

00:24:37.380 --> 00:24:39.750 align:middle line:84%
We will now be
taking a look at how

00:24:39.750 --> 00:24:43.020 align:middle line:84%
to manage workspaces within the
Metasploit Framework console.

00:24:43.020 --> 00:24:46.380 align:middle line:84%
And this, of course, will
entail the interaction

00:24:46.380 --> 00:24:48.960 align:middle line:84%
with the Metasploit
Framework database.

00:24:48.960 --> 00:24:51.990 align:middle line:84%
So do stay tuned for that,
and I'll be seeing you

00:24:51.990 --> 00:24:54.050 align:middle line:90%
in the next video.

00:24:54.050 --> 00:24:55.000 align:middle line:90%