WEBVTT

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


00:00:03.374 --> 00:00:04.820 align:middle line:90%
[ELECTRONIC NOISES]

00:00:04.820 --> 00:00:10.140 align:middle line:90%


00:00:10.140 --> 00:00:12.960 align:middle line:84%
Port scanning with
auxiliary modules--

00:00:12.960 --> 00:00:14.520 align:middle line:84%
now that we've
taken a look at how

00:00:14.520 --> 00:00:18.060 align:middle line:84%
to utilize Nmap to perform
port scanning and enumeration

00:00:18.060 --> 00:00:21.510 align:middle line:84%
and how to import the Nmap scan
results into the Metasploit

00:00:21.510 --> 00:00:23.550 align:middle line:84%
framework, we can
begin exploring

00:00:23.550 --> 00:00:26.580 align:middle line:84%
the process of performing port
scanning with the Metasploit

00:00:26.580 --> 00:00:29.010 align:middle line:90%
framework auxiliary modules.

00:00:29.010 --> 00:00:32.130 align:middle line:84%
So, again, within this section,
the information gathering

00:00:32.130 --> 00:00:34.560 align:middle line:84%
and enumeration
section, we've already

00:00:34.560 --> 00:00:35.670 align:middle line:90%
covered how to use Nmap.

00:00:35.670 --> 00:00:37.710 align:middle line:84%
We're now moving to
auxiliary modules.

00:00:37.710 --> 00:00:39.370 align:middle line:84%
And then in the
next set of videos,

00:00:39.370 --> 00:00:42.240 align:middle line:84%
we'll be taking a look at how
to use these auxiliary modules

00:00:42.240 --> 00:00:43.620 align:middle line:90%
for enumeration.

00:00:43.620 --> 00:00:46.050 align:middle line:84%
So for now, we are
focused on port scanning.

00:00:46.050 --> 00:00:49.830 align:middle line:84%
So first and foremost, what
is an auxiliary module?

00:00:49.830 --> 00:00:52.020 align:middle line:84%
Well, an auxiliary
module is essentially

00:00:52.020 --> 00:00:54.960 align:middle line:84%
used to perform functionality
like scanning, network

00:00:54.960 --> 00:00:58.110 align:middle line:84%
discovery, or host
discovery on a network,

00:00:58.110 --> 00:00:59.800 align:middle line:90%
fuzzing, so on and so forth.

00:00:59.800 --> 00:01:03.270 align:middle line:84%
So it's really used for
activity or functionality

00:01:03.270 --> 00:01:05.970 align:middle line:84%
that doesn't involve
the exploitation

00:01:05.970 --> 00:01:07.230 align:middle line:90%
of a vulnerability.

00:01:07.230 --> 00:01:09.840 align:middle line:84%
And another key distinguishing
factor that I've mentioned

00:01:09.840 --> 00:01:13.680 align:middle line:84%
before is that auxiliary modules
cannot be paired with payloads.

00:01:13.680 --> 00:01:15.720 align:middle line:84%
Again, auxiliary
modules have nothing

00:01:15.720 --> 00:01:17.070 align:middle line:90%
to do with exploitation.

00:01:17.070 --> 00:01:21.000 align:middle line:84%
They just allow us to extract
information from a target

00:01:21.000 --> 00:01:22.780 align:middle line:90%
or from a target service.

00:01:22.780 --> 00:01:24.840 align:middle line:84%
So that's what an
auxiliary module is.

00:01:24.840 --> 00:01:26.850 align:middle line:84%
Now, we can use
auxiliary modules

00:01:26.850 --> 00:01:31.410 align:middle line:84%
to perform both TCP and UDP port
scanning as well as enumerating

00:01:31.410 --> 00:01:35.230 align:middle line:84%
information from services
like FTP, SSH, SMB,

00:01:35.230 --> 00:01:36.730 align:middle line:90%
and so on and so forth.

00:01:36.730 --> 00:01:38.950 align:middle line:84%
And, again, we're going to
be covering all of this.

00:01:38.950 --> 00:01:41.130 align:middle line:84%
So they're extremely
powerful in regards

00:01:41.130 --> 00:01:45.420 align:middle line:84%
to the information gathering
phase of a penetration test.

00:01:45.420 --> 00:01:46.800 align:middle line:84%
Now, you might be
asking yourself

00:01:46.800 --> 00:01:48.180 align:middle line:90%
a very good question here.

00:01:48.180 --> 00:01:51.750 align:middle line:84%
And that is, if we have
already obtained or performed

00:01:51.750 --> 00:01:54.690 align:middle line:84%
port scanning with Nmap
and we can import the Nmap

00:01:54.690 --> 00:01:56.610 align:middle line:84%
results into the
Metasploit framework,

00:01:56.610 --> 00:01:59.310 align:middle line:84%
why do we need to
use or why would we

00:01:59.310 --> 00:02:01.830 align:middle line:84%
need to use the auxiliary
modules to perform

00:02:01.830 --> 00:02:02.760 align:middle line:90%
port scanning?

00:02:02.760 --> 00:02:05.190 align:middle line:84%
And the answer to
that is fairly simple.

00:02:05.190 --> 00:02:09.479 align:middle line:84%
Now, of course, in terms of
the initial penetration testing

00:02:09.479 --> 00:02:11.940 align:middle line:84%
stage that involves
information gathering,

00:02:11.940 --> 00:02:15.060 align:middle line:84%
the auxiliary modules will
work very similar to Nmap

00:02:15.060 --> 00:02:18.000 align:middle line:84%
and will, again, allow
you to identify what ports

00:02:18.000 --> 00:02:19.660 align:middle line:90%
are open on a target system.

00:02:19.660 --> 00:02:22.410 align:middle line:84%
And as I said, we can pretty
much do that with Nmap.

00:02:22.410 --> 00:02:25.770 align:middle line:84%
However, where these modules
really start to shine

00:02:25.770 --> 00:02:29.590 align:middle line:84%
is during the post-exploitation
phase of the penetration test.

00:02:29.590 --> 00:02:32.370 align:middle line:84%
So I'll explain
this and give you

00:02:32.370 --> 00:02:35.100 align:middle line:84%
an example to contextualize
what I'm saying.

00:02:35.100 --> 00:02:38.310 align:middle line:84%
Let's say we are
targeting a network,

00:02:38.310 --> 00:02:42.630 align:middle line:84%
and we have a specific
IP address of a server

00:02:42.630 --> 00:02:44.820 align:middle line:84%
that we are going
to be attacking.

00:02:44.820 --> 00:02:48.930 align:middle line:84%
And what happens is we are
able to exploit it and gain--

00:02:48.930 --> 00:02:51.000 align:middle line:84%
we are essentially able
to gain access to it.

00:02:51.000 --> 00:02:54.240 align:middle line:84%
And when we perform a quick
scan or a quick check,

00:02:54.240 --> 00:02:57.120 align:middle line:84%
we are able to identify
that this particular target

00:02:57.120 --> 00:03:00.690 align:middle line:84%
server or computer is part
of an internal network

00:03:00.690 --> 00:03:03.540 align:middle line:84%
with other computers
or servers on it.

00:03:03.540 --> 00:03:05.430 align:middle line:84%
And this, as a
penetration tester,

00:03:05.430 --> 00:03:07.740 align:middle line:84%
is literally a gold
mine because that

00:03:07.740 --> 00:03:09.750 align:middle line:84%
means we have more
targets that we can now

00:03:09.750 --> 00:03:13.530 align:middle line:84%
exploit through the
initially exploited server.

00:03:13.530 --> 00:03:16.620 align:middle line:84%
So we are going through the
initially exploited server.

00:03:16.620 --> 00:03:19.680 align:middle line:84%
So, again, we cannot access
those other computers

00:03:19.680 --> 00:03:24.510 align:middle line:84%
and servers externally because
we don't have the IP addresses.

00:03:24.510 --> 00:03:27.630 align:middle line:84%
Again, they might not have
access to the external network

00:03:27.630 --> 00:03:28.540 align:middle line:90%
or to the internet.

00:03:28.540 --> 00:03:30.960 align:middle line:84%
So the only way we
can exploit them

00:03:30.960 --> 00:03:34.650 align:middle line:84%
is through the initially
exploited system.

00:03:34.650 --> 00:03:37.500 align:middle line:84%
Now, when it comes down to
auxiliary modules and port

00:03:37.500 --> 00:03:39.720 align:middle line:84%
scanning, we can
use these modules

00:03:39.720 --> 00:03:43.260 align:middle line:84%
to scan the other computers
on the private or internal

00:03:43.260 --> 00:03:43.920 align:middle line:90%
network.

00:03:43.920 --> 00:03:45.840 align:middle line:84%
And we can, again,
scan for open ports,

00:03:45.840 --> 00:03:48.450 align:middle line:84%
discover what services are
running, et cetera, et cetera.

00:03:48.450 --> 00:03:53.310 align:middle line:84%
And this is where you cannot run
Nmap and start performing scans

00:03:53.310 --> 00:03:56.910 align:middle line:84%
via the initially exploited
server or computer within

00:03:56.910 --> 00:04:00.510 align:middle line:84%
the internal network unless you
transfer the Nmap executable

00:04:00.510 --> 00:04:04.050 align:middle line:84%
or the binary onto the initially
exploited server or operating

00:04:04.050 --> 00:04:04.710 align:middle line:90%
system.

00:04:04.710 --> 00:04:06.600 align:middle line:84%
And of course, that
is not recommended

00:04:06.600 --> 00:04:07.810 align:middle line:90%
as a penetration tester.

00:04:07.810 --> 00:04:11.400 align:middle line:84%
So the lab environment that
we're going to be using today

00:04:11.400 --> 00:04:13.800 align:middle line:84%
or in this video
is, again, set up

00:04:13.800 --> 00:04:15.970 align:middle line:84%
to demonstrate
this in both cases.

00:04:15.970 --> 00:04:18.089 align:middle line:84%
So this is the lab
infrastructure.

00:04:18.089 --> 00:04:21.040 align:middle line:84%
And let me just expand that,
so you can see what's going on.

00:04:21.040 --> 00:04:23.790 align:middle line:84%
So, again, let me just go
through the infrastructure

00:04:23.790 --> 00:04:26.980 align:middle line:84%
first as this is going to be
the most important part here.

00:04:26.980 --> 00:04:30.310 align:middle line:84%
So you can see that the
setup is fairly simple.

00:04:30.310 --> 00:04:32.280 align:middle line:84%
We are going to
have ourselves here.

00:04:32.280 --> 00:04:35.730 align:middle line:84%
And that, of course, is
denoted by that little icon

00:04:35.730 --> 00:04:38.370 align:middle line:84%
or that little person
next to a laptop.

00:04:38.370 --> 00:04:40.760 align:middle line:84%
And I'm just going to
highlight him here,

00:04:40.760 --> 00:04:42.010 align:middle line:90%
so we can see what's going on.

00:04:42.010 --> 00:04:45.180 align:middle line:84%
So that's us, and we
have the IP address

00:04:45.180 --> 00:04:46.530 align:middle line:90%
of this particular target.

00:04:46.530 --> 00:04:47.700 align:middle line:90%
This is target 1.

00:04:47.700 --> 00:04:50.800 align:middle line:84%
So that's the external server
that we have the IP address

00:04:50.800 --> 00:04:51.300 align:middle line:90%
for.

00:04:51.300 --> 00:04:53.250 align:middle line:84%
So we can use the
auxiliary modules

00:04:53.250 --> 00:04:55.740 align:middle line:84%
to perform a port scan
of this server here.

00:04:55.740 --> 00:04:59.760 align:middle line:84%
And what we'll discover is that
it has a vulnerable service

00:04:59.760 --> 00:05:01.000 align:middle line:90%
running on port 80.

00:05:01.000 --> 00:05:02.400 align:middle line:90%
Port 80 is a web server.

00:05:02.400 --> 00:05:04.550 align:middle line:90%
So we will that service.

00:05:04.550 --> 00:05:07.490 align:middle line:84%
And once we have gained
access to this server here,

00:05:07.490 --> 00:05:10.160 align:middle line:84%
we discover that it's
part of a network.

00:05:10.160 --> 00:05:13.820 align:middle line:84%
And as part of that network, we
have other systems or devices

00:05:13.820 --> 00:05:14.490 align:middle line:90%
on the network.

00:05:14.490 --> 00:05:19.340 align:middle line:84%
And one of them here is victim
PC 2, or the second target.

00:05:19.340 --> 00:05:21.650 align:middle line:84%
And then what we're
going to do is

00:05:21.650 --> 00:05:25.340 align:middle line:84%
we are going to perform
a port scan on PC 2

00:05:25.340 --> 00:05:27.410 align:middle line:84%
through this
particular target here

00:05:27.410 --> 00:05:28.940 align:middle line:90%
that we've already exploited.

00:05:28.940 --> 00:05:32.120 align:middle line:84%
And remember, we cannot do
this with Nmap or initially

00:05:32.120 --> 00:05:37.490 align:middle line:84%
because we don't have this PC's
or this system's IP address.

00:05:37.490 --> 00:05:40.290 align:middle line:84%
As I said, it may not be
connected to the internet,

00:05:40.290 --> 00:05:43.160 align:middle line:84%
so we can only go through
this particular PC.

00:05:43.160 --> 00:05:46.790 align:middle line:84%
So, again, what we'll do is
we'll get a Meterpreter session

00:05:46.790 --> 00:05:47.870 align:middle line:90%
on this target here.

00:05:47.870 --> 00:05:49.670 align:middle line:84%
Once we've done
that, we are going

00:05:49.670 --> 00:05:51.800 align:middle line:84%
to add a network
route that will allow

00:05:51.800 --> 00:05:55.280 align:middle line:84%
us to utilize the
auxiliary modules to scan

00:05:55.280 --> 00:05:57.980 align:middle line:84%
this particular
target because we

00:05:57.980 --> 00:06:01.910 align:middle line:84%
will be able to identify and
obtain the IP address of it.

00:06:01.910 --> 00:06:04.490 align:middle line:84%
And we'll be able to perform
a port scan and then discover

00:06:04.490 --> 00:06:05.760 align:middle line:90%
the open ports on it.

00:06:05.760 --> 00:06:08.600 align:middle line:84%
And as I said, this is something
that you can't do with Nmap.

00:06:08.600 --> 00:06:13.310 align:middle line:84%
You cannot externally run
an Nmap scan on an internal

00:06:13.310 --> 00:06:17.210 align:middle line:84%
network unless you have access
to one of the systems on that

00:06:17.210 --> 00:06:18.210 align:middle line:90%
internal network.

00:06:18.210 --> 00:06:20.060 align:middle line:84%
So it's fairly
simple to understand.

00:06:20.060 --> 00:06:23.280 align:middle line:84%
And, again, it will all make
sense once we get started.

00:06:23.280 --> 00:06:26.540 align:middle line:84%
So let me clear
out of that, and we

00:06:26.540 --> 00:06:31.420 align:middle line:84%
can move on to the practical
section of this video.

00:06:31.420 --> 00:06:33.630 align:middle line:84%
So I'm going to initiate
the lab environment,

00:06:33.630 --> 00:06:35.760 align:middle line:84%
and you can also join
in and follow along.

00:06:35.760 --> 00:06:38.790 align:middle line:84%
As I said, the techniques are
going to be fairly simple,

00:06:38.790 --> 00:06:42.120 align:middle line:84%
and it'll really highlight the
power of the auxiliary module.

00:06:42.120 --> 00:06:46.840 align:middle line:84%
So I'll see you within
the lab environment.

00:06:46.840 --> 00:06:49.370 align:middle line:84%
So I am back in the
lab environment.

00:06:49.370 --> 00:06:51.400 align:middle line:84%
And the first thing
that we need to do

00:06:51.400 --> 00:06:55.540 align:middle line:84%
is obtain the target IP
address for the system

00:06:55.540 --> 00:06:57.400 align:middle line:84%
that we are going
to be performing

00:06:57.400 --> 00:07:00.400 align:middle line:84%
the initial port scan on and
that we will be exploiting.

00:07:00.400 --> 00:07:03.100 align:middle line:84%
And you can do that
within the lab environment

00:07:03.100 --> 00:07:06.040 align:middle line:84%
by, again, using the
ifconfig command.

00:07:06.040 --> 00:07:08.890 align:middle line:84%
So we'll type in ifconfig,
and we'll hit Enter.

00:07:08.890 --> 00:07:12.160 align:middle line:84%
And we want to look for the
ethernet 1 interface, which,

00:07:12.160 --> 00:07:15.130 align:middle line:84%
again, will tell us our IP
address right over here.

00:07:15.130 --> 00:07:17.140 align:middle line:84%
And the target IP
address is going

00:07:17.140 --> 00:07:20.140 align:middle line:84%
to be the same except instead
of a 2, it's going to be a 3.

00:07:20.140 --> 00:07:23.180 align:middle line:84%
So, again, all we need to
do is just copy this here,

00:07:23.180 --> 00:07:24.400 align:middle line:90%
which I will do.

00:07:24.400 --> 00:07:26.742 align:middle line:84%
There we go, just copy
that, and we're just

00:07:26.742 --> 00:07:27.950 align:middle line:90%
going to keep a note of that.

00:07:27.950 --> 00:07:30.160 align:middle line:84%
The next thing we need
to do is make sure

00:07:30.160 --> 00:07:32.263 align:middle line:84%
that the PostgreSQL
service is started.

00:07:32.263 --> 00:07:33.430 align:middle line:90%
So I'm going to say service.

00:07:33.430 --> 00:07:39.920 align:middle line:90%


00:07:39.920 --> 00:07:41.930 align:middle line:84%
And we're going to start
the PostgreSQL service

00:07:41.930 --> 00:07:44.930 align:middle line:84%
so that we can interact with the
Metasploit framework database.

00:07:44.930 --> 00:07:49.070 align:middle line:84%
We are now going to initiate
or start up the msfconsole.

00:07:49.070 --> 00:07:50.900 align:middle line:90%
There we go, just start that up.

00:07:50.900 --> 00:07:57.580 align:middle line:90%


00:07:57.580 --> 00:08:00.070 align:middle line:84%
So the Metasploit framework
console is started up.

00:08:00.070 --> 00:08:01.960 align:middle line:84%
And the first
thing we want to do

00:08:01.960 --> 00:08:04.280 align:middle line:84%
is check the status
of the database.

00:08:04.280 --> 00:08:05.630 align:middle line:90%
So I'm going to say db_status.

00:08:05.630 --> 00:08:08.170 align:middle line:84%
So as you can see, it
says, "Connected to msf.

00:08:08.170 --> 00:08:09.640 align:middle line:90%
Connection type, postgresql."

00:08:09.640 --> 00:08:10.760 align:middle line:90%
So everything is good.

00:08:10.760 --> 00:08:14.290 align:middle line:84%
We are now going to set up a
workspace for our activities.

00:08:14.290 --> 00:08:15.640 align:middle line:90%
So we're going to say workspace.

00:08:15.640 --> 00:08:17.500 align:middle line:84%
And we're just going
to say -a, and we're

00:08:17.500 --> 00:08:21.610 align:middle line:84%
going to call this port_scan,
so port underscore scan.

00:08:21.610 --> 00:08:22.390 align:middle line:90%
Hit Enter.

00:08:22.390 --> 00:08:24.370 align:middle line:84%
That is going to,
again, make sure

00:08:24.370 --> 00:08:27.070 align:middle line:84%
that this is our
current workspace.

00:08:27.070 --> 00:08:27.850 align:middle line:90%
So there we are.

00:08:27.850 --> 00:08:31.000 align:middle line:84%
We are currently working
within the port_scan workspace,

00:08:31.000 --> 00:08:34.900 align:middle line:84%
and we can begin with
the first section

00:08:34.900 --> 00:08:36.650 align:middle line:90%
of this practical demonstration.

00:08:36.650 --> 00:08:38.650 align:middle line:84%
So the first thing
we want to do is

00:08:38.650 --> 00:08:43.059 align:middle line:84%
we want to search and identify
the port scan or, rather,

00:08:43.059 --> 00:08:45.280 align:middle line:84%
the port scanner
auxiliary module.

00:08:45.280 --> 00:08:47.050 align:middle line:90%
And we're starting off with TCP.

00:08:47.050 --> 00:08:50.080 align:middle line:84%
So if I want to search
for an auxiliary module,

00:08:50.080 --> 00:08:52.640 align:middle line:84%
I can again say search
and then provide a string.

00:08:52.640 --> 00:08:55.960 align:middle line:84%
So in this case, I can say
portscan and hit Enter.

00:08:55.960 --> 00:08:58.750 align:middle line:84%
And as you can see, this will
bring up quite a few modules.

00:08:58.750 --> 00:09:00.640 align:middle line:84%
And most of these
you can actually

00:09:00.640 --> 00:09:02.560 align:middle line:84%
use whenever you're
trying to perform

00:09:02.560 --> 00:09:07.120 align:middle line:84%
or trying to identify any open
ports on a target like the SYN

00:09:07.120 --> 00:09:11.770 align:middle line:84%
scan which, as I mentioned
with Nmap, is a stealthy scan.

00:09:11.770 --> 00:09:14.410 align:middle line:84%
You then have the
standard TCP scan here,

00:09:14.410 --> 00:09:16.100 align:middle line:84%
and you have the
[? Xmas ?] scan.

00:09:16.100 --> 00:09:18.880 align:middle line:84%
So you can go ahead and take
a look at all of these ones.

00:09:18.880 --> 00:09:21.890 align:middle line:84%
I am going to be exploring
the TCP port scan here.

00:09:21.890 --> 00:09:25.900 align:middle line:84%
So in order to utilize it,
what we can do is copy the name

00:09:25.900 --> 00:09:27.700 align:middle line:84%
and then say use
and paste the name.

00:09:27.700 --> 00:09:30.010 align:middle line:84%
Or we can just use
the index number

00:09:30.010 --> 00:09:31.250 align:middle line:90%
for that particular module.

00:09:31.250 --> 00:09:32.920 align:middle line:84%
And that's exactly
what I'm going to do.

00:09:32.920 --> 00:09:34.780 align:middle line:90%
So I'm going to say use.

00:09:34.780 --> 00:09:38.230 align:middle line:84%
And I can either copy this
right over here or just say 5.

00:09:38.230 --> 00:09:40.010 align:middle line:84%
But in this case, let
me just use the name

00:09:40.010 --> 00:09:40.840 align:middle line:90%
so that it's clear.

00:09:40.840 --> 00:09:41.810 align:middle line:90%
There we go.

00:09:41.810 --> 00:09:44.642 align:middle line:84%
Once we hit Enter, that's going
to enable and load the module.

00:09:44.642 --> 00:09:46.600 align:middle line:84%
So we're currently working
now with the module.

00:09:46.600 --> 00:09:48.260 align:middle line:84%
So I'm just going
to clear that out.

00:09:48.260 --> 00:09:50.770 align:middle line:84%
And, again, just make
sure we get the target IP.

00:09:50.770 --> 00:09:52.720 align:middle line:84%
I'm just going to
type in ifconfig.

00:09:52.720 --> 00:09:56.533 align:middle line:84%
We're going to take a look
at the ethernet interface

00:09:56.533 --> 00:09:57.200 align:middle line:90%
right over here.

00:09:57.200 --> 00:09:58.480 align:middle line:90%
So that's ethernet 1.

00:09:58.480 --> 00:10:00.610 align:middle line:84%
Just copy that
and remember it is

00:10:00.610 --> 00:10:02.530 align:middle line:90%
going to be ending in 3, not 2.

00:10:02.530 --> 00:10:04.060 align:middle line:90%
That's the target IP.

00:10:04.060 --> 00:10:07.300 align:middle line:84%
So we can show the options
for this particular module, so

00:10:07.300 --> 00:10:08.410 align:middle line:90%
show options.

00:10:08.410 --> 00:10:11.590 align:middle line:84%
And as you can see and as
we've already covered before,

00:10:11.590 --> 00:10:14.140 align:middle line:84%
we have the various
relative variables

00:10:14.140 --> 00:10:17.560 align:middle line:84%
that, again, allow us to
specify the target IP as well

00:10:17.560 --> 00:10:19.660 align:middle line:84%
as the ports or,
rather, the port range

00:10:19.660 --> 00:10:20.950 align:middle line:90%
that we want to scan.

00:10:20.950 --> 00:10:23.260 align:middle line:84%
Now, the port orange is
a very important factor

00:10:23.260 --> 00:10:25.420 align:middle line:84%
when it comes down to
discovering open ports.

00:10:25.420 --> 00:10:28.000 align:middle line:84%
If you're trying to be as
comprehensive as possible,

00:10:28.000 --> 00:10:31.330 align:middle line:84%
I would recommend that you
scan the entire TCP port

00:10:31.330 --> 00:10:35.180 align:middle line:90%
range, which is about 65,535.

00:10:35.180 --> 00:10:36.910 align:middle line:84%
And the other
options essentially

00:10:36.910 --> 00:10:40.760 align:middle line:84%
allow you to tweak the speed and
the stealthiness of the scan.

00:10:40.760 --> 00:10:43.210 align:middle line:84%
So, again, depending on
the target infrastructure

00:10:43.210 --> 00:10:45.370 align:middle line:84%
and the networking
equipment in place,

00:10:45.370 --> 00:10:47.230 align:middle line:90%
you can modify all of this.

00:10:47.230 --> 00:10:49.575 align:middle line:84%
A few other options you
can change are the threads.

00:10:49.575 --> 00:10:50.950 align:middle line:84%
The threads
essentially allow you

00:10:50.950 --> 00:10:53.890 align:middle line:84%
to change the number of
concurrent threads allowed

00:10:53.890 --> 00:10:54.650 align:middle line:90%
per host.

00:10:54.650 --> 00:10:58.030 align:middle line:84%
So, again, in this case because
we're only targeting one host,

00:10:58.030 --> 00:10:59.560 align:middle line:90%
it's going to be set to 1.

00:10:59.560 --> 00:11:02.380 align:middle line:84%
And the maximum is 1
per host, so we actually

00:11:02.380 --> 00:11:03.560 align:middle line:90%
don't need to change that.

00:11:03.560 --> 00:11:06.440 align:middle line:84%
So let's set up
the rhosts option

00:11:06.440 --> 00:11:08.650 align:middle line:84%
and remember the target
IP, which we have there.

00:11:08.650 --> 00:11:10.810 align:middle line:84%
And it looks like I've
actually just copied

00:11:10.810 --> 00:11:12.400 align:middle line:90%
some incorrect text there.

00:11:12.400 --> 00:11:16.360 align:middle line:84%
So I'm just going to make sure
we can just type in ifconfig

00:11:16.360 --> 00:11:17.330 align:middle line:90%
and get that again.

00:11:17.330 --> 00:11:22.450 align:middle line:84%
So ifconfig, there we go,
and just copy that there.

00:11:22.450 --> 00:11:27.503 align:middle line:84%
And we can clear that out
and then say set rhosts.

00:11:27.503 --> 00:11:28.670 align:middle line:90%
And we're going to set that.

00:11:28.670 --> 00:11:30.740 align:middle line:84%
And remember, we're
changing the 2 into a 3.

00:11:30.740 --> 00:11:32.060 align:middle line:90%
That's the target IP.

00:11:32.060 --> 00:11:35.450 align:middle line:84%
We hit Enter, and
rhosts have been set.

00:11:35.450 --> 00:11:38.750 align:middle line:84%
And we can then open up
the Options menu here.

00:11:38.750 --> 00:11:40.430 align:middle line:84%
We can also change
the port range.

00:11:40.430 --> 00:11:44.270 align:middle line:84%
In this case, I'm just going
to keep it to port 1 to 10,000

00:11:44.270 --> 00:11:47.600 align:middle line:84%
because, again, I already know
that this particular target is

00:11:47.600 --> 00:11:50.550 align:middle line:84%
only running one
service on port 80.

00:11:50.550 --> 00:11:53.300 align:middle line:84%
So once you're ready to execute
the module, all you need to do

00:11:53.300 --> 00:11:55.848 align:middle line:84%
is type in run, which
I'm going to do now.

00:11:55.848 --> 00:11:56.390 align:middle line:90%
There we are.

00:11:56.390 --> 00:11:58.730 align:middle line:84%
As you can see, it
tells us port 80

00:11:58.730 --> 00:12:00.200 align:middle line:84%
is open on the
target, which means

00:12:00.200 --> 00:12:02.220 align:middle line:90%
it's hosting a web application.

00:12:02.220 --> 00:12:04.647 align:middle line:84%
Now, because we're working
in the lab environment

00:12:04.647 --> 00:12:06.230 align:middle line:84%
and we don't have
access to a browser,

00:12:06.230 --> 00:12:09.410 align:middle line:84%
we can't visually see what this
web application is hosting.

00:12:09.410 --> 00:12:13.640 align:middle line:84%
What we can do alternatively
is use the curl utility.

00:12:13.640 --> 00:12:15.260 align:middle line:84%
And the Metasploit
framework console

00:12:15.260 --> 00:12:19.520 align:middle line:84%
allows us to initialize or to
run Linux utilities directly,

00:12:19.520 --> 00:12:21.630 align:middle line:84%
so we can actually
do that from here.

00:12:21.630 --> 00:12:22.970 align:middle line:90%
So we're going to say curl.

00:12:22.970 --> 00:12:25.790 align:middle line:84%
And we then want to
copy the target IP here.

00:12:25.790 --> 00:12:28.910 align:middle line:84%
We don't have to
provide the port.

00:12:28.910 --> 00:12:30.860 align:middle line:84%
And what we're essentially
doing with curl

00:12:30.860 --> 00:12:32.780 align:middle line:90%
is downloading the web page--

00:12:32.780 --> 00:12:35.420 align:middle line:84%
the home page, rather--
of the web application.

00:12:35.420 --> 00:12:37.530 align:middle line:84%
And let's see what
we're able to identify.

00:12:37.530 --> 00:12:40.185 align:middle line:84%
So it's going to
download the HTML code,

00:12:40.185 --> 00:12:41.810 align:middle line:84%
and it's going to be
display it for us.

00:12:41.810 --> 00:12:43.130 align:middle line:90%
As you can see, there we are.

00:12:43.130 --> 00:12:44.360 align:middle line:90%
It's going to execute curl.

00:12:44.360 --> 00:12:46.400 align:middle line:84%
And from this,
we're able to tell

00:12:46.400 --> 00:12:50.090 align:middle line:84%
that the web server is running
an application called Soda.

00:12:50.090 --> 00:12:52.250 align:middle line:84%
And I'll actually take
you through the process

00:12:52.250 --> 00:12:53.150 align:middle line:90%
of exploiting this.

00:12:53.150 --> 00:12:54.620 align:middle line:84%
Now, this is not
relevant to what

00:12:54.620 --> 00:12:56.030 align:middle line:90%
we are doing at the moment.

00:12:56.030 --> 00:12:59.300 align:middle line:84%
As I said, this is probably
not your first foray

00:12:59.300 --> 00:13:00.600 align:middle line:90%
into exploitation.

00:13:00.600 --> 00:13:02.810 align:middle line:84%
So, again, you don't
need to concern yourself

00:13:02.810 --> 00:13:05.000 align:middle line:90%
with what's going on exactly.

00:13:05.000 --> 00:13:06.980 align:middle line:84%
But in terms of
exploiting this service,

00:13:06.980 --> 00:13:08.160 align:middle line:90%
it's really very simple.

00:13:08.160 --> 00:13:09.890 align:middle line:90%
All we need to do is say search.

00:13:09.890 --> 00:13:12.200 align:middle line:84%
And we're going to
say-- search for soda.

00:13:12.200 --> 00:13:14.150 align:middle line:84%
We're going to
search for modules,

00:13:14.150 --> 00:13:19.440 align:middle line:84%
but specifically exploit modules
for the Soda web application.

00:13:19.440 --> 00:13:21.050 align:middle line:90%
So we hit Enter.

00:13:21.050 --> 00:13:23.990 align:middle line:84%
We're able to identify
an exploit for Soda.

00:13:23.990 --> 00:13:26.210 align:middle line:84%
And we are not really
sure of the version.

00:13:26.210 --> 00:13:27.800 align:middle line:84%
But as I said, at
this point, we're

00:13:27.800 --> 00:13:30.290 align:middle line:84%
really not covering
vulnerability detection.

00:13:30.290 --> 00:13:34.010 align:middle line:84%
And you can see this is a PHP
file upload vulnerability that

00:13:34.010 --> 00:13:36.980 align:middle line:84%
will allow us to upload
a malicious payload that

00:13:36.980 --> 00:13:39.000 align:middle line:84%
will provide us with
a Meterpreter session.

00:13:39.000 --> 00:13:40.940 align:middle line:84%
So in order to use
this, we simply

00:13:40.940 --> 00:13:42.690 align:middle line:90%
just want to copy that there.

00:13:42.690 --> 00:13:46.880 align:middle line:84%
And we're going to say use,
and we paste that in there.

00:13:46.880 --> 00:13:48.000 align:middle line:90%
There we go.

00:13:48.000 --> 00:13:50.150 align:middle line:84%
And I'm just going
to copy the target IP

00:13:50.150 --> 00:13:52.740 align:middle line:90%
here so that I have it on hand.

00:13:52.740 --> 00:13:56.770 align:middle line:84%
And if we say show options
for this particular module,

00:13:56.770 --> 00:13:58.350 align:middle line:84%
the only options
we need to change

00:13:58.350 --> 00:14:01.020 align:middle line:84%
is the target IP,
which is rhosts.

00:14:01.020 --> 00:14:03.190 align:middle line:84%
The rport is
configured correctly.

00:14:03.190 --> 00:14:05.490 align:middle line:84%
The target is
running on port 80.

00:14:05.490 --> 00:14:08.130 align:middle line:84%
Or rather, the service
is running on port 80.

00:14:08.130 --> 00:14:10.120 align:middle line:84%
We don't have an
SSL certificate,

00:14:10.120 --> 00:14:12.430 align:middle line:90%
so we don't need to change that.

00:14:12.430 --> 00:14:15.540 align:middle line:84%
We only need to change
the target URI and rhosts

00:14:15.540 --> 00:14:17.940 align:middle line:84%
because the target
URI is essentially

00:14:17.940 --> 00:14:21.400 align:middle line:84%
used to specify the base
path to the web application.

00:14:21.400 --> 00:14:23.370 align:middle line:84%
The web application
in this case is

00:14:23.370 --> 00:14:25.360 align:middle line:84%
hosted at the root
of the web server,

00:14:25.360 --> 00:14:27.370 align:middle line:90%
so we need to change that.

00:14:27.370 --> 00:14:30.240 align:middle line:90%
So let's first of all change--

00:14:30.240 --> 00:14:32.050 align:middle line:90%
let's change the rhosts value.

00:14:32.050 --> 00:14:34.740 align:middle line:84%
So I'm going to
say set rhosts to--

00:14:34.740 --> 00:14:36.930 align:middle line:84%
and we'll put in
the target IP there.

00:14:36.930 --> 00:14:38.895 align:middle line:84%
And I'll just clear
out the terminal.

00:14:38.895 --> 00:14:39.820 align:middle line:90%
There we go.

00:14:39.820 --> 00:14:45.670 align:middle line:84%
And now we are just going to
set the URI or the target URI,

00:14:45.670 --> 00:14:46.170 align:middle line:90%
rather.

00:14:46.170 --> 00:14:49.320 align:middle line:84%
So target URI and
we're going to set that

00:14:49.320 --> 00:14:51.160 align:middle line:90%
to the root of the web server.

00:14:51.160 --> 00:14:54.660 align:middle line:84%
So we'll just use the
forward-slash symbol there.

00:14:54.660 --> 00:14:56.200 align:middle line:90%
That means that's the root.

00:14:56.200 --> 00:15:00.510 align:middle line:84%
And then we say show
options like so.

00:15:00.510 --> 00:15:02.520 align:middle line:84%
And it looks like
everything is configured.

00:15:02.520 --> 00:15:05.280 align:middle line:84%
So all we need to do now
to run this exploit is

00:15:05.280 --> 00:15:06.960 align:middle line:90%
just say exploit.

00:15:06.960 --> 00:15:08.160 align:middle line:90%
So we'll say exploit.

00:15:08.160 --> 00:15:08.960 align:middle line:90%
There we are.

00:15:08.960 --> 00:15:10.020 align:middle line:90%
We hit Enter.

00:15:10.020 --> 00:15:13.690 align:middle line:84%
And that is going to open up
a Meterpreter session for us.

00:15:13.690 --> 00:15:16.770 align:middle line:84%
So as you can see, it starts
the reverse TCP handler.

00:15:16.770 --> 00:15:19.350 align:middle line:84%
It then sends the PHP
payload, and it gives you

00:15:19.350 --> 00:15:20.790 align:middle line:90%
the name of the PHP payload.

00:15:20.790 --> 00:15:24.330 align:middle line:84%
It then executes the payload and
then finally sends the stage.

00:15:24.330 --> 00:15:26.013 align:middle line:84%
And we get a
Meterpreter session.

00:15:26.013 --> 00:15:27.930 align:middle line:84%
So I'm just going to
wait for this to bring up

00:15:27.930 --> 00:15:30.620 align:middle line:90%
the Meterpreter session.

00:15:30.620 --> 00:15:32.770 align:middle line:84%
So we received a
Meterpreter session.

00:15:32.770 --> 00:15:36.040 align:middle line:84%
And as I said, you really don't
need to know what's going on.

00:15:36.040 --> 00:15:37.960 align:middle line:84%
You can simply follow
along, and it will all

00:15:37.960 --> 00:15:40.610 align:middle line:84%
make sense as we progress
through this course.

00:15:40.610 --> 00:15:42.280 align:middle line:84%
So the Meterpreter
session essentially

00:15:42.280 --> 00:15:45.430 align:middle line:84%
provides us with an
interactive command

00:15:45.430 --> 00:15:47.150 align:middle line:90%
line on the target system.

00:15:47.150 --> 00:15:49.000 align:middle line:90%
So for example, I can say--

00:15:49.000 --> 00:15:53.440 align:middle line:84%
a command that's really useful
is to, again, type sysinfo.

00:15:53.440 --> 00:15:55.660 align:middle line:84%
And that will tell us more
about the target system.

00:15:55.660 --> 00:15:57.760 align:middle line:84%
You can see that this
is a Linux target.

00:15:57.760 --> 00:16:00.640 align:middle line:84%
And the name of the
system is victim 1.

00:16:00.640 --> 00:16:04.240 align:middle line:84%
So remember back to the
diagram, this is the first.

00:16:04.240 --> 00:16:06.910 align:middle line:84%
This is the target system
here that we have exploited,

00:16:06.910 --> 00:16:08.230 align:middle line:90%
and it's called victim 1.

00:16:08.230 --> 00:16:11.800 align:middle line:84%
We now want to perform
a port scan on victim 2.

00:16:11.800 --> 00:16:14.030 align:middle line:84%
So that's very
useful information.

00:16:14.030 --> 00:16:16.030 align:middle line:84%
What we need to
find out now is we

00:16:16.030 --> 00:16:20.050 align:middle line:84%
need to find out the private
network IP address or, rather,

00:16:20.050 --> 00:16:24.280 align:middle line:84%
the subnet that this particular
PC or this particular system

00:16:24.280 --> 00:16:26.920 align:middle line:84%
is a part of in
order to identify

00:16:26.920 --> 00:16:28.540 align:middle line:90%
the IP address of victim 2.

00:16:28.540 --> 00:16:30.430 align:middle line:84%
So in order to do that,
I'm going to open up

00:16:30.430 --> 00:16:31.870 align:middle line:90%
a Shell session here.

00:16:31.870 --> 00:16:35.710 align:middle line:84%
And I'll just spawn a bash
session so that we can actually

00:16:35.710 --> 00:16:37.340 align:middle line:90%
run commands easily.

00:16:37.340 --> 00:16:40.780 align:middle line:84%
So there we are, bin/bash
I. And what I'll type in now

00:16:40.780 --> 00:16:43.810 align:middle line:90%
is ifconfig, and I'll hit Enter.

00:16:43.810 --> 00:16:47.110 align:middle line:84%
So we can see for
this particular system

00:16:47.110 --> 00:16:51.280 align:middle line:84%
the ethernet 0 interface is
where it gets its primary IP

00:16:51.280 --> 00:16:51.950 align:middle line:90%
address from.

00:16:51.950 --> 00:16:54.160 align:middle line:84%
And that's how we accessed
it, if you remember.

00:16:54.160 --> 00:16:56.920 align:middle line:84%
It then has another
interface called ethernet 1,

00:16:56.920 --> 00:16:59.630 align:middle line:84%
and this has a totally
different IP address.

00:16:59.630 --> 00:17:01.130 align:middle line:84%
So it's part of a
different subnet.

00:17:01.130 --> 00:17:05.270 align:middle line:84%
So as part of the way this
particular lab is set up,

00:17:05.270 --> 00:17:09.400 align:middle line:84%
we can again-- we know
that the victim 2 IP

00:17:09.400 --> 00:17:11.240 align:middle line:90%
address is under this subnet.

00:17:11.240 --> 00:17:14.200 align:middle line:84%
And all we need to do is just
change this from a 2 to a 3,

00:17:14.200 --> 00:17:16.750 align:middle line:84%
and that's the IP
address of victim 2.

00:17:16.750 --> 00:17:19.869 align:middle line:84%
So I'm going to
copy that and just

00:17:19.869 --> 00:17:23.240 align:middle line:84%
keep that ready because we are
going to need it right now.

00:17:23.240 --> 00:17:26.710 align:middle line:84%
So what I'm going to
do now is we are just

00:17:26.710 --> 00:17:28.720 align:middle line:90%
going to terminate out of this.

00:17:28.720 --> 00:17:32.720 align:middle line:84%
And I'll clear that out, and
we're back in Meterpreter.

00:17:32.720 --> 00:17:36.940 align:middle line:84%
So now that we've
established or identified

00:17:36.940 --> 00:17:40.600 align:middle line:84%
the IP address and,
rather, the subnet

00:17:40.600 --> 00:17:42.520 align:middle line:84%
of this particular
private network,

00:17:42.520 --> 00:17:45.730 align:middle line:84%
we can add the root
within Meterpreter.

00:17:45.730 --> 00:17:47.990 align:middle line:84%
And we just need to
provide the IP address.

00:17:47.990 --> 00:17:50.710 align:middle line:90%
So I'm going to say run.

00:17:50.710 --> 00:17:52.210 align:middle line:84%
And we're going
to say autoroute.

00:17:52.210 --> 00:17:55.170 align:middle line:90%


00:17:55.170 --> 00:17:57.820 align:middle line:84%
And we then need to
provide the subnet.

00:17:57.820 --> 00:18:00.570 align:middle line:84%
So I'm going to again paste
in the IP address there.

00:18:00.570 --> 00:18:03.370 align:middle line:84%
And, again, we don't need
to provide the subnet range.

00:18:03.370 --> 00:18:08.190 align:middle line:84%
We're just providing the
IP address of the systems

00:18:08.190 --> 00:18:09.630 align:middle line:90%
on the private network.

00:18:09.630 --> 00:18:11.940 align:middle line:84%
And then through that,
we'll be able to perform

00:18:11.940 --> 00:18:14.067 align:middle line:90%
a scan on victim 2.

00:18:14.067 --> 00:18:15.150 align:middle line:90%
So I'm going to hit Enter.

00:18:15.150 --> 00:18:18.250 align:middle line:84%
That's going to add the
route for us automatically.

00:18:18.250 --> 00:18:21.420 align:middle line:84%
Now that that's done, we can
put this Meterpreter session

00:18:21.420 --> 00:18:22.530 align:middle line:90%
in the background.

00:18:22.530 --> 00:18:26.160 align:middle line:84%
So remember I said that I'll be
covering sessions previously,

00:18:26.160 --> 00:18:28.090 align:middle line:84%
and this is where
sessions come into play.

00:18:28.090 --> 00:18:31.350 align:middle line:84%
So, again, I'll just type in
background correctly there.

00:18:31.350 --> 00:18:35.070 align:middle line:90%
That is background.

00:18:35.070 --> 00:18:35.592 align:middle line:90%
There we go.

00:18:35.592 --> 00:18:37.050 align:middle line:84%
That's going to
put it-- it's going

00:18:37.050 --> 00:18:38.430 align:middle line:90%
to be background session 1.

00:18:38.430 --> 00:18:42.360 align:middle line:84%
You can view your active
sessions by typing in sessions.

00:18:42.360 --> 00:18:42.930 align:middle line:90%
There we are.

00:18:42.930 --> 00:18:45.840 align:middle line:84%
As you can see, that's the
session that we currently have.

00:18:45.840 --> 00:18:47.700 align:middle line:84%
And you can have more
than one sessions,

00:18:47.700 --> 00:18:49.350 align:middle line:84%
and you can navigate
between them

00:18:49.350 --> 00:18:51.570 align:middle line:84%
and interact with them
through whatever Shell

00:18:51.570 --> 00:18:53.620 align:middle line:90%
that you have access through.

00:18:53.620 --> 00:18:56.050 align:middle line:84%
So, again, now that
we've done that,

00:18:56.050 --> 00:19:00.150 align:middle line:84%
we are just going to copy
this IP address here.

00:19:00.150 --> 00:19:02.670 align:middle line:84%
As I said, we've already
got that information

00:19:02.670 --> 00:19:06.670 align:middle line:84%
if we can again
obtain that here,

00:19:06.670 --> 00:19:08.070 align:middle line:90%
which I think we already have.

00:19:08.070 --> 00:19:14.890 align:middle line:84%
Excellent, so we can all search
for the port scan module again.

00:19:14.890 --> 00:19:17.760 align:middle line:84%
So, again, we can say
search and then portscan.

00:19:17.760 --> 00:19:21.740 align:middle line:90%


00:19:21.740 --> 00:19:24.810 align:middle line:84%
And we can use this particular
port scanner, the TCP port

00:19:24.810 --> 00:19:25.310 align:middle line:90%
scanner.

00:19:25.310 --> 00:19:27.018 align:middle line:84%
So I'm just going to
use the index number

00:19:27.018 --> 00:19:28.700 align:middle line:90%
for the module, which is 5.

00:19:28.700 --> 00:19:33.290 align:middle line:84%
And now we need to set the
rhosts option to the IP address

00:19:33.290 --> 00:19:34.250 align:middle line:90%
that we copied.

00:19:34.250 --> 00:19:36.290 align:middle line:84%
And, again, we
change the 2 to a 3

00:19:36.290 --> 00:19:39.890 align:middle line:84%
because that is the
IP address of victim 2

00:19:39.890 --> 00:19:41.960 align:middle line:84%
or, rather, the second
system that we're

00:19:41.960 --> 00:19:43.850 align:middle line:84%
going to be performing
a port scan on.

00:19:43.850 --> 00:19:44.660 align:middle line:90%
We hit Enter.

00:19:44.660 --> 00:19:46.670 align:middle line:84%
And because we already
have the route added,

00:19:46.670 --> 00:19:48.590 align:middle line:84%
we are now performing
the port scan

00:19:48.590 --> 00:19:51.080 align:middle line:84%
through the first
system we exploited,

00:19:51.080 --> 00:19:53.390 align:middle line:90%
also known as victim 1.

00:19:53.390 --> 00:19:55.040 align:middle line:84%
So now that we
have done that, we

00:19:55.040 --> 00:19:59.000 align:middle line:84%
can essentially configure
the port options in regards

00:19:59.000 --> 00:20:00.050 align:middle line:90%
to the range.

00:20:00.050 --> 00:20:02.250 align:middle line:84%
So I'm going to
say show options.

00:20:02.250 --> 00:20:07.250 align:middle line:84%
And let me just clear
that out, show options.

00:20:07.250 --> 00:20:07.860 align:middle line:90%
There we go.

00:20:07.860 --> 00:20:10.950 align:middle line:84%
And we can set the port
range, all of that good stuff.

00:20:10.950 --> 00:20:14.030 align:middle line:84%
But what we'll do in this
case is just hit run.

00:20:14.030 --> 00:20:16.760 align:middle line:84%
And as you can see, we're
able to perform the port scan

00:20:16.760 --> 00:20:19.340 align:middle line:84%
on the second system, and
we're able to identify

00:20:19.340 --> 00:20:20.630 align:middle line:90%
various ports open.

00:20:20.630 --> 00:20:22.490 align:middle line:84%
So you know that this
is a different system

00:20:22.490 --> 00:20:25.850 align:middle line:84%
because we have discovered
SSH and FTP services running.

00:20:25.850 --> 00:20:28.130 align:middle line:90%
So port 22 is open, port 21.

00:20:28.130 --> 00:20:32.150 align:middle line:84%
And we also have a web
server running on victim 2.

00:20:32.150 --> 00:20:34.250 align:middle line:84%
So as you can see,
we can now begin

00:20:34.250 --> 00:20:37.260 align:middle line:84%
to start exploiting the
other system on the network.

00:20:37.260 --> 00:20:40.940 align:middle line:84%
And this is where the port
scanner modules or, rather,

00:20:40.940 --> 00:20:43.740 align:middle line:84%
the port scanner auxiliary
modules come into play.

00:20:43.740 --> 00:20:45.600 align:middle line:84%
And you can see how
important they are.

00:20:45.600 --> 00:20:48.860 align:middle line:84%
So that is how to use the TCP
port scan auxiliary module.

00:20:48.860 --> 00:20:52.070 align:middle line:84%
And I've taken you through
the process of how to do this

00:20:52.070 --> 00:20:54.630 align:middle line:84%
or how to essentially
set up a pivot point

00:20:54.630 --> 00:20:56.750 align:middle line:84%
so that you can
scan other computers

00:20:56.750 --> 00:20:59.330 align:middle line:84%
on an internal network
once you've gained access

00:20:59.330 --> 00:21:01.020 align:middle line:84%
to one of the computers
on the network.

00:21:01.020 --> 00:21:04.640 align:middle line:84%
So let's take a look
at the UDP module

00:21:04.640 --> 00:21:08.750 align:middle line:84%
that we can use to,
again, scan for UDP ports.

00:21:08.750 --> 00:21:12.260 align:middle line:84%
So in order to do this,
I'm just going to say back.

00:21:12.260 --> 00:21:15.770 align:middle line:84%
And we will then search
for another module.

00:21:15.770 --> 00:21:17.270 align:middle line:84%
And in this case,
we know that we're

00:21:17.270 --> 00:21:18.800 align:middle line:90%
searching for a UDP module.

00:21:18.800 --> 00:21:23.240 align:middle line:84%
So I'm going to clear that
out, and we will say search.

00:21:23.240 --> 00:21:27.290 align:middle line:84%
And we're looking for a
module called UDP sweep.

00:21:27.290 --> 00:21:30.840 align:middle line:84%
Let me just make sure I
type that in correctly.

00:21:30.840 --> 00:21:32.120 align:middle line:90%
There we are, UDP sweep.

00:21:32.120 --> 00:21:35.210 align:middle line:84%
And this is the module here,
so auxiliary scanner discovery

00:21:35.210 --> 00:21:36.470 align:middle line:90%
UDP sweep.

00:21:36.470 --> 00:21:39.590 align:middle line:84%
And we can copy that
and then say use.

00:21:39.590 --> 00:21:41.920 align:middle line:90%
And there we go.

00:21:41.920 --> 00:21:45.110 align:middle line:84%
If I show the options for
this particular module,

00:21:45.110 --> 00:21:47.590 align:middle line:84%
you can see that the only
option we need to set

00:21:47.590 --> 00:21:51.020 align:middle line:84%
is the rhosts option, which
is the target IP address.

00:21:51.020 --> 00:21:55.370 align:middle line:84%
So in this case, let's perform
a UDP scan on the first target.

00:21:55.370 --> 00:21:57.400 align:middle line:84%
So, again, I'll just
type in ifconfig.

00:21:57.400 --> 00:22:00.130 align:middle line:84%
And we'll copy this here
because, again, this provides

00:22:00.130 --> 00:22:01.400 align:middle line:90%
us with the IP address.

00:22:01.400 --> 00:22:03.910 align:middle line:84%
And we'll just change that
when we're setting rhosts.

00:22:03.910 --> 00:22:07.150 align:middle line:84%
So we'll say set rhosts, and
then we paste that in there

00:22:07.150 --> 00:22:08.960 align:middle line:84%
and then just
change that to a 3.

00:22:08.960 --> 00:22:11.290 align:middle line:84%
And then all we need
to do is type in run.

00:22:11.290 --> 00:22:13.630 align:middle line:84%
And it's going to begin
performing the scan.

00:22:13.630 --> 00:22:15.640 align:middle line:84%
Now, in this case,
this particular target

00:22:15.640 --> 00:22:18.640 align:middle line:84%
doesn't have any services
running on UDP ports,

00:22:18.640 --> 00:22:20.890 align:middle line:84%
so it's not going to
return any results.

00:22:20.890 --> 00:22:23.950 align:middle line:84%
And of course, you can do
this through your pivot point,

00:22:23.950 --> 00:22:25.930 align:middle line:84%
as I mentioned before,
or through the system

00:22:25.930 --> 00:22:28.270 align:middle line:84%
that you've exploited
once you've added a route.

00:22:28.270 --> 00:22:31.180 align:middle line:84%
As you can see, it returns
zero results, as I said,

00:22:31.180 --> 00:22:34.240 align:middle line:84%
because the target is not
running any UDP ports.

00:22:34.240 --> 00:22:36.460 align:middle line:84%
So, again, we've
covered quite a bit,

00:22:36.460 --> 00:22:38.260 align:middle line:84%
and it might be a
little bit confusing.

00:22:38.260 --> 00:22:40.570 align:middle line:84%
But, again, I just
wanted to highlight

00:22:40.570 --> 00:22:42.760 align:middle line:84%
the importance of
the auxiliary modules

00:22:42.760 --> 00:22:45.100 align:middle line:84%
and how they can be used
to perform port scanning

00:22:45.100 --> 00:22:47.980 align:middle line:84%
not just during the initial
phase of information gathering,

00:22:47.980 --> 00:22:50.680 align:middle line:84%
but also in the
post-exploitation phase

00:22:50.680 --> 00:22:54.130 align:middle line:84%
once you're trying to pivot
onto other systems on a target

00:22:54.130 --> 00:22:54.980 align:middle line:90%
network.

00:22:54.980 --> 00:22:58.690 align:middle line:84%
So that's going to be it for
the practical demonstration.

00:22:58.690 --> 00:23:00.460 align:middle line:84%
Now that we've
taken a look at how

00:23:00.460 --> 00:23:02.620 align:middle line:84%
to use auxiliary modules
for port scanning,

00:23:02.620 --> 00:23:04.570 align:middle line:84%
we can begin
exploring the process

00:23:04.570 --> 00:23:08.500 align:middle line:84%
of utilizing auxiliary
modules for enumeration.

00:23:08.500 --> 00:23:10.480 align:middle line:84%
More specifically,
we'll be exploring

00:23:10.480 --> 00:23:13.960 align:middle line:84%
each service and the
various auxiliary modules

00:23:13.960 --> 00:23:16.270 align:middle line:84%
available that can
be used to, again,

00:23:16.270 --> 00:23:19.420 align:middle line:84%
extract and enumerate as
much information as possible

00:23:19.420 --> 00:23:20.770 align:middle line:90%
from the services.

00:23:20.770 --> 00:23:24.060 align:middle line:84%
So I'll be seeing you
in the next video.