WEBVTT

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


00:00:10.140 --> 00:00:12.330 align:middle line:90%
Port scanning with Nmap.

00:00:12.330 --> 00:00:14.100 align:middle line:84%
In this video, we're
going to be exploring

00:00:14.100 --> 00:00:18.000 align:middle line:84%
the process of identifying
open ports on a target system

00:00:18.000 --> 00:00:20.160 align:middle line:84%
as well as the respective
services that are

00:00:20.160 --> 00:00:22.630 align:middle line:90%
running on these open ports.

00:00:22.630 --> 00:00:24.630 align:middle line:84%
And we're going to be
doing this through the use

00:00:24.630 --> 00:00:27.030 align:middle line:84%
of a tool called Nmap
as we have already

00:00:27.030 --> 00:00:29.140 align:middle line:90%
explored in the previous video.

00:00:29.140 --> 00:00:31.660 align:middle line:84%
So if you recall in
the previous video,

00:00:31.660 --> 00:00:35.040 align:middle line:84%
we explored the process of
discovering hosts on a network.

00:00:35.040 --> 00:00:37.410 align:middle line:84%
We are now going to
turn our attention

00:00:37.410 --> 00:00:42.450 align:middle line:84%
to targeting or performing a
port scan on one of these hosts

00:00:42.450 --> 00:00:45.720 align:middle line:84%
in order to identify the
open ports that are running

00:00:45.720 --> 00:00:50.520 align:middle line:84%
on this target system as well
as the services that are running

00:00:50.520 --> 00:00:51.480 align:middle line:90%
on those open ports.

00:00:51.480 --> 00:00:54.660 align:middle line:84%
And we'll also try and perform
some service version detection

00:00:54.660 --> 00:00:58.260 align:middle line:84%
scanning, operating
system detection.

00:00:58.260 --> 00:01:01.800 align:middle line:84%
And the objective here
is to essentially obtain

00:01:01.800 --> 00:01:04.950 align:middle line:84%
as much information as
possible or enumerate as

00:01:04.950 --> 00:01:09.330 align:middle line:84%
much information as possible
from a target system with Nmap.

00:01:09.330 --> 00:01:10.150 align:middle line:90%
Of course.

00:01:10.150 --> 00:01:13.050 align:middle line:84%
I'm not going to be focusing
on service and enumeration,

00:01:13.050 --> 00:01:15.840 align:middle line:84%
because that is going to be
covered in its own course.

00:01:15.840 --> 00:01:17.790 align:middle line:84%
We're primarily
focused on performing

00:01:17.790 --> 00:01:21.117 align:middle line:84%
port scanning on both
TCP ports and UDP ports.

00:01:21.117 --> 00:01:22.950 align:middle line:84%
But this video will
give you an introduction

00:01:22.950 --> 00:01:25.080 align:middle line:84%
to performing port
scanning with Nmap,

00:01:25.080 --> 00:01:27.440 align:middle line:84%
and we'll be covering
quite a few techniques.

00:01:27.440 --> 00:01:31.530 align:middle line:84%
So this video has a lab
environment attached to it

00:01:31.530 --> 00:01:35.970 align:middle line:84%
that you can start up and
follow along if you want to,

00:01:35.970 --> 00:01:39.480 align:middle line:84%
or you can complete this video
and then go ahead and start up

00:01:39.480 --> 00:01:43.260 align:middle line:84%
the lab environment and run
through the instructions

00:01:43.260 --> 00:01:46.230 align:middle line:84%
provided or highlighted
within the lab documentation.

00:01:46.230 --> 00:01:49.470 align:middle line:84%
So I'm just going to switch
over into my lab environment.

00:01:49.470 --> 00:01:53.450 align:middle line:90%


00:01:53.450 --> 00:01:56.570 align:middle line:84%
So I'm currently within
the lab environment.

00:01:56.570 --> 00:01:58.715 align:middle line:84%
This lab environment
will provide you

00:01:58.715 --> 00:02:01.850 align:middle line:84%
with a graphical user
interface or GUI access

00:02:01.850 --> 00:02:03.660 align:middle line:90%
to a Kali Linux system.

00:02:03.660 --> 00:02:06.500 align:middle line:84%
You will also be provided with
the IP address of the target

00:02:06.500 --> 00:02:07.290 align:middle line:90%
system.

00:02:07.290 --> 00:02:09.560 align:middle line:84%
So we're now going
to assume that you've

00:02:09.560 --> 00:02:11.190 align:middle line:84%
selected an IP
address that you'd

00:02:11.190 --> 00:02:13.310 align:middle line:90%
like to perform a port scan on.

00:02:13.310 --> 00:02:16.790 align:middle line:84%
Please do note that in your
case or in your lab environment,

00:02:16.790 --> 00:02:18.720 align:middle line:84%
the target IP address
will be different.

00:02:18.720 --> 00:02:21.330 align:middle line:90%
So just keep that in mind.

00:02:21.330 --> 00:02:24.740 align:middle line:84%
So I'm just going to open up
my terminal here, and let's

00:02:24.740 --> 00:02:27.260 align:middle line:90%
perform the default Nmap scan.

00:02:27.260 --> 00:02:30.260 align:middle line:84%
And I'll be explaining what
the default Nmap scan does.

00:02:30.260 --> 00:02:33.710 align:middle line:84%
So whenever you're using Nmap
and you simply type in Nmap

00:02:33.710 --> 00:02:37.460 align:middle line:84%
and you provide the target IP,
this is a default Nmap scan.

00:02:37.460 --> 00:02:40.730 align:middle line:84%
Now, when you're performing
a default Nmap scan,

00:02:40.730 --> 00:02:44.420 align:middle line:84%
you're essentially performing
a SYN scan on 1,000

00:02:44.420 --> 00:02:46.400 align:middle line:84%
of the most
frequently used ports.

00:02:46.400 --> 00:02:48.380 align:middle line:84%
So you're not scanning
the entire TCP

00:02:48.380 --> 00:02:52.170 align:middle line:84%
range or the entire range of
TCP ports on the target system.

00:02:52.170 --> 00:02:55.250 align:middle line:84%
So I'll just hit
Enter, and you will see

00:02:55.250 --> 00:02:56.660 align:middle line:90%
that we'll run into an issue.

00:02:56.660 --> 00:02:58.670 align:middle line:84%
And the reason we're
running into the issue

00:02:58.670 --> 00:03:00.450 align:middle line:90%
is very important.

00:03:00.450 --> 00:03:03.480 align:middle line:84%
So whenever you're dealing
with Windows target systems,

00:03:03.480 --> 00:03:06.890 align:middle line:84%
and in this case, this is the
IP address of a Windows system,

00:03:06.890 --> 00:03:10.790 align:middle line:84%
Windows systems will
typically block ICMP pings

00:03:10.790 --> 00:03:12.690 align:middle line:90%
or ping probes if you will.

00:03:12.690 --> 00:03:16.760 align:middle line:84%
And as a result, Nmap will tell
us that the host seems down.

00:03:16.760 --> 00:03:18.830 align:middle line:84%
That's because it's
blocking the ping probes.

00:03:18.830 --> 00:03:22.820 align:middle line:84%
So Nmap recommends
disabling or essentially

00:03:22.820 --> 00:03:27.380 align:middle line:84%
avoiding the process
of performing a ping

00:03:27.380 --> 00:03:30.170 align:middle line:84%
or trying to identify
if the host is active.

00:03:30.170 --> 00:03:33.050 align:middle line:84%
And that can be done through
the use of the Pn option.

00:03:33.050 --> 00:03:37.370 align:middle line:84%
So we can specify
this by saying Pn

00:03:37.370 --> 00:03:39.980 align:middle line:84%
and remember we're
still performing

00:03:39.980 --> 00:03:43.430 align:middle line:84%
a port scan on 1,000 of the
most frequently used ports.

00:03:43.430 --> 00:03:46.250 align:middle line:84%
The only difference now is
we're essentially telling Nmap,

00:03:46.250 --> 00:03:48.500 align:middle line:84%
do not check if
this host is online,

00:03:48.500 --> 00:03:50.160 align:middle line:90%
just perform the port scan.

00:03:50.160 --> 00:03:51.530 align:middle line:90%
So I'll hit Enter.

00:03:51.530 --> 00:03:54.020 align:middle line:84%
And you'll see after
a couple of seconds,

00:03:54.020 --> 00:03:57.440 align:middle line:84%
this will provide us with a
list of open ports on the target

00:03:57.440 --> 00:03:58.100 align:middle line:90%
system.

00:03:58.100 --> 00:04:00.950 align:middle line:84%
And it tells us right over
here that the host is up

00:04:00.950 --> 00:04:05.600 align:middle line:84%
and 993 ports are
closed or filtered.

00:04:05.600 --> 00:04:10.610 align:middle line:84%
So that again, vindicates my
point that the default Nmap

00:04:10.610 --> 00:04:14.360 align:middle line:84%
scan performs a port scan on
1,000 of the most frequently

00:04:14.360 --> 00:04:16.130 align:middle line:90%
or most commonly used ports.

00:04:16.130 --> 00:04:20.149 align:middle line:84%
So you can see that this
Nmap will display the output

00:04:20.149 --> 00:04:22.170 align:middle line:90%
in the form of three columns.

00:04:22.170 --> 00:04:24.780 align:middle line:84%
So you have your port, the
state, and the service.

00:04:24.780 --> 00:04:28.460 align:middle line:84%
So in this case, we've
performed a TCP port scan.

00:04:28.460 --> 00:04:30.110 align:middle line:84%
I'll be working
through how to perform

00:04:30.110 --> 00:04:32.520 align:middle line:90%
a UDP port scan as well.

00:04:32.520 --> 00:04:35.240 align:middle line:84%
So you can see we have
port 80, which is open.

00:04:35.240 --> 00:04:38.330 align:middle line:84%
And, of course, that's
used to host a web server.

00:04:38.330 --> 00:04:42.770 align:middle line:84%
And then of course port
135, 139, 445, 3389.

00:04:42.770 --> 00:04:46.070 align:middle line:84%
So from these services
alone, we can pretty much

00:04:46.070 --> 00:04:47.990 align:middle line:84%
tell that this system
is running Windows.

00:04:47.990 --> 00:04:53.610 align:middle line:84%
Now, Nmap can be used to perform
operating system detection.

00:04:53.610 --> 00:04:54.870 align:middle line:90%
We'll get to that shortly.

00:04:54.870 --> 00:04:58.850 align:middle line:84%
But just by taking a look at the
services being displayed here,

00:04:58.850 --> 00:05:01.940 align:middle line:84%
this doesn't display the exact
service or the service version.

00:05:01.940 --> 00:05:03.980 align:middle line:84%
But you can see we
have Microsoft DS.

00:05:03.980 --> 00:05:06.770 align:middle line:90%
Port 3389 is used for RDP.

00:05:06.770 --> 00:05:11.840 align:middle line:84%
And, of course, this is for
139, and 445 are used for SMB.

00:05:11.840 --> 00:05:14.180 align:middle line:84%
And then, of course,
we have about 135,

00:05:14.180 --> 00:05:16.340 align:middle line:90%
which is used for MSRPC.

00:05:16.340 --> 00:05:19.410 align:middle line:84%
And we have a web server
running on the target as well.

00:05:19.410 --> 00:05:23.700 align:middle line:84%
And, of course, we can confirm
this by trying to access.

00:05:23.700 --> 00:05:25.130 align:middle line:90%
I'll just copy the IP here.

00:05:25.130 --> 00:05:26.840 align:middle line:84%
We can try and
access the web server

00:05:26.840 --> 00:05:29.840 align:middle line:84%
by navigating to the target
IP within our browser

00:05:29.840 --> 00:05:31.130 align:middle line:90%
or within Firefox.

00:05:31.130 --> 00:05:34.710 align:middle line:84%
And you can see it's
running an HTTP file server.

00:05:34.710 --> 00:05:37.340 align:middle line:84%
So now, that we've
identified or we've

00:05:37.340 --> 00:05:40.790 align:middle line:84%
taken a look at how to
perform a default Nmap scan,

00:05:40.790 --> 00:05:43.710 align:middle line:84%
let's take a look at
what we can do as well.

00:05:43.710 --> 00:05:47.360 align:middle line:84%
So let's say we wanted to
perform an Nmap port scan

00:05:47.360 --> 00:05:49.940 align:middle line:84%
on the entire
range of TCP ports,

00:05:49.940 --> 00:05:53.600 align:middle line:90%
which is about 65,535 ports.

00:05:53.600 --> 00:05:57.530 align:middle line:84%
Well, after the Pn option,
which is applicable for Windows

00:05:57.530 --> 00:06:00.110 align:middle line:84%
targets, we can
utilize or specify

00:06:00.110 --> 00:06:04.130 align:middle line:84%
the -p- hyphen option, which
will scan the entire TCP port

00:06:04.130 --> 00:06:04.640 align:middle line:90%
range.

00:06:04.640 --> 00:06:09.080 align:middle line:84%
Now, because we're scanning
about 65,535 ports,

00:06:09.080 --> 00:06:11.790 align:middle line:84%
this scan is going to
take a couple of minutes.

00:06:11.790 --> 00:06:13.800 align:middle line:84%
So we're not going
to be doing that.

00:06:13.800 --> 00:06:17.180 align:middle line:84%
But you can also
specify specific ports

00:06:17.180 --> 00:06:18.300 align:middle line:90%
that you'd like to scan.

00:06:18.300 --> 00:06:22.160 align:middle line:84%
So for example, if I wanted
to scan port 80 to see if it's

00:06:22.160 --> 00:06:25.070 align:middle line:90%
open, I can say -p port 80.

00:06:25.070 --> 00:06:26.850 align:middle line:90%
And you can also space this out.

00:06:26.850 --> 00:06:30.920 align:middle line:84%
So I can hit Enter, and you
can see it only scans port 80.

00:06:30.920 --> 00:06:33.950 align:middle line:84%
You can also specify
multiple ports, so maybe

00:06:33.950 --> 00:06:37.460 align:middle line:84%
port 80, port 445,
and port 3389.

00:06:37.460 --> 00:06:40.190 align:middle line:84%
So let's say we want you to
see whether these ports are

00:06:40.190 --> 00:06:42.710 align:middle line:84%
open on the target
system, we can hit Enter.

00:06:42.710 --> 00:06:44.840 align:middle line:84%
And indeed, you can
see they are open.

00:06:44.840 --> 00:06:47.840 align:middle line:84%
If we specify another
port that might

00:06:47.840 --> 00:06:52.700 align:middle line:84%
be closed on this
system like port 80,

00:06:52.700 --> 00:06:55.320 align:middle line:84%
you can see how the
Nmap output will differ.

00:06:55.320 --> 00:06:57.180 align:middle line:84%
So you can see
that in this case,

00:06:57.180 --> 00:06:59.820 align:middle line:84%
it tells us that port
8080 is filtered.

00:06:59.820 --> 00:07:03.500 align:middle line:84%
Now, that means that it
could be the actual target

00:07:03.500 --> 00:07:08.420 align:middle line:84%
system may have a firewall
that is filtering the traffic.

00:07:08.420 --> 00:07:11.360 align:middle line:84%
And this pretty much means that
there is a firewall in place

00:07:11.360 --> 00:07:13.440 align:middle line:90%
or that this port is closed.

00:07:13.440 --> 00:07:15.890 align:middle line:84%
And you can see this port--
the service is typically

00:07:15.890 --> 00:07:20.580 align:middle line:84%
used either by a web
server or an HTTP proxy.

00:07:20.580 --> 00:07:23.690 align:middle line:84%
So that's how to specify
a custom list of ports.

00:07:23.690 --> 00:07:26.660 align:middle line:84%
As I said, you can also
specify the entire range, which

00:07:26.660 --> 00:07:29.480 align:middle line:84%
can be done using
the -p- option,

00:07:29.480 --> 00:07:31.380 align:middle line:84%
or you can specify
the range itself.

00:07:31.380 --> 00:07:38.660 align:middle line:84%
So you can say port
1 to 65,535 like so,

00:07:38.660 --> 00:07:40.580 align:middle line:84%
or you can say I
want you to scan

00:07:40.580 --> 00:07:45.140 align:middle line:84%
ports between the range
of 1 to maybe 10,000.

00:07:45.140 --> 00:07:47.720 align:middle line:84%
So you can also do that
if you want as well.

00:07:47.720 --> 00:07:48.740 align:middle line:90%
So I'll hit Enter.

00:07:48.740 --> 00:07:52.940 align:middle line:84%
This is going to scan the
port range from port 1 all

00:07:52.940 --> 00:07:54.110 align:middle line:90%
the way to 10,000.

00:07:54.110 --> 00:07:57.690 align:middle line:84%
And as you can see, it
does that right over here.

00:07:57.690 --> 00:08:00.260 align:middle line:84%
Now, there are a couple of
other options that you can use.

00:08:00.260 --> 00:08:03.750 align:middle line:84%
The default and Nmap scan scans
1,000 of the most commonly used

00:08:03.750 --> 00:08:04.250 align:middle line:90%
ports.

00:08:04.250 --> 00:08:07.080 align:middle line:84%
But Nmap also has
a fast scan option,

00:08:07.080 --> 00:08:10.220 align:middle line:84%
which will only scan a hundred
of the most commonly used ports

00:08:10.220 --> 00:08:11.540 align:middle line:90%
on the target system.

00:08:11.540 --> 00:08:15.810 align:middle line:84%
That can be done by
specifying the -F option.

00:08:15.810 --> 00:08:17.720 align:middle line:90%
So I'll hit Enter.

00:08:17.720 --> 00:08:19.640 align:middle line:84%
And you can see
that will, again,

00:08:19.640 --> 00:08:22.250 align:middle line:90%
perform a scan on 100 ports.

00:08:22.250 --> 00:08:24.830 align:middle line:84%
So you can see 93 are
filtered or closed

00:08:24.830 --> 00:08:26.240 align:middle line:90%
and the rest are open.

00:08:26.240 --> 00:08:29.780 align:middle line:90%
In this case, about seven ports.

00:08:29.780 --> 00:08:34.070 align:middle line:84%
That is how to specify a custom
port or a custom port range

00:08:34.070 --> 00:08:39.169 align:middle line:84%
if you will and how to specify
the entire range of TCP ports.

00:08:39.169 --> 00:08:42.770 align:middle line:84%
Now, if you want it to
perform a UDP port scan,

00:08:42.770 --> 00:08:45.020 align:middle line:84%
you would need to
use the su option.

00:08:45.020 --> 00:08:48.410 align:middle line:84%
So you can say su
because by default, Nmap

00:08:48.410 --> 00:08:50.610 align:middle line:90%
will perform a TCP port scan.

00:08:50.610 --> 00:08:54.080 align:middle line:90%
So you can say su and hit Enter.

00:08:54.080 --> 00:08:56.600 align:middle line:84%
This is going to take
a couple of seconds

00:08:56.600 --> 00:08:58.400 align:middle line:84%
to a couple of
minutes, depending

00:08:58.400 --> 00:09:01.550 align:middle line:84%
on the target and the
actual network environment

00:09:01.550 --> 00:09:02.630 align:middle line:90%
you're working in.

00:09:02.630 --> 00:09:04.670 align:middle line:84%
I'll also be showing
you shortly how

00:09:04.670 --> 00:09:08.240 align:middle line:90%
to speed up or slow down scans.

00:09:08.240 --> 00:09:11.390 align:middle line:84%
In some cases, you may want
to speed up your scans.

00:09:11.390 --> 00:09:13.100 align:middle line:84%
And in certain
cases, you may want

00:09:13.100 --> 00:09:15.350 align:middle line:84%
to be stealthy and
slow down your scans,

00:09:15.350 --> 00:09:18.770 align:middle line:84%
so that your traffic is
not flagged as malicious.

00:09:18.770 --> 00:09:24.950 align:middle line:84%
Because remember, the current
scenario that we're working on

00:09:24.950 --> 00:09:26.960 align:middle line:84%
or that we are trying
to emulate here

00:09:26.960 --> 00:09:30.410 align:middle line:84%
is that you're now connected
to a company's internal network

00:09:30.410 --> 00:09:32.420 align:middle line:84%
or a company's
network, and you're

00:09:32.420 --> 00:09:35.150 align:middle line:84%
trying to perform a
port scan on the systems

00:09:35.150 --> 00:09:40.955 align:middle line:84%
that you are able to identify
through the host discovery--

00:09:40.955 --> 00:09:43.920 align:middle line:84%
through the host-- or from
the host discovery phase.

00:09:43.920 --> 00:09:45.500 align:middle line:84%
So this is going
to take a while.

00:09:45.500 --> 00:09:47.270 align:middle line:84%
I'm just going to wait
for it to complete.

00:09:47.270 --> 00:09:50.190 align:middle line:84%
You can hit Enter to view
the status of the scan.

00:09:50.190 --> 00:09:54.140 align:middle line:84%
So you can see it'll give you
a percentage indicator here,

00:09:54.140 --> 00:09:58.940 align:middle line:84%
and you can also increase the
verbosity of the scan, which

00:09:58.940 --> 00:10:02.600 align:middle line:84%
means Nmap will display a
more output regarding what

00:10:02.600 --> 00:10:04.200 align:middle line:90%
is going on in the background.

00:10:04.200 --> 00:10:06.200 align:middle line:84%
So I'll walk you
through that shortly.

00:10:06.200 --> 00:10:08.570 align:middle line:84%
I'm just going to wait
for this to complete.

00:10:08.570 --> 00:10:12.500 align:middle line:84%
This should tell us what
UDP ports are currently

00:10:12.500 --> 00:10:14.070 align:middle line:90%
open on the target system.

00:10:14.070 --> 00:10:17.030 align:middle line:84%
So I'm just going to give this
a couple of minutes, about two

00:10:17.030 --> 00:10:19.550 align:middle line:90%
minutes Nmap is saying here.

00:10:19.550 --> 00:10:22.970 align:middle line:84%
And I'll get back to
you when it's done.

00:10:22.970 --> 00:10:23.480 align:middle line:90%
All right.

00:10:23.480 --> 00:10:25.730 align:middle line:90%
The UDP port scan is done.

00:10:25.730 --> 00:10:29.570 align:middle line:84%
And in this case, it tells us
that all 1,000 scanned ports

00:10:29.570 --> 00:10:31.430 align:middle line:84%
on the target are
open or filtered.

00:10:31.430 --> 00:10:33.260 align:middle line:84%
But it doesn't display
the ports, which

00:10:33.260 --> 00:10:37.220 align:middle line:84%
means it is unlikely that
any of the UDP ports are open

00:10:37.220 --> 00:10:38.990 align:middle line:90%
and are running any services.

00:10:38.990 --> 00:10:41.930 align:middle line:84%
But it's always good to
perform a UDP port scan,

00:10:41.930 --> 00:10:47.150 align:middle line:84%
because specific services run on
UDP services like, for example,

00:10:47.150 --> 00:10:47.750 align:middle line:90%
DNS.

00:10:47.750 --> 00:10:50.730 align:middle line:84%
So it's always good to
know how to do that.

00:10:50.730 --> 00:10:53.510 align:middle line:84%
So as I said
previously, you can also

00:10:53.510 --> 00:10:57.260 align:middle line:84%
increase the verbosity of the
output produced by Nmap when

00:10:57.260 --> 00:10:58.370 align:middle line:90%
performing a scan.

00:10:58.370 --> 00:11:01.700 align:middle line:84%
That can be done through the
use of the v options or -v,

00:11:01.700 --> 00:11:03.110 align:middle line:90%
hit Enter.

00:11:03.110 --> 00:11:04.910 align:middle line:84%
And what this will
do is it'll actually

00:11:04.910 --> 00:11:07.020 align:middle line:90%
display output during the scan.

00:11:07.020 --> 00:11:09.530 align:middle line:84%
So it'll tell you what
port has been discovered

00:11:09.530 --> 00:11:13.550 align:middle line:84%
or what port has been
discovered to be open,

00:11:13.550 --> 00:11:15.930 align:middle line:84%
and then it'll display the
results right over here.

00:11:15.930 --> 00:11:18.650 align:middle line:84%
So you can always get
an idea as to what's

00:11:18.650 --> 00:11:20.970 align:middle line:90%
happening in the background.

00:11:20.970 --> 00:11:25.430 align:middle line:84%
So now that we've been able
to identify the open ports

00:11:25.430 --> 00:11:30.020 align:middle line:84%
on the target system, what
we would now need to do

00:11:30.020 --> 00:11:33.590 align:middle line:84%
is identify the specific
services and service versions

00:11:33.590 --> 00:11:35.720 align:middle line:90%
running on those open ports.

00:11:35.720 --> 00:11:37.790 align:middle line:84%
So you can see, we have
all of these open ports.

00:11:37.790 --> 00:11:40.010 align:middle line:84%
And we can identify
more information

00:11:40.010 --> 00:11:42.000 align:middle line:90%
regarding those services.

00:11:42.000 --> 00:11:45.410 align:middle line:84%
So let's say we wanted
to perform a fast scan.

00:11:45.410 --> 00:11:48.080 align:middle line:84%
We can then say we want to
perform a service version

00:11:48.080 --> 00:11:50.450 align:middle line:84%
detection scan
using the sv option.

00:11:50.450 --> 00:11:53.000 align:middle line:90%
So that's -sV.

00:11:53.000 --> 00:11:55.400 align:middle line:84%
We provide the target
IP address there,

00:11:55.400 --> 00:11:56.905 align:middle line:90%
and we can then hit Enter.

00:11:56.905 --> 00:11:58.280 align:middle line:84%
And you'll now
see the difference

00:11:58.280 --> 00:12:01.280 align:middle line:84%
between the two
scans or the scan

00:12:01.280 --> 00:12:02.790 align:middle line:90%
that we performed previously.

00:12:02.790 --> 00:12:05.030 align:middle line:84%
So I'll give this a
couple of seconds.

00:12:05.030 --> 00:12:08.060 align:middle line:84%
Because when you're performing
service version detection scans

00:12:08.060 --> 00:12:09.890 align:middle line:84%
or when you're
trying to identify

00:12:09.890 --> 00:12:12.710 align:middle line:84%
the specific services
and the service versions

00:12:12.710 --> 00:12:14.540 align:middle line:84%
running on these
open ports, it's

00:12:14.540 --> 00:12:17.930 align:middle line:84%
going to take a much
longer or signific--

00:12:17.930 --> 00:12:20.420 align:middle line:90%
or comparatively longer.

00:12:20.420 --> 00:12:23.090 align:middle line:84%
So you can see you can
hit Enter to get an update

00:12:23.090 --> 00:12:26.510 align:middle line:84%
or to get an idea as to how
much of the scan is complete,

00:12:26.510 --> 00:12:29.760 align:middle line:90%
and how much time is remaining.

00:12:29.760 --> 00:12:33.250 align:middle line:84%
So I will give this a couple
of seconds to complete.

00:12:33.250 --> 00:12:33.750 align:middle line:90%
All right.

00:12:33.750 --> 00:12:36.750 align:middle line:84%
So the service version
detection scan is complete.

00:12:36.750 --> 00:12:39.400 align:middle line:84%
And now, Nmap will
output the results.

00:12:39.400 --> 00:12:41.190 align:middle line:84%
And we'll also add
an additional column

00:12:41.190 --> 00:12:43.210 align:middle line:90%
for the version information.

00:12:43.210 --> 00:12:45.240 align:middle line:84%
So you can see well,
in the previous scan,

00:12:45.240 --> 00:12:47.580 align:middle line:84%
we identified the
open ports themselves.

00:12:47.580 --> 00:12:50.010 align:middle line:84%
We now get an idea
as to what services

00:12:50.010 --> 00:12:52.770 align:middle line:84%
and the specific
service versions

00:12:52.770 --> 00:12:54.540 align:middle line:84%
or the version of
the services that

00:12:54.540 --> 00:12:56.380 align:middle line:90%
are running on that open port.

00:12:56.380 --> 00:12:58.260 align:middle line:84%
So in the case of
port 80, we can

00:12:58.260 --> 00:13:02.100 align:middle line:84%
see we have the HTTP
file server version 2.3.

00:13:02.100 --> 00:13:03.880 align:middle line:84%
Why is this
information important?

00:13:03.880 --> 00:13:07.770 align:middle line:84%
Well, for example, we could
essentially try and identify

00:13:07.770 --> 00:13:11.730 align:middle line:84%
vulnerabilities that affect this
specific version of the HTTP

00:13:11.730 --> 00:13:12.870 align:middle line:90%
file server.

00:13:12.870 --> 00:13:15.750 align:middle line:84%
And you can see in the
case of the other ports,

00:13:15.750 --> 00:13:20.130 align:middle line:84%
the SMB port gives us the
actual operating system banner,

00:13:20.130 --> 00:13:22.560 align:middle line:84%
which in this case, tells
us that this system might

00:13:22.560 --> 00:13:25.980 align:middle line:84%
be running Windows
Server 2008 R2 all

00:13:25.980 --> 00:13:28.470 align:middle line:90%
the way to Windows Server 2012.

00:13:28.470 --> 00:13:33.030 align:middle line:84%
Now, we can also perform an
operating system detection

00:13:33.030 --> 00:13:40.050 align:middle line:84%
scan with Nmap by using
the O option so that is -O.

00:13:40.050 --> 00:13:43.200 align:middle line:84%
And that will try and detect
what operating system is

00:13:43.200 --> 00:13:44.580 align:middle line:90%
running on the target system.

00:13:44.580 --> 00:13:47.820 align:middle line:84%
Now, this is not always
conclusive or accurate.

00:13:47.820 --> 00:13:49.560 align:middle line:84%
And in most cases,
it'll give you

00:13:49.560 --> 00:13:52.350 align:middle line:84%
a range of operating
systems that might be

00:13:52.350 --> 00:13:53.830 align:middle line:90%
running on the target system.

00:13:53.830 --> 00:13:55.230 align:middle line:90%
So I'm going to hit Enter.

00:13:55.230 --> 00:13:57.090 align:middle line:84%
And again, we're
going to give this

00:13:57.090 --> 00:14:00.420 align:middle line:84%
a couple of seconds to a
couple of minutes to complete.

00:14:00.420 --> 00:14:01.920 align:middle line:84%
And as I said, if
you'd like to know

00:14:01.920 --> 00:14:03.240 align:middle line:84%
what's going on
in the background,

00:14:03.240 --> 00:14:04.410 align:middle line:90%
let me just terminate that.

00:14:04.410 --> 00:14:07.855 align:middle line:84%
I can just specify that
I want verbose output.

00:14:07.855 --> 00:14:09.480 align:middle line:84%
And you can see it's
going to start off

00:14:09.480 --> 00:14:11.190 align:middle line:90%
by discovering open ports.

00:14:11.190 --> 00:14:12.510 align:middle line:90%
It's then going to perform--

00:14:12.510 --> 00:14:15.060 align:middle line:84%
it's then going to begin
performing the service version

00:14:15.060 --> 00:14:17.040 align:middle line:90%
detection scan.

00:14:17.040 --> 00:14:18.540 align:middle line:90%
And there we are.

00:14:18.540 --> 00:14:21.420 align:middle line:84%
You can see it's going to
complete the SYN Stealth scan.

00:14:21.420 --> 00:14:24.000 align:middle line:84%
It discovers the
open ports there.

00:14:24.000 --> 00:14:26.490 align:middle line:84%
And then it's going
to scan seven services

00:14:26.490 --> 00:14:28.590 align:middle line:84%
to discover the
specific services that

00:14:28.590 --> 00:14:31.260 align:middle line:84%
are running on those open
ports and the versions

00:14:31.260 --> 00:14:34.740 align:middle line:84%
if that information is contained
within the service banner.

00:14:34.740 --> 00:14:36.360 align:middle line:84%
And then after
this is done, it's

00:14:36.360 --> 00:14:40.710 align:middle line:84%
going to then perform an
operating system detection scan

00:14:40.710 --> 00:14:45.090 align:middle line:84%
or operating system guess based
on the open ports on the target

00:14:45.090 --> 00:14:47.550 align:middle line:84%
as well as the banners
or the services

00:14:47.550 --> 00:14:51.100 align:middle line:84%
that are running on those open
ports on the target system.

00:14:51.100 --> 00:14:53.310 align:middle line:84%
So I'm just going to give
this a couple of seconds

00:14:53.310 --> 00:14:55.260 align:middle line:84%
to a couple of
minutes to complete.

00:14:55.260 --> 00:14:59.850 align:middle line:84%
It looks like it's
about 57% done.

00:14:59.850 --> 00:15:01.660 align:middle line:90%
So the Nmap scan is complete.

00:15:01.660 --> 00:15:05.550 align:middle line:84%
And as you can see, it runs
all the options or the checks

00:15:05.550 --> 00:15:07.830 align:middle line:84%
that we wanted the
Nmap scan to perform.

00:15:07.830 --> 00:15:10.170 align:middle line:84%
At the bottom here,
you can see it tells us

00:15:10.170 --> 00:15:13.230 align:middle line:84%
that the operating system scan
results may be unreliable.

00:15:13.230 --> 00:15:15.660 align:middle line:84%
Because we could not
find at least one open

00:15:15.660 --> 00:15:19.360 align:middle line:84%
and one closed port, and then it
tells us-- it gives us a guess,

00:15:19.360 --> 00:15:23.520 align:middle line:84%
essentially that this system
is running Windows Server 2012.

00:15:23.520 --> 00:15:26.790 align:middle line:84%
However, it doesn't give us the
exact edition of Windows Server

00:15:26.790 --> 00:15:27.450 align:middle line:90%
2012.

00:15:27.450 --> 00:15:30.970 align:middle line:84%
But in this case, I can
confirm that this is correct.

00:15:30.970 --> 00:15:33.780 align:middle line:84%
So Nmap, in this case,
has been able to tell us

00:15:33.780 --> 00:15:36.030 align:middle line:84%
what operating system is
running on the target, which

00:15:36.030 --> 00:15:37.170 align:middle line:90%
is very, very important.

00:15:37.170 --> 00:15:39.270 align:middle line:84%
Because as a
penetration tester, you

00:15:39.270 --> 00:15:41.400 align:middle line:84%
could then start
identifying vulnerabilities

00:15:41.400 --> 00:15:44.580 align:middle line:84%
that affect this specific
version of Windows server

00:15:44.580 --> 00:15:48.090 align:middle line:84%
and consequently identify
exploits, and then

00:15:48.090 --> 00:15:51.370 align:middle line:84%
try and gain access to the
target system that way.

00:15:51.370 --> 00:15:54.120 align:middle line:84%
So that is how to identify
the operating system that's

00:15:54.120 --> 00:15:55.680 align:middle line:90%
running on the target system.

00:15:55.680 --> 00:15:59.010 align:middle line:84%
We can also obtain
more information

00:15:59.010 --> 00:16:02.820 align:middle line:84%
from these open ports by
performing a default Nmap

00:16:02.820 --> 00:16:03.870 align:middle line:90%
script scan.

00:16:03.870 --> 00:16:07.920 align:middle line:84%
That can be done by
also including the S--

00:16:07.920 --> 00:16:12.660 align:middle line:84%
So that is -sC So that's
lowercase s, uppercase c

00:16:12.660 --> 00:16:13.590 align:middle line:90%
option there.

00:16:13.590 --> 00:16:15.615 align:middle line:90%
And this will run--

00:16:15.615 --> 00:16:19.470 align:middle line:84%
it'll essentially run
a list of Nmap scripts

00:16:19.470 --> 00:16:23.640 align:middle line:84%
on the ports that are
currently open in order

00:16:23.640 --> 00:16:27.270 align:middle line:84%
to identify more
information or in order

00:16:27.270 --> 00:16:30.330 align:middle line:84%
to enumerate more information
from these open ports.

00:16:30.330 --> 00:16:32.220 align:middle line:90%
So I'll just hit Enter.

00:16:32.220 --> 00:16:33.998 align:middle line:84%
And as I said
previously, I'm just

00:16:33.998 --> 00:16:36.540 align:middle line:84%
going to give this a couple of
seconds to a couple of minutes

00:16:36.540 --> 00:16:37.200 align:middle line:90%
to complete.

00:16:37.200 --> 00:16:40.452 align:middle line:84%
Because the more
options we specify

00:16:40.452 --> 00:16:41.910 align:middle line:84%
or the more
information that we are

00:16:41.910 --> 00:16:44.080 align:middle line:84%
trying to enumerate
from the target system,

00:16:44.080 --> 00:16:46.530 align:middle line:90%
the longer the scan will take.

00:16:46.530 --> 00:16:49.200 align:middle line:84%
But once this is
done, I'll show you

00:16:49.200 --> 00:16:52.440 align:middle line:84%
how this can be sped
up or slowed down

00:16:52.440 --> 00:16:55.890 align:middle line:84%
based on your own requirements
or based on the network

00:16:55.890 --> 00:16:58.090 align:middle line:84%
environment that
you're working in.

00:16:58.090 --> 00:17:02.300 align:middle line:84%
So I'm just going to wait
for this to complete.

00:17:02.300 --> 00:17:04.170 align:middle line:90%
The Nmap scan is complete.

00:17:04.170 --> 00:17:06.349 align:middle line:84%
And as you can see, in
addition to providing us

00:17:06.349 --> 00:17:09.020 align:middle line:90%
with the operating system here--

00:17:09.020 --> 00:17:11.690 align:middle line:84%
the operating system
information here,

00:17:11.690 --> 00:17:14.810 align:middle line:84%
we can see that under
each of these services

00:17:14.810 --> 00:17:18.890 align:middle line:84%
whenever you perform an
Nmap script scan, especially

00:17:18.890 --> 00:17:22.435 align:middle line:84%
with the default Nmap
script scan option

00:17:22.435 --> 00:17:23.810 align:middle line:84%
for each of the
services, it will

00:17:23.810 --> 00:17:28.020 align:middle line:84%
run a series of Nmap scripts
based on the service.

00:17:28.020 --> 00:17:31.070 align:middle line:84%
So in this case, you can see
that it runs a script called

00:17:31.070 --> 00:17:33.860 align:middle line:90%
HTTP favicon, HTTP methods.

00:17:33.860 --> 00:17:37.160 align:middle line:84%
In this case, it tells
you the supported methods

00:17:37.160 --> 00:17:40.580 align:middle line:84%
on this particular web server,
and then the HTTP server

00:17:40.580 --> 00:17:43.400 align:middle line:84%
header, which tells us that
it's running HTTP File Server

00:17:43.400 --> 00:17:44.570 align:middle line:90%
version 2.3.

00:17:44.570 --> 00:17:47.780 align:middle line:84%
And then the HTTP
title script simply

00:17:47.780 --> 00:17:49.730 align:middle line:84%
tells us the title
of the website.

00:17:49.730 --> 00:17:54.200 align:middle line:84%
And under the port 3389,
you can see it runs--

00:17:54.200 --> 00:17:59.120 align:middle line:84%
it essentially runs an RDP
Nmap script that tells you--

00:17:59.120 --> 00:18:01.760 align:middle line:84%
gives you information
regarding the SSL certificate

00:18:01.760 --> 00:18:05.820 align:middle line:84%
pertinent to this
particular service.

00:18:05.820 --> 00:18:08.990 align:middle line:90%
And it also does that--

00:18:08.990 --> 00:18:12.360 align:middle line:84%
or it also does this
for the SMB port.

00:18:12.360 --> 00:18:16.220 align:middle line:84%
So you can see it runs a script
called SMB security mode, which

00:18:16.220 --> 00:18:18.410 align:middle line:84%
tells you whether
the authentication

00:18:18.410 --> 00:18:23.030 align:middle line:84%
level, the challenge response,
and the actual message signing

00:18:23.030 --> 00:18:23.530 align:middle line:90%
status.

00:18:23.530 --> 00:18:25.580 align:middle line:84%
So you can see it's
currently disabled.

00:18:25.580 --> 00:18:29.840 align:middle line:84%
And then it tells you that
the current version of SMB

00:18:29.840 --> 00:18:33.380 align:middle line:90%
is SMB version 2.02.

00:18:33.380 --> 00:18:37.280 align:middle line:84%
And it also gives you the
SMB time or the actual time

00:18:37.280 --> 00:18:40.190 align:middle line:90%
of the system based.

00:18:40.190 --> 00:18:43.740 align:middle line:84%
This is obtained from the
SMB two times script here.

00:18:43.740 --> 00:18:47.150 align:middle line:84%
So that is how to run the
default Nmap script scan.

00:18:47.150 --> 00:18:52.820 align:middle line:84%
Now, we'll not be covering how
to run individual or other Nmap

00:18:52.820 --> 00:18:54.350 align:middle line:90%
scripts.

00:18:54.350 --> 00:18:57.890 align:middle line:84%
That is something that we'll
be exploring in the enumeration

00:18:57.890 --> 00:18:58.490 align:middle line:90%
course.

00:18:58.490 --> 00:19:00.950 align:middle line:84%
For now, you can
simply take a look

00:19:00.950 --> 00:19:05.090 align:middle line:84%
at how to run the
default Nmap script scan.

00:19:05.090 --> 00:19:07.580 align:middle line:84%
So that's how to perform
the Nmap script scan.

00:19:07.580 --> 00:19:11.570 align:middle line:84%
A couple of other Nmap
scan options we can use

00:19:11.570 --> 00:19:13.770 align:middle line:84%
are, for example,
the aggressive scan.

00:19:13.770 --> 00:19:16.310 align:middle line:90%
So what the aggressive scan is--

00:19:16.310 --> 00:19:19.550 align:middle line:84%
the aggressive scan essentially
combines a service version

00:19:19.550 --> 00:19:23.420 align:middle line:84%
detection, operating system
detection, and the default Nmap

00:19:23.420 --> 00:19:24.950 align:middle line:90%
script scan into one.

00:19:24.950 --> 00:19:27.920 align:middle line:84%
And it can be denoted
or it can be specified

00:19:27.920 --> 00:19:33.650 align:middle line:84%
by specifying -A. It'll
essentially just run

00:19:33.650 --> 00:19:36.060 align:middle line:84%
the same scan that
we ran previously,

00:19:36.060 --> 00:19:37.560 align:middle line:90%
which is this scan here.

00:19:37.560 --> 00:19:39.620 align:middle line:84%
So given the fact that
we've already done that,

00:19:39.620 --> 00:19:41.640 align:middle line:90%
we don't need to do it again.

00:19:41.640 --> 00:19:43.820 align:middle line:84%
Now, if you wanted
to speed up a scan,

00:19:43.820 --> 00:19:48.560 align:middle line:84%
you can utilize Nmap
scan timing templates.

00:19:48.560 --> 00:19:52.280 align:middle line:84%
And I'll just open up Nmap
here the, main pages for Nmap,

00:19:52.280 --> 00:19:56.220 align:middle line:84%
and I'll just locate,
for example T4--

00:19:56.220 --> 00:19:56.720 align:middle line:90%
sorry.

00:19:56.720 --> 00:19:59.600 align:middle line:90%
That is -T4.

00:19:59.600 --> 00:20:02.060 align:middle line:84%
So you can see that
Nmap provides you

00:20:02.060 --> 00:20:08.870 align:middle line:84%
with various timing templates
ranging from T0 to T5.

00:20:08.870 --> 00:20:11.030 align:middle line:84%
The lower the number,
the slower the scan.

00:20:11.030 --> 00:20:13.310 align:middle line:84%
And the higher the number,
the faster the scan.

00:20:13.310 --> 00:20:16.910 align:middle line:90%


00:20:16.910 --> 00:20:19.490 align:middle line:84%
Why would you want to speed
up or slow down your scan?

00:20:19.490 --> 00:20:22.250 align:middle line:84%
Well, let me see if I
can identify that here

00:20:22.250 --> 00:20:23.600 align:middle line:90%
under the options summary.

00:20:23.600 --> 00:20:26.743 align:middle line:90%
It should be somewhere here.

00:20:26.743 --> 00:20:27.410 align:middle line:90%
So there we are.

00:20:27.410 --> 00:20:28.850 align:middle line:84%
Under timing and
performance, you

00:20:28.850 --> 00:20:31.590 align:middle line:84%
can specify the timing
template to use.

00:20:31.590 --> 00:20:34.110 align:middle line:90%
So you can see higher is faster.

00:20:34.110 --> 00:20:38.810 align:middle line:84%
And if we actually go to the
timing options just below here

00:20:38.810 --> 00:20:42.660 align:middle line:84%
under the documentation, let
me see if I can find that here.

00:20:42.660 --> 00:20:45.350 align:middle line:84%
So I'll just take a
couple of seconds,

00:20:45.350 --> 00:20:47.480 align:middle line:84%
because I do want to
explain the differences.

00:20:47.480 --> 00:20:52.250 align:middle line:84%
Because they're not only
known by their names,

00:20:52.250 --> 00:20:55.780 align:middle line:84%
but they also have specific
names based on what they do.

00:20:55.780 --> 00:21:01.400 align:middle line:84%
So let's see if I can identify
that under the documentation

00:21:01.400 --> 00:21:04.705 align:middle line:84%
here, because I know it
should be below this here.

00:21:04.705 --> 00:21:14.030 align:middle line:90%


00:21:14.030 --> 00:21:14.970 align:middle line:90%
So here we are.

00:21:14.970 --> 00:21:18.070 align:middle line:84%
So you can see this is used to
specify the timing template.

00:21:18.070 --> 00:21:19.700 align:middle line:90%
So you have paranoid, sneaky.

00:21:19.700 --> 00:21:22.430 align:middle line:84%
So paranoid is all
the way from zero.

00:21:22.430 --> 00:21:24.060 align:middle line:90%
So T0 is paranoid.

00:21:24.060 --> 00:21:26.150 align:middle line:90%
T1 is sneaky.

00:21:26.150 --> 00:21:28.250 align:middle line:90%
T2 is polite.

00:21:28.250 --> 00:21:29.660 align:middle line:90%
T3 is normal.

00:21:29.660 --> 00:21:30.980 align:middle line:90%
T4 is aggressive.

00:21:30.980 --> 00:21:33.110 align:middle line:90%
T5 is insane.

00:21:33.110 --> 00:21:36.630 align:middle line:84%
So this allows you to speed
up or slow down your scan.

00:21:36.630 --> 00:21:39.110 align:middle line:84%
So in certain cases, you may
want to slow down your scan

00:21:39.110 --> 00:21:42.110 align:middle line:84%
if there is an intrusion
detection system

00:21:42.110 --> 00:21:46.310 align:middle line:84%
present on the network, or you
may want to speed up your scan

00:21:46.310 --> 00:21:50.540 align:middle line:84%
if you're trying to essentially
get your scan results as

00:21:50.540 --> 00:21:51.810 align:middle line:90%
quickly as possible.

00:21:51.810 --> 00:21:54.770 align:middle line:84%
So for example, if I wanted
to run this scan faster,

00:21:54.770 --> 00:21:58.640 align:middle line:84%
I could specify the
timing template T4 or T5.

00:21:58.640 --> 00:22:03.410 align:middle line:90%
So I can say T4 or T5.

00:22:03.410 --> 00:22:05.990 align:middle line:84%
Now, by default, Nmap
will automatically

00:22:05.990 --> 00:22:10.070 align:middle line:84%
detect what timing template
to use based on the network

00:22:10.070 --> 00:22:11.870 align:middle line:90%
infrastructure.

00:22:11.870 --> 00:22:13.710 align:middle line:84%
But you can always
overwrite this.

00:22:13.710 --> 00:22:15.260 align:middle line:90%
So let's try and use T5 here.

00:22:15.260 --> 00:22:18.740 align:middle line:84%
This is, of course, not
recommended on any production

00:22:18.740 --> 00:22:21.260 align:middle line:84%
network, because
this will essentially

00:22:21.260 --> 00:22:23.630 align:middle line:84%
increase the amount
of packets being sent.

00:22:23.630 --> 00:22:27.350 align:middle line:84%
And that could potentially
lead to a denial of service

00:22:27.350 --> 00:22:30.420 align:middle line:84%
on the networking equipment
like routers or switches.

00:22:30.420 --> 00:22:32.180 align:middle line:90%
So I'll just hit Enter.

00:22:32.180 --> 00:22:33.860 align:middle line:84%
And you should see
that this is going

00:22:33.860 --> 00:22:38.100 align:middle line:84%
to be much faster than when
we run the scan previously.

00:22:38.100 --> 00:22:42.010 align:middle line:84%
So I'll just give this
a couple of seconds.

00:22:42.010 --> 00:22:45.540 align:middle line:84%
And we should get the actual
results much faster than

00:22:45.540 --> 00:22:50.550 align:middle line:84%
when we had use the default
Nmap timing template or timing

00:22:50.550 --> 00:22:51.750 align:middle line:90%
profile, if you will.

00:22:51.750 --> 00:22:54.400 align:middle line:90%


00:22:54.400 --> 00:22:56.390 align:middle line:90%
So the Nmap scan is complete.

00:22:56.390 --> 00:22:58.420 align:middle line:84%
Now, this is the
previous Nmap scan

00:22:58.420 --> 00:23:03.100 align:middle line:84%
that we ran without the
timing template or the timing

00:23:03.100 --> 00:23:04.460 align:middle line:90%
profile specified.

00:23:04.460 --> 00:23:06.490 align:middle line:90%
So you can see it here.

00:23:06.490 --> 00:23:10.430 align:middle line:84%
Let me see if I can identify
the actual Nmap scan.

00:23:10.430 --> 00:23:11.890 align:middle line:84%
So you can see no
timing template,

00:23:11.890 --> 00:23:14.230 align:middle line:84%
and we take a look at the
summary at the bottom.

00:23:14.230 --> 00:23:17.830 align:middle line:84%
Nmap will actually tell you
how long this scan took.

00:23:17.830 --> 00:23:20.140 align:middle line:84%
So that was without
the scanning--

00:23:20.140 --> 00:23:21.850 align:middle line:90%
without the timing template.

00:23:21.850 --> 00:23:25.360 align:middle line:84%
And then this one right over
here took about 119 seconds.

00:23:25.360 --> 00:23:27.310 align:middle line:84%
So in the grand
scheme of things,

00:23:27.310 --> 00:23:29.080 align:middle line:84%
it may not look
like an improvement.

00:23:29.080 --> 00:23:32.560 align:middle line:84%
But when you're scanning an
increased number of ports

00:23:32.560 --> 00:23:35.740 align:middle line:84%
and maybe if you're scanning
more than one system,

00:23:35.740 --> 00:23:41.050 align:middle line:84%
then the utilizing the timing
templates will be a huge help.

00:23:41.050 --> 00:23:43.480 align:middle line:84%
So you can also slow
it down if required.

00:23:43.480 --> 00:23:47.080 align:middle line:84%
As I said, it's all based or
all dependent on the environment

00:23:47.080 --> 00:23:49.480 align:middle line:90%
that you are working on.

00:23:49.480 --> 00:23:51.550 align:middle line:84%
One of the final options
that I want to highlight

00:23:51.550 --> 00:23:53.530 align:middle line:84%
or that I want to
cover is the ability

00:23:53.530 --> 00:23:56.440 align:middle line:84%
to output your Nmap scan
results into a file, which

00:23:56.440 --> 00:23:59.260 align:middle line:84%
is very, very important
during a penetration test.

00:23:59.260 --> 00:24:02.420 align:middle line:84%
Because you always need to
be documenting whatever you

00:24:02.420 --> 00:24:02.920 align:middle line:90%
are doing.

00:24:02.920 --> 00:24:04.780 align:middle line:84%
And in the case
of port scans, you

00:24:04.780 --> 00:24:06.370 align:middle line:84%
need to make sure
that all of the port

00:24:06.370 --> 00:24:08.410 align:middle line:84%
scans you're performing
are saved somewhere.

00:24:08.410 --> 00:24:10.720 align:middle line:84%
So that you can always
refer back to it.

00:24:10.720 --> 00:24:13.340 align:middle line:84%
So that you don't have to go
through this process again.

00:24:13.340 --> 00:24:16.408 align:middle line:84%
So Nmap allows you to output
into three main formats.

00:24:16.408 --> 00:24:18.200 align:middle line:84%
I'm just going to be
exploring two of them.

00:24:18.200 --> 00:24:20.620 align:middle line:84%
One of them is the normal
format, which will essentially

00:24:20.620 --> 00:24:23.140 align:middle line:84%
output the scan results
in the same way they

00:24:23.140 --> 00:24:27.160 align:middle line:84%
are displayed on the terminal
into a file of your choice.

00:24:27.160 --> 00:24:30.760 align:middle line:84%
In most cases, you can
specify or output the results

00:24:30.760 --> 00:24:32.180 align:middle line:90%
into a txt file.

00:24:32.180 --> 00:24:36.730 align:middle line:84%
So I'm just going to
say -oN and the file

00:24:36.730 --> 00:24:41.740 align:middle line:84%
that we're going to be exporting
the scan results to is called

00:24:41.740 --> 00:24:43.210 align:middle line:90%
test.txt.

00:24:43.210 --> 00:24:45.800 align:middle line:90%
So I'll just hit Enter.

00:24:45.800 --> 00:24:49.310 align:middle line:84%
And now, if I kept the
contents of test.txt,

00:24:49.310 --> 00:24:51.590 align:middle line:84%
you can see that
it should actually

00:24:51.590 --> 00:24:53.000 align:middle line:90%
display the same information.

00:24:53.000 --> 00:24:54.350 align:middle line:90%
There we are.

00:24:54.350 --> 00:24:57.650 align:middle line:84%
The other output
format is xml format.

00:24:57.650 --> 00:25:02.090 align:middle line:84%
That is very useful because
you can essentially output--

00:25:02.090 --> 00:25:06.380 align:middle line:84%
this output can be imported into
a framework like Metasploit.

00:25:06.380 --> 00:25:11.912 align:middle line:84%
So I can say oX and I can then
change the file to an xml file.

00:25:11.912 --> 00:25:12.620 align:middle line:90%
So I'll just hit.

00:25:12.620 --> 00:25:15.380 align:middle line:84%
Enter and you should
see that the format,

00:25:15.380 --> 00:25:18.020 align:middle line:84%
if we get the
content of test.xml,

00:25:18.020 --> 00:25:22.130 align:middle line:84%
the format should be in xml
format as you can see here.

00:25:22.130 --> 00:25:25.310 align:middle line:84%
So that is going to conclude
the practical demonstration

00:25:25.310 --> 00:25:28.810 align:middle line:90%
side of this video.

00:25:28.810 --> 00:25:31.940 align:middle line:84%
So that was the final
video within this course.

00:25:31.940 --> 00:25:35.290 align:middle line:84%
So we have now been able
to successfully explore

00:25:35.290 --> 00:25:38.200 align:middle line:84%
both passive and active
information gathering.

00:25:38.200 --> 00:25:44.650 align:middle line:84%
As I said, this is not
entirely conclusive

00:25:44.650 --> 00:25:47.080 align:middle line:84%
when it comes down to
information gathering.

00:25:47.080 --> 00:25:49.930 align:middle line:84%
We will be exploring
enumeration,

00:25:49.930 --> 00:25:53.290 align:middle line:84%
which is another aspect
of active information

00:25:53.290 --> 00:25:54.970 align:middle line:90%
gathering in its own course.

00:25:54.970 --> 00:25:58.360 align:middle line:84%
Because that is something that
requires its own course because

00:25:58.360 --> 00:26:03.790 align:middle line:84%
of the depth involved and
the large amount of services

00:26:03.790 --> 00:26:06.910 align:middle line:84%
that you are required or
that you should know how

00:26:06.910 --> 00:26:09.560 align:middle line:90%
to enumerate information from.

00:26:09.560 --> 00:26:12.580 align:middle line:84%
So that is going to
conclude this course.

00:26:12.580 --> 00:26:15.850 align:middle line:84%
And I'll be seeing you in
the course conclusion video

00:26:15.850 --> 00:26:17.500 align:middle line:90%
up next.

00:26:17.500 --> 00:26:18.000 align:middle line:90%