WEBVTT

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


00:00:10.410 --> 00:00:13.050 align:middle line:84%
The Metasploit
Framework Architecture.

00:00:13.050 --> 00:00:14.700 align:middle line:84%
Now that we have
an understanding

00:00:14.700 --> 00:00:17.370 align:middle line:84%
of what the Metasploit
Framework is and how it works

00:00:17.370 --> 00:00:20.160 align:middle line:84%
and the key terminology
surrounding the framework,

00:00:20.160 --> 00:00:23.640 align:middle line:84%
we can begin exploring the
various components that make up

00:00:23.640 --> 00:00:24.990 align:middle line:90%
the Metasploit Framework.

00:00:24.990 --> 00:00:26.850 align:middle line:84%
Furthermore, we
also need to start

00:00:26.850 --> 00:00:30.090 align:middle line:84%
exploring the various modules
that are available to us,

00:00:30.090 --> 00:00:32.220 align:middle line:84%
how they work, where
they're stored.

00:00:32.220 --> 00:00:35.040 align:middle line:84%
And we also need to take
a look at the storage

00:00:35.040 --> 00:00:38.130 align:middle line:90%
locations of the said modules.

00:00:38.130 --> 00:00:42.870 align:middle line:84%
And we will also be exploring
the file system structure

00:00:42.870 --> 00:00:46.290 align:middle line:84%
for the Metasploit framework and
where all the relevant data is

00:00:46.290 --> 00:00:46.990 align:middle line:90%
stored.

00:00:46.990 --> 00:00:50.460 align:middle line:84%
So to get started, let's
begin by taking a look

00:00:50.460 --> 00:00:53.010 align:middle line:84%
at the Metasploit
Framework architecture.

00:00:53.010 --> 00:00:55.350 align:middle line:84%
Now, this diagram
essentially provides you

00:00:55.350 --> 00:00:59.730 align:middle line:84%
with a top-level overview
of the Metasploit framework

00:00:59.730 --> 00:01:03.870 align:middle line:84%
and essentially highlights the
various components that make up

00:01:03.870 --> 00:01:05.250 align:middle line:90%
the Metasploit Framework.

00:01:05.250 --> 00:01:08.130 align:middle line:84%
Now, we have already
explored interfaces,

00:01:08.130 --> 00:01:11.170 align:middle line:84%
as they're covered right
over here or laid out here.

00:01:11.170 --> 00:01:13.740 align:middle line:84%
So we already know what the
Metasploit Framework console

00:01:13.740 --> 00:01:18.750 align:middle line:84%
is, what the MSF CLI is,
the Armitage graphical user

00:01:18.750 --> 00:01:21.160 align:middle line:84%
interface as well as
the web interface.

00:01:21.160 --> 00:01:24.180 align:middle line:84%
So we already have an
understanding of that.

00:01:24.180 --> 00:01:27.690 align:middle line:84%
What we are primarily
focused on is the modules.

00:01:27.690 --> 00:01:30.480 align:middle line:84%
Now, the Metasploit
Framework categorizes

00:01:30.480 --> 00:01:33.640 align:middle line:84%
modules into the
following categories.

00:01:33.640 --> 00:01:36.240 align:middle line:84%
So we have exploit
modules, we have payloads,

00:01:36.240 --> 00:01:40.470 align:middle line:84%
we have encoders, we have NOPS,
and we have auxiliary modules.

00:01:40.470 --> 00:01:44.310 align:middle line:84%
Now, before we start exploring
what each of these modules

00:01:44.310 --> 00:01:47.370 align:middle line:84%
does, we need to
understand what a module is

00:01:47.370 --> 00:01:49.900 align:middle line:84%
in the context of the
Metasploit Framework.

00:01:49.900 --> 00:01:53.040 align:middle line:84%
So a module, in the context
of the Metasploit Framework,

00:01:53.040 --> 00:01:55.140 align:middle line:84%
is essentially a
piece of code that

00:01:55.140 --> 00:01:59.760 align:middle line:84%
can be utilized and executed
by the Metasploit Framework.

00:01:59.760 --> 00:02:01.890 align:middle line:84%
Now, when we talk about
the libraries, which

00:02:01.890 --> 00:02:04.470 align:middle line:84%
is the second element here
that we are really not going

00:02:04.470 --> 00:02:08.009 align:middle line:84%
to get into because, again, it's
beyond the scope of this course

00:02:08.009 --> 00:02:12.210 align:middle line:84%
and really isn't required
as a prerequisite in order

00:02:12.210 --> 00:02:14.830 align:middle line:84%
to utilize the
Metasploit Framework--

00:02:14.830 --> 00:02:17.010 align:middle line:84%
so when we're talking
about the libraries,

00:02:17.010 --> 00:02:18.930 align:middle line:84%
the Metasploit
Framework libraries

00:02:18.930 --> 00:02:20.940 align:middle line:84%
are essentially
used to facilitate

00:02:20.940 --> 00:02:24.390 align:middle line:84%
the execution of
modules without having

00:02:24.390 --> 00:02:27.990 align:middle line:84%
to write the code in order
to execute said modules.

00:02:27.990 --> 00:02:31.530 align:middle line:84%
So modules or the Metasploit
Framework libraries

00:02:31.530 --> 00:02:36.840 align:middle line:84%
are essentially like shared
objects on Linux or DLLs

00:02:36.840 --> 00:02:37.740 align:middle line:90%
on Windows.

00:02:37.740 --> 00:02:41.910 align:middle line:84%
So they essentially allow you to
extend functionality or contain

00:02:41.910 --> 00:02:44.820 align:middle line:84%
the code required to
extend the functionality

00:02:44.820 --> 00:02:47.640 align:middle line:84%
or to essentially
initiate functionality,

00:02:47.640 --> 00:02:51.330 align:middle line:84%
like creating a TCP socket,
et cetera, et cetera.

00:02:51.330 --> 00:02:54.180 align:middle line:84%
So that's as far as you
should know right now.

00:02:54.180 --> 00:02:57.960 align:middle line:84%
As I said, all of this will be
demystified as we progressively

00:02:57.960 --> 00:02:59.520 align:middle line:90%
move forward.

00:02:59.520 --> 00:03:03.330 align:middle line:84%
Now, let's begin by taking
a look at the Metasploit

00:03:03.330 --> 00:03:06.270 align:middle line:84%
Framework modules in
depth, starting off

00:03:06.270 --> 00:03:07.980 align:middle line:90%
with exploit modules.

00:03:07.980 --> 00:03:09.870 align:middle line:84%
All right, so
exploit modules are

00:03:09.870 --> 00:03:13.260 align:middle line:84%
modules that are used to take
advantage of a vulnerability

00:03:13.260 --> 00:03:15.960 align:middle line:84%
and are typically
paired with a payload.

00:03:15.960 --> 00:03:18.060 align:middle line:84%
So it's very important
to understand that.

00:03:18.060 --> 00:03:19.440 align:middle line:90%
Now, what is a payload?

00:03:19.440 --> 00:03:22.120 align:middle line:84%
Because exploits are
paired with payload.

00:03:22.120 --> 00:03:23.700 align:middle line:90%
So what exactly is a payload?

00:03:23.700 --> 00:03:26.190 align:middle line:84%
A payload is a
piece of code that

00:03:26.190 --> 00:03:29.640 align:middle line:84%
is delivered by the Metasploit
Framework to the target system

00:03:29.640 --> 00:03:32.700 align:middle line:84%
and is then executed
on the target system

00:03:32.700 --> 00:03:35.170 align:middle line:90%
after successful exploitation.

00:03:35.170 --> 00:03:38.460 align:middle line:84%
So let me just go over
that a little bit here.

00:03:38.460 --> 00:03:41.520 align:middle line:84%
An exploit module is paired
with a payload, right?

00:03:41.520 --> 00:03:43.980 align:middle line:84%
So it's very important to
understand that distinction.

00:03:43.980 --> 00:03:47.100 align:middle line:84%
An exploit is essentially
used to take advantage

00:03:47.100 --> 00:03:48.840 align:middle line:90%
or to exploit a vulnerability.

00:03:48.840 --> 00:03:51.660 align:middle line:84%
The payload is
the malicious code

00:03:51.660 --> 00:03:54.540 align:middle line:84%
that is executed on
the target system

00:03:54.540 --> 00:03:57.100 align:middle line:90%
after successful exploitation.

00:03:57.100 --> 00:04:00.840 align:middle line:84%
So if I can use a
simple analogy, when

00:04:00.840 --> 00:04:03.600 align:middle line:84%
the exploit and the payloads
are paired together,

00:04:03.600 --> 00:04:06.090 align:middle line:84%
what happens is
when I hit execute

00:04:06.090 --> 00:04:09.600 align:middle line:84%
or when I hit run on the
Metasploit Framework console,

00:04:09.600 --> 00:04:13.170 align:middle line:84%
the exploit essentially takes
advantage of the vulnerability

00:04:13.170 --> 00:04:17.279 align:middle line:84%
and then executes the
payload on the target system.

00:04:17.279 --> 00:04:22.170 align:middle line:84%
The payload is then again
utilized to either execute

00:04:22.170 --> 00:04:25.410 align:middle line:84%
arbitrary commands on the
target system or, in this case,

00:04:25.410 --> 00:04:27.780 align:middle line:84%
to provide us with
a reverse shell.

00:04:27.780 --> 00:04:30.900 align:middle line:84%
So the exploit isn't what
gives us a reverse shell.

00:04:30.900 --> 00:04:33.450 align:middle line:84%
The payload is what
gives us a reverse shell

00:04:33.450 --> 00:04:35.170 align:middle line:90%
or additional functionality.

00:04:35.170 --> 00:04:37.590 align:middle line:84%
So as I said here, an
example of the payload

00:04:37.590 --> 00:04:39.720 align:middle line:84%
is a reverse shell
that initiates

00:04:39.720 --> 00:04:42.610 align:middle line:84%
a connection from the target
system back to the attacker.

00:04:42.610 --> 00:04:43.110 align:middle line:90%
All right?

00:04:43.110 --> 00:04:44.910 align:middle line:90%
So I hope that makes sense.

00:04:44.910 --> 00:04:46.080 align:middle line:90%
What's an encoder?

00:04:46.080 --> 00:04:49.890 align:middle line:84%
An encoder is really
essentially used

00:04:49.890 --> 00:04:54.540 align:middle line:84%
to encode payloads in order
to avoid antivirus detection.

00:04:54.540 --> 00:04:57.120 align:middle line:84%
So given the fact that
the payloads contain

00:04:57.120 --> 00:05:00.240 align:middle line:84%
the malicious code that
is executed on the target,

00:05:00.240 --> 00:05:04.030 align:middle line:84%
we will need to have various
ways of various tools

00:05:04.030 --> 00:05:06.610 align:middle line:84%
that we can use to encode
these payloads in order

00:05:06.610 --> 00:05:09.790 align:middle line:84%
to avoid antivirus detection
on the target site.

00:05:09.790 --> 00:05:13.090 align:middle line:84%
Because, for example, Windows
targets will typically have

00:05:13.090 --> 00:05:14.740 align:middle line:90%
Windows Defender installed.

00:05:14.740 --> 00:05:17.830 align:middle line:84%
And as a result, if we
don't encode a payload,

00:05:17.830 --> 00:05:21.540 align:middle line:84%
it may be detected, and we will
not get our reverse connection

00:05:21.540 --> 00:05:22.040 align:middle line:90%
back.

00:05:22.040 --> 00:05:24.760 align:middle line:84%
So we need to find
various tools or we

00:05:24.760 --> 00:05:27.730 align:middle line:84%
need to utilize various
encoders to help

00:05:27.730 --> 00:05:29.680 align:middle line:90%
us avoid antivirus detection.

00:05:29.680 --> 00:05:32.950 align:middle line:84%
An example of this is the
shikata_ga_nai encoder

00:05:32.950 --> 00:05:35.500 align:middle line:84%
that is used to encode
Windows payloads.

00:05:35.500 --> 00:05:37.720 align:middle line:84%
We will be covering
payload generation

00:05:37.720 --> 00:05:39.910 align:middle line:90%
and encoding as we progress.

00:05:39.910 --> 00:05:42.130 align:middle line:84%
For now, that's really
all you need to know.

00:05:42.130 --> 00:05:43.480 align:middle line:90%
What are NOPS?

00:05:43.480 --> 00:05:45.850 align:middle line:84%
NOPS are essentially
used to ensure

00:05:45.850 --> 00:05:49.030 align:middle line:84%
that payload sizes are
consistent and are also

00:05:49.030 --> 00:05:52.600 align:middle line:84%
used to ensure the stability
of a payload when executed.

00:05:52.600 --> 00:05:56.230 align:middle line:84%
So you really don't need to read
too much into what NOPS are.

00:05:56.230 --> 00:05:58.270 align:middle line:84%
Again, as I said,
their main purpose

00:05:58.270 --> 00:06:00.760 align:middle line:84%
is to ensure that payload
sizes are consistent

00:06:00.760 --> 00:06:05.260 align:middle line:84%
and ensure that the
target system is stable

00:06:05.260 --> 00:06:09.640 align:middle line:84%
when the payload is executed
in order to prevent the target

00:06:09.640 --> 00:06:10.880 align:middle line:90%
system from crashing.

00:06:10.880 --> 00:06:16.900 align:middle line:84%
So the NOPS are there to
ensure that the payloads are

00:06:16.900 --> 00:06:20.020 align:middle line:84%
stable when they're
executed in order to avoid

00:06:20.020 --> 00:06:24.100 align:middle line:84%
any potential crashes on
the target side of things.

00:06:24.100 --> 00:06:26.320 align:middle line:90%
Now, what's an auxiliary module?

00:06:26.320 --> 00:06:28.750 align:middle line:84%
An auxiliary module
is a module that's

00:06:28.750 --> 00:06:32.200 align:middle line:84%
used to perform additional
functionality, like port

00:06:32.200 --> 00:06:33.790 align:middle line:90%
scanning and enumeration.

00:06:33.790 --> 00:06:37.150 align:middle line:84%
So an auxiliary module is
essentially any module that

00:06:37.150 --> 00:06:39.910 align:middle line:84%
isn't or cannot be
paired with a payload.

00:06:39.910 --> 00:06:42.010 align:middle line:84%
That's the quickest
and simplest way

00:06:42.010 --> 00:06:45.640 align:middle line:84%
of understanding the distinction
between an exploit payload

00:06:45.640 --> 00:06:47.260 align:middle line:90%
and an auxiliary module--

00:06:47.260 --> 00:06:50.110 align:middle line:84%
or rather, an exploit module
and an auxiliary module.

00:06:50.110 --> 00:06:52.750 align:middle line:84%
So an example of
an auxiliary module

00:06:52.750 --> 00:06:56.860 align:middle line:84%
is a portscanner module
or an enumeration module,

00:06:56.860 --> 00:06:58.100 align:middle line:90%
so on and so forth.

00:06:58.100 --> 00:07:00.490 align:middle line:84%
And we will be
exploring them in depth

00:07:00.490 --> 00:07:03.550 align:middle line:84%
as we progress into the
information-gathering phase

00:07:03.550 --> 00:07:05.090 align:middle line:90%
of this course.

00:07:05.090 --> 00:07:07.480 align:middle line:84%
Now that we have an
understanding of the Metasploit

00:07:07.480 --> 00:07:09.610 align:middle line:90%
modules, let's explore payloads.

00:07:09.610 --> 00:07:12.490 align:middle line:84%
Because as you can already
tell, they're quite important.

00:07:12.490 --> 00:07:15.926 align:middle line:84%
Because they are
responsible for giving us

00:07:15.926 --> 00:07:18.250 align:middle line:84%
either remote
access to the target

00:07:18.250 --> 00:07:20.560 align:middle line:84%
or essentially
allowing us to execute

00:07:20.560 --> 00:07:24.260 align:middle line:84%
commands on a target
system after exploitation.

00:07:24.260 --> 00:07:26.320 align:middle line:84%
So the Metasploit
Framework will provide you

00:07:26.320 --> 00:07:28.720 align:middle line:84%
with two types of
payloads that can be

00:07:28.720 --> 00:07:30.340 align:middle line:90%
paired with an exploit module.

00:07:30.340 --> 00:07:33.640 align:middle line:84%
One of them is called
a non-staged payload.

00:07:33.640 --> 00:07:36.470 align:middle line:84%
The second one is
called a staged payload.

00:07:36.470 --> 00:07:38.710 align:middle line:84%
Now, the type of
payload that you'll use

00:07:38.710 --> 00:07:42.460 align:middle line:84%
will depend on the target system
and the target infrastructure

00:07:42.460 --> 00:07:44.390 align:middle line:90%
as well as your requirements.

00:07:44.390 --> 00:07:46.600 align:middle line:84%
And as I said, we
will be exploring

00:07:46.600 --> 00:07:49.030 align:middle line:84%
where and when you
should be utilizing

00:07:49.030 --> 00:07:50.960 align:middle line:90%
each of these payload types.

00:07:50.960 --> 00:07:53.710 align:middle line:84%
So starting off with
a non-staged payload,

00:07:53.710 --> 00:07:55.810 align:middle line:84%
a non-staged
payload is a payload

00:07:55.810 --> 00:07:57.310 align:middle line:84%
that is sent to
the target system

00:07:57.310 --> 00:08:00.970 align:middle line:84%
as a whole along
with the exploit.

00:08:00.970 --> 00:08:03.280 align:middle line:84%
This will make sense
in a few seconds.

00:08:03.280 --> 00:08:04.750 align:middle line:90%
What is staged payload?

00:08:04.750 --> 00:08:07.030 align:middle line:84%
A staged payload
is a payload that

00:08:07.030 --> 00:08:09.580 align:middle line:84%
is sent to the target
system in two parts.

00:08:09.580 --> 00:08:10.150 align:middle line:90%
Aha.

00:08:10.150 --> 00:08:12.470 align:middle line:84%
So this is where the
difference comes into play.

00:08:12.470 --> 00:08:15.190 align:middle line:84%
Now, as I said, don't worry
about why we're splitting

00:08:15.190 --> 00:08:18.040 align:middle line:90%
the payload into two parts.

00:08:18.040 --> 00:08:20.680 align:middle line:84%
All you need to know
now is the distinction.

00:08:20.680 --> 00:08:23.800 align:middle line:84%
So when we're talking
about a staged payload,

00:08:23.800 --> 00:08:26.590 align:middle line:84%
the first part,
known as the stager,

00:08:26.590 --> 00:08:28.870 align:middle line:84%
contains the
payload that is used

00:08:28.870 --> 00:08:31.000 align:middle line:84%
to establish a reverse
connection back

00:08:31.000 --> 00:08:31.940 align:middle line:90%
to the attacker.

00:08:31.940 --> 00:08:34.690 align:middle line:84%
So when we're utilizing
a staged payload,

00:08:34.690 --> 00:08:36.070 align:middle line:90%
the first part is sent.

00:08:36.070 --> 00:08:38.200 align:middle line:84%
The first part,
known as the stager,

00:08:38.200 --> 00:08:41.860 align:middle line:84%
is responsible for initiating
a reverse connection back

00:08:41.860 --> 00:08:42.850 align:middle line:90%
to the attacker.

00:08:42.850 --> 00:08:45.280 align:middle line:84%
And then it downloads
the second part

00:08:45.280 --> 00:08:49.090 align:middle line:84%
of the payload, which is known
as the stage, and executes it.

00:08:49.090 --> 00:08:52.600 align:middle line:84%
Now, the stage is responsible
for either executing

00:08:52.600 --> 00:08:54.790 align:middle line:84%
arbitrary commands
on the target system

00:08:54.790 --> 00:08:58.150 align:middle line:84%
or for providing us, for
example, with a reverse shell

00:08:58.150 --> 00:09:00.020 align:middle line:90%
or a Meterpreter session.

00:09:00.020 --> 00:09:03.640 align:middle line:84%
So let's take a look
at stagers and stages.

00:09:03.640 --> 00:09:07.570 align:middle line:84%
So, as I said, the
stager are typically

00:09:07.570 --> 00:09:09.760 align:middle line:84%
used to establish a
stable communication

00:09:09.760 --> 00:09:11.890 align:middle line:84%
channel between the
attack and the target,

00:09:11.890 --> 00:09:15.430 align:middle line:84%
after which the stage payload
is downloaded and then executed

00:09:15.430 --> 00:09:16.690 align:middle line:90%
on the target system.

00:09:16.690 --> 00:09:20.980 align:middle line:84%
The stage payload is essentially
responsible for providing us

00:09:20.980 --> 00:09:23.330 align:middle line:84%
with a reverse shell or
a Meterpreter session.

00:09:23.330 --> 00:09:25.930 align:middle line:90%
So that's the second part.

00:09:25.930 --> 00:09:30.850 align:middle line:84%
The stager is the first part and
the stage is the second part.

00:09:30.850 --> 00:09:33.010 align:middle line:90%
So that's the difference there.

00:09:33.010 --> 00:09:35.110 align:middle line:84%
As I said, don't
worry if this sounds

00:09:35.110 --> 00:09:36.790 align:middle line:90%
a little bit intimidating.

00:09:36.790 --> 00:09:39.810 align:middle line:90%
It'll make sense as we progress.

00:09:39.810 --> 00:09:41.830 align:middle line:84%
Let's talk about the
Meterpreter payload,

00:09:41.830 --> 00:09:44.790 align:middle line:84%
which is arguably one of
the most popular Metasploit

00:09:44.790 --> 00:09:45.990 align:middle line:90%
Framework payloads.

00:09:45.990 --> 00:09:48.720 align:middle line:84%
So the Meterpreter
payload and Meterpreter

00:09:48.720 --> 00:09:51.660 align:middle line:84%
comes from the word
meta-interpreter,

00:09:51.660 --> 00:09:54.180 align:middle line:84%
is an advanced
multi-functional payload

00:09:54.180 --> 00:09:57.580 align:middle line:84%
that is executed in memory
on the target system,

00:09:57.580 --> 00:10:00.670 align:middle line:84%
therefore making it difficult
to detect on the target system.

00:10:00.670 --> 00:10:03.330 align:middle line:84%
So, again, this
payload really isn't

00:10:03.330 --> 00:10:07.590 align:middle line:84%
downloaded to the target system
or is not executed on disk.

00:10:07.590 --> 00:10:09.390 align:middle line:90%
It is executed in memory.

00:10:09.390 --> 00:10:12.000 align:middle line:84%
And as a result, no
traces of the payload

00:10:12.000 --> 00:10:15.660 align:middle line:84%
are left or are found on the
target system, which, again,

00:10:15.660 --> 00:10:17.730 align:middle line:90%
is great in avoiding detection.

00:10:17.730 --> 00:10:19.740 align:middle line:84%
And in regards to
its functionality,

00:10:19.740 --> 00:10:22.290 align:middle line:84%
it communicates
over a stager socket

00:10:22.290 --> 00:10:25.950 align:middle line:84%
and provides an attacker with an
interactive command interpreter

00:10:25.950 --> 00:10:28.410 align:middle line:84%
on the target system
that facilitates

00:10:28.410 --> 00:10:30.090 align:middle line:84%
the execution of
system commands,

00:10:30.090 --> 00:10:32.790 align:middle line:84%
file system navigation,
keylogging, et cetera.

00:10:32.790 --> 00:10:35.370 align:middle line:84%
So it essentially
provides an attacker

00:10:35.370 --> 00:10:38.970 align:middle line:84%
with a really
interactive reverse shell

00:10:38.970 --> 00:10:40.140 align:middle line:90%
on the target system.

00:10:40.140 --> 00:10:43.140 align:middle line:84%
The attacker can then use
the Meterpreter session

00:10:43.140 --> 00:10:46.080 align:middle line:84%
to navigate the file
system, download or upload

00:10:46.080 --> 00:10:49.830 align:middle line:84%
files from the target,
execute arbitrary commands

00:10:49.830 --> 00:10:53.220 align:middle line:84%
on the target, as I said,
navigate the file system,

00:10:53.220 --> 00:10:55.890 align:middle line:84%
perform post-exploitation
techniques,

00:10:55.890 --> 00:10:59.510 align:middle line:84%
perform privilege
escalation, extract hashes,

00:10:59.510 --> 00:11:00.750 align:middle line:90%
et cetera, et cetera.

00:11:00.750 --> 00:11:04.680 align:middle line:84%
And we will be covering the
Meterpreter payload in depth

00:11:04.680 --> 00:11:08.010 align:middle line:84%
once we reach the exploitation
and post-exploitation phase

00:11:08.010 --> 00:11:10.090 align:middle line:90%
of this course.

00:11:10.090 --> 00:11:12.300 align:middle line:84%
Now let's talk about the
Metasploit Framework file

00:11:12.300 --> 00:11:14.040 align:middle line:90%
system structure.

00:11:14.040 --> 00:11:16.050 align:middle line:84%
So the Metasploit
Framework file system

00:11:16.050 --> 00:11:19.440 align:middle line:84%
is organized in a simple and
easy-to-understand format

00:11:19.440 --> 00:11:22.920 align:middle line:84%
and is organized or categorized
into various directories.

00:11:22.920 --> 00:11:28.080 align:middle line:84%
So we can access the Metasploit
Framework file system on Linux

00:11:28.080 --> 00:11:31.260 align:middle line:84%
by navigating to the
usershare Metasploit Framework

00:11:31.260 --> 00:11:33.930 align:middle line:84%
directory, after which
you'll be able to view

00:11:33.930 --> 00:11:36.390 align:middle line:84%
all the various folders
and files under it.

00:11:36.390 --> 00:11:38.760 align:middle line:84%
And I'll be explaining
all of these directories

00:11:38.760 --> 00:11:39.900 align:middle line:90%
in a few seconds.

00:11:39.900 --> 00:11:42.780 align:middle line:84%
So that's essentially
how it's sorted.

00:11:42.780 --> 00:11:45.060 align:middle line:84%
When we talk about the
Metasploit Framework module

00:11:45.060 --> 00:11:48.645 align:middle line:84%
locations, Metasploit
Framework stores modules under

00:11:48.645 --> 00:11:50.520 align:middle line:84%
the following directory,
so it's stored under

00:11:50.520 --> 00:11:54.120 align:middle line:84%
the /usr/share/metasploit
framework/modules directory,

00:11:54.120 --> 00:11:56.170 align:middle line:84%
and we'll get to
this in a second.

00:11:56.170 --> 00:11:59.010 align:middle line:84%
And user-specified
or custom modules

00:11:59.010 --> 00:12:01.590 align:middle line:84%
can be stored under the
following directory.

00:12:01.590 --> 00:12:04.950 align:middle line:84%
So it can be stored under your
current user's home directory

00:12:04.950 --> 00:12:08.460 align:middle line:84%
under the dot ms4
folder under modules.

00:12:08.460 --> 00:12:11.640 align:middle line:84%
So now that we have an
understanding of how everything

00:12:11.640 --> 00:12:15.570 align:middle line:84%
works, the various elements
that make up the framework, how

00:12:15.570 --> 00:12:17.880 align:middle line:84%
modules work, where
they're stored.

00:12:17.880 --> 00:12:21.420 align:middle line:84%
Let's take a demo
and actually explore

00:12:21.420 --> 00:12:23.910 align:middle line:84%
the file system in depth
and get an understanding

00:12:23.910 --> 00:12:27.050 align:middle line:90%
of how everything is stored.

00:12:27.050 --> 00:12:29.930 align:middle line:84%
All right, so I'm currently
on my Kali Linux VM.

00:12:29.930 --> 00:12:32.720 align:middle line:84%
And I'm just going to
take you through where

00:12:32.720 --> 00:12:34.290 align:middle line:90%
everything is stored.

00:12:34.290 --> 00:12:38.690 align:middle line:84%
So by default, Kali Linux
has the Metasploit Framework

00:12:38.690 --> 00:12:39.470 align:middle line:90%
pre-installed.

00:12:39.470 --> 00:12:40.970 align:middle line:84%
So I don't need to
install it, but I

00:12:40.970 --> 00:12:42.590 align:middle line:90%
will be covering that process.

00:12:42.590 --> 00:12:47.000 align:middle line:84%
We can navigate to the default
storage directory where

00:12:47.000 --> 00:12:50.480 align:middle line:84%
the Metasploit Framework
is stored by navigating

00:12:50.480 --> 00:12:52.670 align:middle line:84%
to the
/usr/share/metasploit-framework

00:12:52.670 --> 00:12:56.700 align:middle line:84%
directory, which you can also
do via your file browser.

00:12:56.700 --> 00:13:00.230 align:middle line:84%
So if I use my file
browser here and I

00:13:00.230 --> 00:13:02.960 align:middle line:84%
navigate to the file
system, I can head over

00:13:02.960 --> 00:13:04.640 align:middle line:90%
to the user folder.

00:13:04.640 --> 00:13:08.010 align:middle line:84%
And under that, I'll go
under the share directory.

00:13:08.010 --> 00:13:10.810 align:middle line:84%
And then I can search for the
Metasploit Framework folder

00:13:10.810 --> 00:13:11.310 align:middle line:90%
here.

00:13:11.310 --> 00:13:13.790 align:middle line:90%
So I can say Metasploit.

00:13:13.790 --> 00:13:16.730 align:middle line:84%
And there we are, there's the
Metasploit Framework directory.

00:13:16.730 --> 00:13:19.760 align:middle line:84%
And voila, this is where
the Metasploit framework

00:13:19.760 --> 00:13:21.360 align:middle line:90%
is stored on Linux.

00:13:21.360 --> 00:13:24.710 align:middle line:84%
And as you can see, we have
quite a few directories.

00:13:24.710 --> 00:13:28.310 align:middle line:84%
But we are primarily interested
in the modules folder

00:13:28.310 --> 00:13:29.670 align:middle line:90%
right over here.

00:13:29.670 --> 00:13:32.310 align:middle line:84%
So if we double-click
on the modules folder,

00:13:32.310 --> 00:13:36.950 align:middle line:84%
you can see that we have
all the various that I

00:13:36.950 --> 00:13:38.330 align:middle line:90%
covered within the slides.

00:13:38.330 --> 00:13:41.030 align:middle line:84%
We have auxiliary
modules, we have encoders,

00:13:41.030 --> 00:13:43.970 align:middle line:84%
we have exploits, we have
NOPS, we have payloads,

00:13:43.970 --> 00:13:46.640 align:middle line:84%
and we have the
post-exploitation modules,

00:13:46.640 --> 00:13:48.680 align:middle line:84%
which, again, we will
cover when we actually

00:13:48.680 --> 00:13:50.840 align:middle line:90%
get to post-exploitation.

00:13:50.840 --> 00:13:53.690 align:middle line:84%
So if we take a look
at auxiliary modules,

00:13:53.690 --> 00:13:56.180 align:middle line:84%
you can see that
they're furthermore

00:13:56.180 --> 00:13:59.030 align:middle line:84%
sorted into their
own subcategories

00:13:59.030 --> 00:14:03.060 align:middle line:84%
based on the type of tasks or
functionality that they offer.

00:14:03.060 --> 00:14:05.660 align:middle line:84%
So, for example, if
we are performing

00:14:05.660 --> 00:14:08.570 align:middle line:84%
information gathering,
then we would typically

00:14:08.570 --> 00:14:10.430 align:middle line:90%
look under scanners.

00:14:10.430 --> 00:14:14.390 align:middle line:84%
And under scanner, again, it's
sorted into various folders

00:14:14.390 --> 00:14:18.150 align:middle line:84%
based on the type of
scanning we are performing.

00:14:18.150 --> 00:14:21.530 align:middle line:84%
So, for example, if I want
to perform FTP scanning,

00:14:21.530 --> 00:14:23.780 align:middle line:84%
these are the various
Metasploit modules

00:14:23.780 --> 00:14:27.470 align:middle line:90%
associated with FTP scanning.

00:14:27.470 --> 00:14:29.120 align:middle line:84%
If I want to perform
some discovery,

00:14:29.120 --> 00:14:31.400 align:middle line:90%
I can click on discovery there.

00:14:31.400 --> 00:14:33.710 align:middle line:84%
The discovery auxiliary
modules are used

00:14:33.710 --> 00:14:35.580 align:middle line:90%
to discover hosts on a network.

00:14:35.580 --> 00:14:40.490 align:middle line:84%
So, for example, we have ARP or
arp_sweep, the arp_sweep module

00:14:40.490 --> 00:14:42.270 align:middle line:90%
as well as a few others here.

00:14:42.270 --> 00:14:43.790 align:middle line:84%
So let's take a
look at a few others

00:14:43.790 --> 00:14:46.190 align:middle line:84%
in order to get a full view
or understanding of what's

00:14:46.190 --> 00:14:47.100 align:middle line:90%
going on.

00:14:47.100 --> 00:14:50.240 align:middle line:84%
So let's say I want to
perform some SMB enumeration.

00:14:50.240 --> 00:14:52.640 align:middle line:84%
I can take a look at
the SMB folder here.

00:14:52.640 --> 00:14:57.920 align:middle line:84%
And you can see these are the
various SMB auxiliary modules

00:14:57.920 --> 00:15:00.380 align:middle line:84%
that allow us to
enumerate information

00:15:00.380 --> 00:15:02.270 align:middle line:90%
from SMB on a target.

00:15:02.270 --> 00:15:04.520 align:middle line:84%
Now, as I said, this
is not how we will

00:15:04.520 --> 00:15:06.690 align:middle line:90%
be utilizing these modules.

00:15:06.690 --> 00:15:09.170 align:middle line:84%
We will be able to load these
modules with the Metasploit

00:15:09.170 --> 00:15:10.070 align:middle line:90%
Framework console.

00:15:10.070 --> 00:15:13.230 align:middle line:84%
But for now, I'm just
covering the structure.

00:15:13.230 --> 00:15:16.550 align:middle line:84%
So if I navigate back
to the modules here,

00:15:16.550 --> 00:15:18.740 align:middle line:90%
we can take a look at exploits.

00:15:18.740 --> 00:15:22.880 align:middle line:84%
So exploit modules are sorted
based on the target operating

00:15:22.880 --> 00:15:26.600 align:middle line:84%
system or the target
software, either a browser

00:15:26.600 --> 00:15:30.020 align:middle line:90%
or the mobile operating systems.

00:15:30.020 --> 00:15:32.900 align:middle line:84%
As you can see, we have
Android, Apple iOS.

00:15:32.900 --> 00:15:36.290 align:middle line:84%
As for the operating systems,
we have Linux, Solaris, Unix,

00:15:36.290 --> 00:15:37.190 align:middle line:90%
Windows.

00:15:37.190 --> 00:15:41.360 align:middle line:84%
We also have MacOS as well
as OpenBSD and FreeBSD.

00:15:41.360 --> 00:15:44.300 align:middle line:84%
So, again, this
categorization is fantastic

00:15:44.300 --> 00:15:46.460 align:middle line:84%
because it allows
us to, again, find

00:15:46.460 --> 00:15:48.150 align:middle line:90%
exactly what we're looking for.

00:15:48.150 --> 00:15:51.770 align:middle line:84%
So if I'm looking for a Linux
exploit, I can click on linux.

00:15:51.770 --> 00:15:55.730 align:middle line:84%
And then it is further
sorted based on the service

00:15:55.730 --> 00:15:57.030 align:middle line:90%
or the type of exploit.

00:15:57.030 --> 00:16:00.560 align:middle line:84%
So if I'm targeting
MySQL on a Linux target,

00:16:00.560 --> 00:16:02.870 align:middle line:84%
I can click on the
mysql directory here.

00:16:02.870 --> 00:16:05.300 align:middle line:84%
And these are the
two exploit modules

00:16:05.300 --> 00:16:08.420 align:middle line:90%
available for MySQL on Linux.

00:16:08.420 --> 00:16:14.090 align:middle line:84%
If I'm targeting FTP, these
are the various FTP exploits

00:16:14.090 --> 00:16:14.670 align:middle line:90%
for Linux.

00:16:14.670 --> 00:16:17.570 align:middle line:90%
So we have proftp, et cetera.

00:16:17.570 --> 00:16:21.200 align:middle line:84%
Now if we take a look at
Windows, for example--

00:16:21.200 --> 00:16:22.670 align:middle line:90%
let's just explore that here.

00:16:22.670 --> 00:16:25.070 align:middle line:84%
And I'll get to the
multi folder in a second.

00:16:25.070 --> 00:16:27.710 align:middle line:84%
But the windows folder
contains, again,

00:16:27.710 --> 00:16:31.160 align:middle line:84%
exploit modules that are
designed for the Windows

00:16:31.160 --> 00:16:32.330 align:middle line:90%
operating system.

00:16:32.330 --> 00:16:34.400 align:middle line:84%
And again, it is
further categorized

00:16:34.400 --> 00:16:38.270 align:middle line:84%
into the services or the
applications or programs that

00:16:38.270 --> 00:16:40.100 align:middle line:90%
are associated with Windows.

00:16:40.100 --> 00:16:43.820 align:middle line:84%
So, for example, we have
typical pieces of software,

00:16:43.820 --> 00:16:46.440 align:middle line:90%
like the browser, email.

00:16:46.440 --> 00:16:50.150 align:middle line:84%
We also have the network
filesharing system here.

00:16:50.150 --> 00:16:55.350 align:middle line:84%
MS SQL, these are the various MS
SQL exploit modules available.

00:16:55.350 --> 00:16:56.910 align:middle line:90%
And you get the idea.

00:16:56.910 --> 00:16:59.750 align:middle line:84%
So all of this will,
again, make sense

00:16:59.750 --> 00:17:03.020 align:middle line:84%
once we actually begin
interacting with the Metasploit

00:17:03.020 --> 00:17:04.970 align:middle line:90%
Framework console.

00:17:04.970 --> 00:17:08.869 align:middle line:84%
And, again, you can also explore
the NOPS modules as well as

00:17:08.869 --> 00:17:11.180 align:middle line:84%
the encoders here,
which allow you

00:17:11.180 --> 00:17:15.270 align:middle line:84%
to encode payloads for
different operating systems.

00:17:15.270 --> 00:17:19.220 align:middle line:84%
And in this case, you can see
we have the operating systems

00:17:19.220 --> 00:17:20.880 align:middle line:90%
architecture specified here.

00:17:20.880 --> 00:17:24.020 align:middle line:84%
So if we're looking
for 32-bit encoders,

00:17:24.020 --> 00:17:26.119 align:middle line:84%
these are the encoders
we can use here.

00:17:26.119 --> 00:17:27.070 align:middle line:90%
And there we are.

00:17:27.070 --> 00:17:28.820 align:middle line:84%
We have the
shikata_ga_nai encoders

00:17:28.820 --> 00:17:33.050 align:middle line:84%
that's utilized or used to
encode Windows payloads.

00:17:33.050 --> 00:17:35.990 align:middle line:84%
So that is essentially
the structure

00:17:35.990 --> 00:17:38.900 align:middle line:84%
or the file system structure
for the Metasploit Framework.

00:17:38.900 --> 00:17:42.140 align:middle line:84%
And that's where you can find
all the Metasploit Framework

00:17:42.140 --> 00:17:42.980 align:middle line:90%
modules.

00:17:42.980 --> 00:17:46.160 align:middle line:84%
Now, if you want to load
your own custom modules,

00:17:46.160 --> 00:17:50.180 align:middle line:84%
you can do that by navigating
to your home directory.

00:17:50.180 --> 00:17:52.130 align:middle line:90%
In my case, it's the Kali user.

00:17:52.130 --> 00:17:56.310 align:middle line:84%
I can then navigate
into the dot ms4 folder.

00:17:56.310 --> 00:17:58.160 align:middle line:84%
So I'll just show the
hidden files here.

00:17:58.160 --> 00:18:00.860 align:middle line:84%
And you can see it right
over here, dot ms4.

00:18:00.860 --> 00:18:04.340 align:middle line:84%
And within this, I have my
own custom modules directory

00:18:04.340 --> 00:18:07.910 align:middle line:84%
where I can add my own custom
Metasploit Framework modules.

00:18:07.910 --> 00:18:11.480 align:middle line:84%
And I can, again, sort them
based on operating system

00:18:11.480 --> 00:18:13.590 align:middle line:90%
or program or service.

00:18:13.590 --> 00:18:16.340 align:middle line:84%
So that is how the
Metasploit Framework

00:18:16.340 --> 00:18:20.120 align:middle line:90%
is organized and structured.

00:18:20.120 --> 00:18:21.920 align:middle line:84%
So now that we've
explored that-- again,

00:18:21.920 --> 00:18:24.510 align:middle line:84%
you can go through this
with the terminal as well.

00:18:24.510 --> 00:18:27.050 align:middle line:84%
So, again, if I navigate
to the modules directory

00:18:27.050 --> 00:18:30.920 align:middle line:84%
here under the Metasploit
Framework directory here

00:18:30.920 --> 00:18:33.890 align:middle line:84%
and I list it out, you can
see we have the same content.

00:18:33.890 --> 00:18:36.800 align:middle line:84%
And, again, you can go through
it with your terminal as well

00:18:36.800 --> 00:18:38.300 align:middle line:90%
as your file manager.

00:18:38.300 --> 00:18:40.760 align:middle line:84%
So that should give you
a good understanding

00:18:40.760 --> 00:18:43.880 align:middle line:84%
of where everything is
stored and where specifically

00:18:43.880 --> 00:18:45.950 align:middle line:84%
the modules are stored
and how everything

00:18:45.950 --> 00:18:48.150 align:middle line:90%
is structured and organized.

00:18:48.150 --> 00:18:50.480 align:middle line:84%
And, again, that
will come in handy

00:18:50.480 --> 00:18:54.260 align:middle line:84%
when we'll be searching for
specific modules, specifically

00:18:54.260 --> 00:18:58.100 align:middle line:84%
the auxiliary modules
and the exploit modules.

00:18:58.100 --> 00:19:00.800 align:middle line:84%
And we'll take a look at
how this categorization is

00:19:00.800 --> 00:19:03.080 align:middle line:84%
extremely helpful
when we'll be looking

00:19:03.080 --> 00:19:06.410 align:middle line:84%
for exploit modules
for Linux or Windows.

00:19:06.410 --> 00:19:11.660 align:middle line:84%
That being said, I'm going to
switch over to my slides now.

00:19:11.660 --> 00:19:15.950 align:middle line:84%
Now that we have an idea of
how the Metasploit Framework is

00:19:15.950 --> 00:19:19.160 align:middle line:84%
sorted, organized, and the
various elements that make up

00:19:19.160 --> 00:19:22.490 align:middle line:84%
the framework as well as the
different types of modules,

00:19:22.490 --> 00:19:24.630 align:middle line:84%
how they work, and
how they can be used,

00:19:24.630 --> 00:19:27.290 align:middle line:84%
we can move on to
the next step, which

00:19:27.290 --> 00:19:30.080 align:middle line:84%
is to take a look at how we
can utilize the Metasploit

00:19:30.080 --> 00:19:32.630 align:middle line:84%
Framework for
penetration testing.

00:19:32.630 --> 00:19:36.190 align:middle line:84%
So I'll see you
in the next video.