WEBVTT

00:01.100 --> 00:04.790
Section for tuning and map scans.

00:04.790 --> 00:05.910
Welcome to the video.

00:05.930 --> 00:13.160
Finding live hosts on the network in this video we will perform a quick sanity check to ensure the hosts

00:13.160 --> 00:16.400
we are going to scan include all the subnets in scope.

00:17.190 --> 00:23.770
We'll explore some ways to discover the Live hosts on those subjects and we'll save the live hosts to

00:23.770 --> 00:29.640
a text file for more efficient scanning later on as we discussed in past videos.

00:29.660 --> 00:34.490
If you're going to be doing vulnerability scanning for your corporate network or client networks you

00:34.490 --> 00:40.310
won't likely be examining just a single subnet a client might have you scanned hundreds or thousands

00:40.310 --> 00:41.590
of machines.

00:41.840 --> 00:47.150
So it's important for us to be able to know some ways we can leverage and map to make our scans run

00:47.210 --> 00:48.840
as efficiently as possible.

00:49.880 --> 00:55.970
One tip we talked about is having a text file created that has each of your targets subnets in it one

00:55.970 --> 00:57.830
sudden per line.

00:58.060 --> 01:06.700
We can then call that file and map scan by using the TAC lowercase i capital L command and then reference

01:06.700 --> 01:09.030
our file with the list of subnets in it.

01:11.110 --> 01:16.330
In cases like these you might just want to do a quick sanity check on the targets you're going to scan

01:16.750 --> 01:20.050
before you actually begin the scan itself.

01:20.050 --> 01:27.720
You can do that by using nmap map with the Ptak lowercase s capital L command which stands for list

01:27.720 --> 01:37.040
scan and then again we can call our submits file with the TAC lowercase i capital L and our subnet statics

01:37.060 --> 01:38.910
t file.

01:38.910 --> 01:43.700
Note that this scan does not send any traffic to the target hosts.

01:43.700 --> 01:48.840
And if we want to save this off to a file for our client to review before we kick off the more intrusive

01:48.840 --> 01:54.890
scans we can use a greater than sign and a file name to do just that.

01:56.800 --> 01:57.100
OK.

01:57.110 --> 02:02.660
So let's say the client gives us the OK to scan all these networks and they tell us that everything

02:02.660 --> 02:05.390
in their network responds to a ping.

02:05.450 --> 02:11.150
In that case one initial scan that can save us some time is a ping scan which we covered in earlier

02:11.150 --> 02:12.190
videos.

02:12.500 --> 02:22.280
That's just and map plus TAC lowercase s n and the TAC lowercase i n capital L plus our target subnet

02:22.280 --> 02:23.690
file.

02:23.940 --> 02:30.660
And if we want to save those results off to a file called Live hosts XTi again we just use the greater

02:30.660 --> 02:34.100
than sign and the file name.

02:34.130 --> 02:39.290
However remember that if we're going to use this file for later scanning operations and map needs the

02:39.290 --> 02:42.990
file to have one host or subnet per line.

02:43.490 --> 02:46.860
And right now we've got a bunch of extra information in our output.

02:47.000 --> 02:51.790
That map won't understand so to whittle that output down a little.

02:52.020 --> 02:54.980
Let's pull out a command we used in a past video.

02:55.190 --> 03:00.420
Again don't be turned off by this foreign looking command as we'll learn more about our putting our

03:00.420 --> 03:03.510
scan in various formats in future videos.

03:03.810 --> 03:11.060
For now just know that this scan is conducting our ping scan against the subnets start textfile and

03:11.060 --> 03:14.090
then using grep and awk commands.

03:14.330 --> 03:19.290
It filters out everything from the output except the list of IP addresses.

03:20.570 --> 03:26.590
And then we'll save that to a file called Live hosts here XTi.

03:26.660 --> 03:32.210
Also remember that if we want to see the progress of the scan in real time we can open up a new terminal

03:32.210 --> 03:41.750
window and do a tail space task f plus the live hosts textfile OK.

03:41.900 --> 03:42.870
So we're all set.

03:44.200 --> 03:50.410
Now in past engagements a common scenario I've run into is halfway through obtaining my nice clean list

03:50.410 --> 03:51.970
of live IPs.

03:51.980 --> 03:56.830
The customer says Oh whoops I forgot to tell you about this one other sudden that we have.

03:56.830 --> 04:04.290
Can you scan that to well it's easy enough to do this by making a few tweaks to the last command.

04:04.320 --> 04:12.500
I'm going to remove the tech space i l and subnet list since we've already scanned that and I'm going

04:12.500 --> 04:20.570
to replace it with the new subnet that the customer gave me the one other minor but very important change

04:20.630 --> 04:28.530
I'm going to make is I'm going to add another greater than sign before the live hosts Dottie XTi the

04:28.530 --> 04:34.950
reason for that is that if you are writing output to a file a single greater than sign essentially means

04:35.460 --> 04:38.280
creating a file with this output.

04:38.280 --> 04:42.340
And in our case we're using a file called Live hosts Dotti XTi.

04:42.420 --> 04:52.010
But if I run another scan later and send the output to live host 60 the original Live host will be overwritten.

04:52.020 --> 05:00.920
However if I run a command and then use to greater than signs any output from my scan is appended to

05:00.920 --> 05:03.470
the end of the original file.

05:03.490 --> 05:07.390
So let's let this command run and then we'll look at our results again.

05:08.700 --> 05:16.940
Here we see a newly discovered Host 1 9 2 1 6 8 6 6 has been appended to the bottom of our Live hosts

05:17.410 --> 05:18.060
file.

05:19.410 --> 05:26.290
So we found all the live hosts on our network and we're clear to proceed with more intrusive scans.

05:26.400 --> 05:31.170
But let's say the customer told us that some of the hosts we'd be scanning might not be discoverable

05:31.170 --> 05:32.070
by pinging.

05:32.370 --> 05:38.010
And that to be safe we should just thoroughly scan every host as if we assumed it was up and live on

05:38.010 --> 05:39.540
the network.

05:39.670 --> 05:46.240
That is doable with a simple and map Flegg change but to demonstrate the time overhead we introduce.

05:46.270 --> 05:50.650
Let's go back and quickly look at a basic and map scan.

05:50.730 --> 06:01.580
So I'm just going to run and map scan with no flags against just 10 hosts in my 1 9 2 1 6 8 3 x network.

06:01.820 --> 06:08.270
When you run a scan this way and map does a few things to see if it can determine that the host is live.

06:08.400 --> 06:19.680
It sends an ICMP echo request a TCAP send packet to port 443 a TZP ack packet to port 80 and an ICMP

06:19.680 --> 06:22.050
time stamp request.

06:22.260 --> 06:28.440
If a host responds to one of these queries it receives a standard nmap scan of the thousand most common

06:28.440 --> 06:32.250
ports which we discussed in previous videos.

06:32.270 --> 06:38.060
This is a pretty lean and mean scan and as we can see and map found the live hosts in this network range

06:38.150 --> 06:42.850
and completed in just a little over six seconds.

06:42.870 --> 06:49.140
Now if we need to do that same scan again but operate on the assumption that all hosts are alive which

06:49.140 --> 06:51.960
again we might want to do just to be thorough.

06:51.960 --> 07:01.230
We can conduct the scan with TAC capital P and small n what this does is it skips the host discovery

07:01.230 --> 07:08.560
portion and jumps right to port scanning as you'll see this adds significant time to our scan and map

07:08.560 --> 07:13.630
spent a lot of time port scanning hostes that were dead on my network.

07:13.690 --> 07:19.000
So it seems like it would be helpful for us to be able to fine tune our scans and try to strike a fine

07:19.000 --> 07:25.660
balance between thoroughness and speed so that our scans are conducted as accurately as possible but

07:25.660 --> 07:30.090
also finish in our lifetime in our next video.

07:30.250 --> 07:34.370
We'll look at specifying port ranges to make our scans more efficient.
