WEBVTT

00:01.610 --> 00:09.350
Specifying port ranges to make scans more efficient in this video we will review the pros and cons of

00:09.350 --> 00:16.650
doing a full scan of target hosts even if they don't respond to host discovery we'll use and maps tack

00:16.740 --> 00:25.320
capital F Flegg to perform what's called a fast scan and we'll use n maps top Portes option to narrow

00:25.320 --> 00:28.350
down the number of ports that will be scanned on each host.

00:31.230 --> 00:35.700
In our last video we learned about a few different things and mapped those to figure out whether or

00:35.700 --> 00:38.400
not a host is live on the network.

00:38.400 --> 00:46.170
We also learned about how to use the tech capital P lowercase an option to force and map to scan every

00:46.170 --> 00:50.380
target IPN range whether it responds to a host discovery or not.

00:51.210 --> 00:52.550
Just to close out that discussion.

00:52.560 --> 00:59.490
I wanted to show you how long it took nmap to scan a single class C range with just a few hosts being

00:59.490 --> 01:03.710
live this much time to scan a single subnet.

01:03.720 --> 01:10.950
In my opinion is too long if your project requires you to scan and network to this detail I'd recommend

01:10.950 --> 01:16.250
arranging some sort of remote access to the client's site in order to manage your scans remotely.

01:16.260 --> 01:21.710
Either that or invest in a blow up mattress and ask the client if they mind you sleeping in the breakroom

01:24.390 --> 01:26.970
before we look at ways to scan more efficiently.

01:26.970 --> 01:33.500
Let's revisit something we talked about in previous videos when you run and map with no additional flags

01:34.100 --> 01:42.650
by default and map is going to scan the top 1000 ports these top 1000 ports are defined by the map tech

01:42.710 --> 01:50.300
services list and we previously used this nifty command in order to see what those specific top 1000

01:50.300 --> 01:52.030
ports were.

01:52.070 --> 01:59.430
I'm going to pipe this output to the more command to see output one screen at a time.

01:59.490 --> 02:05.190
Let's say that I know my target environment has nothing but web servers a few email servers and maybe

02:05.190 --> 02:06.970
a couple of database servers.

02:07.800 --> 02:14.070
I might then be able to get away with only scanning the top 100 ports in this list and I can do that

02:14.070 --> 02:15.210
a few different ways.

02:17.150 --> 02:24.050
First I can add the TAC capital F Flegg to my scan which is also referred to as a fast scan

02:26.670 --> 02:36.450
or I can do the same thing by specifying the tack tack top tech Portes flag and add a number of my choosing

02:36.660 --> 02:37.350
like 200

02:43.780 --> 02:51.490
We can also do port specification by calling individual ports or groups of ports with the TAC P Flag.

02:52.300 --> 03:00.810
For example I could scan for web servers with port 80 then add a comma and put in four 4 three for secure

03:00.810 --> 03:01.750
web sites.

03:02.620 --> 03:06.820
Then add another comma and add 53 for DNS servers.

03:08.280 --> 03:15.960
And then let's say I've got a proprietary web app that uses range of ports from sixty five thousand

03:16.410 --> 03:19.370
to sixty five thousand one hundred.

03:19.470 --> 03:22.180
So I specify that port range like so.

03:22.180 --> 03:28.210
Now remember when we're doing our top ports scans we're only hitting TCAP ports by default.

03:28.470 --> 03:33.540
So don't forget about UDP ports which can host important services as well.

03:33.540 --> 03:40.500
If we want to look at that and map services file again and see just the top UDP ports we can issue that

03:40.500 --> 03:48.810
sort command again and then pipe the output to a grepped command that will grab any lines with UDP in

03:48.810 --> 03:50.790
them.

03:50.810 --> 03:56.820
I'm also going to pipe that again to the more command so we can see output one screen at a time.

03:57.830 --> 04:08.980
If we want to scan the top 1000 UDP ports we run and map with the TAC s capital you flake like this.

04:09.130 --> 04:19.860
And then if we wanted to throttle that down to just the top 100 ports we add in the top ports qualifier.

04:19.920 --> 04:27.990
How about if we wanted to hit the top TCAP and UDP ports for a given range but do so in a single command

04:30.560 --> 04:38.510
Well we can simply add a t to this flag which essentially tells and map to scan TCAP ports which is

04:38.510 --> 04:47.650
represented by the T as well as UDP ports represented by the capital you.

04:47.700 --> 04:53.820
So as you can see by limiting the number of ports we scan we can reduce the scope of our scan and make

04:53.820 --> 04:54.980
it more efficient.

04:57.310 --> 05:03.280
In our next video we'll start looking at various ways we can export and report on data collected during

05:03.280 --> 05:04.250
our scans.
