Setting up and using NMap

Setting up and using NMap

Nmap (Network Mapper) is a security scanner, used to discover hosts and services on a computer network, thus creating a “map” of the network.

Typical uses of Nmap:

  •  Auditing the security of a device, by identifying the network connections which can be made to it.
  •  Identifying open ports on a target host in preparation for auditing.
  • Network inventory, Network mapping, maintenance, and asset management.
  • Auditing the security of a network, by identifying unexpected new servers.

1-a) Installation – Linux

  • Download the latest version of Nmap in .tar.bz2 (bzip2 compression) or .tgz (gzip compression) format from here
  • Decompress the downloaded tarball with a command such as:

                              bzip2 -cd nmap-<VERSION>.tar.bz2 | tar xvf –

                                                 If you downloaded the .tgz version, replace bzip2 with gzip in the decompression command.

  • Change into the newly created directory: cd nmap-<VERSION>
  • Configure the build system: ./configure
  • If the configuration succeeds, an ASCII art dragon appears, as shown below.

  • Build Nmap : make ; if make returns a bunch of errors, try running gmake instead.
  • Become a privileged user for system-wide install: su root
  • Install Nmap, support files, docs, etc.: make install

    Congratulations! Nmap is now installed as /usr/local/bin/nmap

1-b) Installation – Windows

  • Download the .zip binaries from here.
  • Uncompress the zip file into the directory you want Nmap to reside in.
  • Nmap requires the free WinPcap packet capture library. You can use the inbuild or download on from here
  • You will need Microsoft Visual C++ 2008 Redistributable Package of runtime components.
  • Complete the installation.
  • Once installed navigate to the folder where it is installed and try the command sowhn in the screenshot.