Checking for Live Systems 109
To use the ping command in Windows, enter the following at the command prompt,
ping
or:
ping
In most Linux versions, the command is essentially the same.
Although you can ping by either IP address or hostname, it is better to
get in the habit of pinging by IP address first before moving to the host-
name method. If you use the hostname first and receive no reply, this may
indicate a DNS problem rather than an unavailable system. On the other
hand, pinging by IP address should always tell you whether the system is
available.
There is another way to ping a remote system that you should be aware of: performing a
ping using Nmap. At the Windows or Linux command prompt, enter the following:
NMAP –sP –v
If the command successfully finds a live host, it returns a message stating that the IP
address is up and provides the media access control (MAC) address and the network card
vendor (if it is able to determine this last piece of information).
I can’t stress this enough for the CEH exam: You must know how to use
Nmap. If you don’t, you will have serious trouble in your exam preparation
and test-taking process—not to mention you will need the skills for the
real world. Think of Nmap as a Swiss Army knife. It does a lot of different
things, each helpful in its own way. I highly recommend taking Nmap for a
long test-drive during your studying, learning what each switch and option
does and what the results look like. If you want to go above and beyond,
visit http://nmap.org and read the reference guide, which goes into much
greater depth than I can here.
Moving up one more level from the ICMP scan is the ping sweep, so named because
you use this technique to scan or sweep a range of IPs looking for hosts that are live. Once
again Nmap proves helpful by allowing you to perform a quick scan. To do this with
Nmap, simply enter the following command:
nmap –sP –PE –PA
Here’s an example, with port numbers and IPs specified:
nmap –sP –PE –PA21,23,80,3389 <192.168.10.1-50>