NMAP, which stands for Network Mapper, is a free and open-source tool that can be used for network discovery and security auditing. Its tasks include network inventory, managing service upgrade schedules, and monitoring host and service uptime, among other things.
There are different ways to install NMAP on a macOS system. Here’s a detailed step-by-step on how to install it:
Method 1: Install using Homebrew
Before proceeding, install the Homebrew package manager for macOS, if you haven’t done already.
1. Open Terminal on your mac.
2. To install Homebrew, paste this command on Terminal: /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)“
3. After you installed Homebrew, you can install NMAP by typing brew install nmap in the Terminal.
4. To check if NMAP is installed correctly, type nmap in your terminal.
Method 2: Build and install from source
Before proceeding, install Xcode and Xcode Command Line Tools if you haven’t done already.
1. Open Terminal on your mac.
2. Go to the official NMAP site and download the latest stable tarball.
3. Unpack the tarball by right-clicking on it and selecting “Open With” and then “Archive Utility.“
4. Navigate to the NMAP directory by typing cd /path/to/nmap directory in the Terminal.
5. Compile and install NMAP by typing the following commands one by one:
./configure
make
sudo make install
To know if NMAP is installed correctly, type nmap in your terminal.
Both methods should provide you with a correctly installed version of NMAP. The biggest difference is how updates are handled – Homebrew will automatically update NMAP along with other packages when the brew update command is invoked. The version built from source will remain at the same version until the process is repeated.
Reference:
1. NMAP Official site [https://nmap.org/]
2. Homebrew Official site [https://brew.sh/]
3. NMAP Guide: From Novice to Professional, by Gordon Lyon [https://www.academia.edu/download/41470663/Nmap_Network_Scanning_The_Official\_Nma20160123-31501-if3woz.pdf]
4. Apple Developer Documentation [https://developer.apple.com/documentation/]