Home > Network Management > Nmap on FreeBSD / OpenBSD / NetBSD

Nmap on FreeBSD / OpenBSD / NetBSD

July 4th, 2009

(“Network Mapper”) is a free and open source utility for network exploration or security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime.

Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics.

The BSD flavors are well supported by Nmap..

So you can simply compile it from source as described in the section called “Unix Compilation and Installation from Source Code”. This provides the normal advantages of always having the latest version and a flexible build process. If you prefer binary packages, these *BSD variants each maintain their own Nmap packages.

Many BSD systems also have a ports tree which standardizes the compilation of popular applications. Instructions for installing Nmap on the most popular *BSD variants follow.

OpenBSD Binary Packages and Source Ports Instructions

According to the OpenBSD FAQ, users “are HIGHLY advised to use packages over building an application from ports. The OpenBSD ports team considers packages to be the goal of their porting work, not the ports themselves.” That same FAQ contains detailed instructions for each method. Here is a summary:

Installation using binary packages

  1. Choose a mirror from http://www.openbsd.org/ftp.html, then FTP in and grab the Nmap package from /pub/OpenBSD/<version>/packages/<platform>/nmap-<version>.tgz. Or obtain it from the OpenBSD distribution CD-ROM.
  2. As root, execute: pkg_add -v nmap-<version>.tgz

Installation using the source ports tree

  1. If you do not already have a copy of the ports tree, obtain it via CVS using instructions at http://openbsd.org/faq/faq15.html.
  2. As root, execute the following command (replace /usr/ports with your local ports directory if it differs):cd /usr/ports/net/nmap && make install clean

FreeBSD Binary Package and Source Ports Instructions

The FreeBSD project has a whole chapter in their Handbook describing the package and port installation processes. A brief summary of the process follows.

Installation of the binary package

The easiest way to install the binary Nmap package is to run pkg_add -r nmap. You can then run the same command with the zenmap argument if you want the X-Window front-end. If you wish to obtain the package manually instead, retrieve it from http://freshports.org/security/nmap and http://freshports.org/security/zenmap or the CDROM and run pkg_add <packagename.tgz>.

Installation using the source ports tree

  1. The ports tree is often installed with the system itself (usually in /usr/ports). If you do not already have it, specific installation instructions are provided in the FreeBSD Handbook chapter referenced above.
  2. As root, execute the following command (replace /usr/ports with your local ports directory if it differs):cd /usr/ports/security/nmap && make install clean

NetBSD Binary Package Instructions

NetBSD has packaged Nmap for an enormous number of platforms, from the normal i386 to PlayStation 2, PowerPC, VAX, SPARC, MIPS, Amiga, ARM, and several platforms that I have never even heard of! Unfortunately they are not very up-to-date. A list of NetBSD Nmap packages is available from ftp://ftp.netbsd.org/pub/NetBSD/packages/pkgsrc/net/nmap/README.html and a description of using their package system to install applications is available at http://netbsd.org/Documentation/pkgsrc/using.html.

Recommended reading:

Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security ScanningNmap Network Scanning: The Offic…
by Gordon Lyon

Categories: Network Management Tags:
Comments are closed.