- Nmap Network Scanning
- Chapter 2. Obtaining, Compiling, Installing, and Removing Nmap
- Windows
While Nmap was once a Unix-only tool, a Windows version was
released in 2000 and has since become the second most popular Nmap
platform (behind Linux). Because of this popularity and the fact that
many Windows users do not have a compiler, binary executables are
distributed for each major Nmap release. We support Nmap on Windows 7
and newer, as well as Windows Server 2008 and newer. We also maintain
a guide for users
who must run Nmap on earlier Windows releases.
Nmap runs equally well on Windows as on Unix in nearly every way, though there are a couple of known limitations:
-
Nmap only supports ethernet interfaces (including most
802.11 wireless cards and many VPN clients) for raw packet scans.
Unless you use the-sT -Pn
options, RAS connections
(such as PPP dialups) and certain VPN clients are not supported. This
support was dropped when Microsoft removed raw TCP/IP socket support
in Windows XP SP2. Now Nmap must send lower-level ethernet frames
instead. -
When using Nmap without Npcap, you cannot
generally scan your own machine from itself (using a
loopback IP such as 127.0.0.1 or any of its
registered IP addresses). This is a Windows limitation that we
have worked around in Npcap, which is included in the Windows self-installer.
Users stuck without a Npcap installation can use a TCP
connect scan without pinging (-sT -Pn
) as that uses
the high level socket API rather than sending raw
packets.
Scan speeds on Windows are generally comparable to those on
Unix, though the latter often has a slight performance edge. One
example of this is connect scan (-sT
), which may be
slower on Windows because of different limits in the Windows
networking API. Since this is the one TCP scan that
works over all networking types (not just ethernet, like the raw packet scans),
Nmap includes a collection of Registry changes that substantially improve connect scan performance.
By default these changes are applied for you by the Nmap executable installer, and are also available in the
nmap_performance.reg
file
in the nmap-
<version>
directory of the Windows binary zip file (for Nmap OEM customers), and
nmap-
<version>
/mswin32
in the source tarball (where <version>
is the
version number of the specific release). These changes increase
the number of ephemeral ports reserved for user applications (such as
Nmap) and reduce the time delay before a closed connection can
be reused. Most people simply check the box to apply these changes in the executable Nmap installer, but you can also apply them by double-clicking on
nmap_performance.reg
, or by running the command
regedt32 nmap_performance.reg. To make the changes by hand, add these three Registry DWORD values to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
:
- MaxUserPort
-
Set a large value such as 65534 (0x0000fffe). See MS KB 196271.
- TCPTimedWaitDelay
-
Set the minimum value (0x0000001e). See MS KB 149532.
- StrictTimeWaitSeqCheck
-
Set to 1 so TCPTimedWaitDelay is checked.
Windows users have three choices for installing
Nmap, all of which are available from the
download page at https://nmap.org/download.html
.
Windows Self-installer
Every Nmap release includes a Windows
self-installer named
nmap-
<version>
-setup.exe
(where <version>
is the version number of the
specific release). Most Nmap users choose this option since it is so
easy. Another advantage of the self-installer is that it provides the option to install the Zenmap GUI and other tools. Simply run the installer file and let it walk you through
panels for choosing an install path and installing Npcap. The
installer was created with the open-source Nullsoft Scriptable
Install System. After it completes, read the section called “Executing Nmap on Windows” for instructions on executing Nmap on the
command-line or through Zenmap.
Command-line Zip Binaries
Note | |
---|---|
The Zip archive is available to Nmap OEM customers only. Most users prefer installing Nmap with the self-installer discussed previously. |
Every stable Nmap OEM release is also available as Windows
command-line binaries and associated files in a Zip archive. No
graphical interface is included, so you need to run
nmap.exe
from a DOS/command window.
Here are the step-by-step instructions for installing and executing the Nmap .zip binaries.
Installing the Nmap zip binaries
-
Download the .zip binaries from the link provided in your Nmap OEM order.
-
Extract the zip file into the directory you want
Nmap to reside in. An example would beC:\Program
. A directory called
Files
nmap-
should be created, which includes<version>
the Nmap executable and data files. -
For improved performance, apply the Nmap Registry
changes discussed previously. -
Nmap requires the free Npcap packet capture library.
We include a recent Npcap installer which is available in the zip file
asnpcap-
,<version>
-oem.exe
where<version>
is the Npcap version rather
than the Nmap version. Alternatively, you can obtain and install
the latest version fromhttps://npcap.com
. -
Due to the way Nmap is compiled, it requires the
Microsoft Visual C++ Redistributable Package of runtime
components. Many systems already have this installed from other
packages, but you should runvc_redist.x86.exe
from the zip file just in case you need it.
Pass the/q
option to run these installers in quiet (non interactive) mode. -
Instructions for executing your compiled Nmap are
given in the section called “Executing Nmap on Windows”.
Compile from Source Code
Most Windows users prefer to use the Nmap binary self-installer,
but compilation from source code is an option, particularly if you plan to help with Nmap development. Compilation requires
Microsoft Visual C++ 2019, which is part of their commercial Visual Studio
suite. Any of the Visual Studio 2019 editions should work, including the free
Visual Studio 2019 Community.
Some of Nmap’s dependencies on Windows are inconvenient to build. For
this reason, precompiled binaries of the dependencies are stored in
Subversion, in the directory /nmap-mswin32-aux
.
When building from source, whether from a source code release or from
Subversion, check out /nmap-mswin32-aux
as
described below.
Compiling Nmap on Windows from Source
-
Download the Windows dependencies from Subversion with the command
svn checkout https://svn.nmap.org/nmap-mswin32-aux.
The build files are configured to look for dependencies in this
checked-out directory. If you want to build the dependencies yourself
instead, you will have to reconfigure the Visual Studio project files to
point to the alternate directory. -
Decide whether to obtain the Nmap source code by downloading the latest release from nmap.org, or using a Subversion client to retrieve even newer (but less tested) code from our repository. These instructions are for the web download approach, but using Subversion instead is straightforward (see the section called “Obtaining Nmap from the Subversion (SVN) Repository”).
-
Download the latest Nmap source distribution from
https://nmap.org/download.html
. It has the name
nmap-
or<version>
.tar.bz2
nmap-
. Those are the same tar file compressed using bzip2 or gzip, respectively. The bzip2-compressed version is smaller.<version>
.tgz -
Uncompress the source code file you just downloaded. The
source code directory and thenmap-mswin32-aux
must
be in the same parent directory.
Recent releases of the free Cygwin distribution can handle both the.tar.bz2
and.tgz
formats. Use the command tar xvjf nmap-version.tar.bz2 or tar xvzf nmap-version.tgz, respectively. Alternatively, the common WinZip application can decompress these files. -
Open Visual Studio and the Nmap solution file (
nmap-
).<version>
/mswin32/nmap.sln -
Right click on
Solution 'nmap'
in the Solution Explorer sidebar and choose “Configuration Manager”. Ensure that the active solution configuration isRelease
and then close the Configuration Manager. -
Build Nmap by pressing F7 or choosing “Build
Solution” from the GUI. Nmap should begin compiling, and
end with the line “-- Done --
” saying
that all projects built successfully and there were zero
failures. -
The executable and data files can be found in
nmap-
. You can copy them to a preferred directory as long as they are all kept together.<version>
/mswin32/Release/ -
Ensure that you have Npcap installed.
The official installer for the latest version is available athttps://npcap.com/#download
. Users who install via
our binary self-installer will have Npcap installed automatically.
Nmap OEM customers can also run
npcap-
from<version>
.exe
our zip package. -
Instructions for executing your compiled Nmap are
given in the next section.
If you wish to build an Nmap executable Windows
installer or Zenmap executable,
see docs/win32-installer-zenmap-buildguide.txt
in the Nmap SVN repository.
Many people have asked whether Nmap can be compiled with the
gcc/g++ included
with Cygwin or other compilers. Some users have reported success with
this, but we don’t maintain instructions for building Nmap under
Cygwin.
Executing Nmap on Windows
Nmap releases now include the
Zenmap graphical user interface for Nmap.
If you used the Nmap installer and left the Zenmap field checked,
there should be a new Zenmap entry on your desktop and Start Menu.
Click this to get started. Zenmap is fully documented in
Chapter 12, Zenmap GUI Users’ Guide. While many users love Zenmap, others prefer
the traditional command-line approach to executing Nmap. Here are
detailed instructions for users who are unfamiliar with command-line
interfaces:
-
Open Terminal, PowerShell, or Command Prompt. If you are using MSYS2, Cygwin, or WSL,
the necessary commands differ slightly from those shown here. -
Change to the directory you installed Nmap into. You can skip this step if Nmap is already in your command path (the installer adds it there by default). Otherwise, type the following commands.
c:
cd "\Program Files (x86)\Nmap"
-
Execute nmap.exe. Figure 2.1 is a screen shot showing a simple example.
Figure 2.1. Executing Nmap from a Windows command shell
If you execute Nmap frequently, you can add the Nmap directory
(c:\Program Files (x86)\Nmap
by default) to your command execution path:
-
Open the System Properties window to the Advanced tab by running
SystemPropertiesAdvanced.exe
. -
Click the “Environment
Variables” button. -
Choose
Path
from the
System variables
section, then hit
edit. -
Add a semi-colon and then your Nmap directory (e.g.
c:\Program Files (x86)\Nmap
) to the end of the value. -
Open a new command prompt and you should be able to execute a
command such as nmap scanme.nmap.org from any directory.
Last Updated :
05 Jan, 2022
Nmap is computer software that is used to scan networks. It was developed by Gordon Lyon. It is written in C, C++, Python, and Lua. Its initial release was in 1997, and its stable release was in 2021. Its latest version is 7.92. It is free software used for security purposes of networks. It can be run on different operating systems like Windows, Mac, Linux, etc. It is used to protect computers by discovering hosts and services on a computer network by sending data packets and analyzing the responses. Some of the basic features of Nmap are:
- It discovers hosts on a network.
- It also scans open ports on the target hosts.
- It also finds the application name and the version number by interacting with network services on remote devices.
- It also finds the OS and hardware characteristics of the network devices.
- It also does scriptable interaction with the target with the help of NSE(Nmap Scripting Engine) and Lua programming languages.
- It is open-source software and is available for most operating systems.
Installing Nmap on Windows
Follow the below steps to install Nmap on Windows:
Step 1: Visit the official website using the URL https://nmap.org/download.html on any web browser the click on nmap-7.92-setup.exe. Downloading of this executable file will start soon. It is a 21.8 MB file so it will take some minutes.
Step 2: Now check for the executable file in downloads in your system and run it.
Step 3: It will prompt confirmation to make changes to your system. Click on Yes.
Step 4: The next screen will be of License Agreement, click on I Agree.
Step 5: Next screen is of choosing components, all components are already marked so don’t change anything just click on the Next button.
Step 6: In this step, we choose the installation location of Nmap. By default, it uses the C drive but you can change it into another drive that will have sufficient memory space for installation. It requires 84.3 MB of memory space.
Step 7: After this installation process it will take a few minutes to complete the installation.
Step 8: Npcap installation will also occur with it, the screen of License Agreement will appear, click on I Agree.
Step 9: Next screen is of installation options don’t change anything and click on the Install button.
Step 10: After this installation process it will take a few minutes to complete the installation.
Step 11: After completion of installation click on the Next button.
Step 12: Click on the Finish button to finish the installation of Npcap.
Step 13: After completion of the installation of Nmap click on Next button.
Step 14: Screen for creating shortcut will appear, click on Next button.
Step 15: Click on the Finish button to finish the installation of Nmap.
Step 16: Nmap is successfully installed on the system and an icon is created on the desktop.
Step 17: Run the software and see the interface.
So this is how you have successfully installed Nmap on your windows system.
Nmap, the Network Mapper, is a free and open-source security auditing and network exploration tool widely used by system administrators, network security professionals, and ethical hackers. Nmap can also perform more advanced tasks such as vulnerability scanning. Nmap can be downloaded in different operating systems such as Windows, macOS, and Linux.
This guide will go through the prerequisites of installing Nmap Windows and moving forward how to install the Nmap Windows operating system with different methods exploring in depth.
Prerequisites
Before installing Nmap make sure you meet the following requirements:
- Windows 7 or Later: Nmap officially supports Windows 7 and newer operating systems including Windows Server versions. If you’re using an older version there are alternative methods but these are not officially supported and may have security risks.
- Administrator Privileges: The installation process requires administrator access to modify system files and configurations.
Setting Nmap on Windows
Nmap comes pre-installed in the Kali operating system. If you have installed Kali Linux then Nmap is installed by default. If you are using Ubuntu you can refer to our guide on how to install Nmap on Ubuntu. This article will help you with Nmap download for the Windows system which will handle essential tasks:
- Network discovery: Identifying devices, hosts, and services on a network.
- Port scanning: Determining open ports and the running applications or services on those ports.
- Operating system detection: Guessing the operating system running on a host based on its responses.
- Vulnerability scanning: Identifying potential security vulnerabilities in detected services.
Let’s discuss the steps on how to install Nmap for Windows.
Step 1: Downloading Nmap for Windows
The first step is to download the official version. To do so, navigate to the Nmap download page for Windows by opening your web browser. Scroll down to the section titled ‘Microsoft Windows binaries’. Click on the latest stable release link to download the self-installer.
Step 2: Running the Installer
Once the download is complete, follow these steps for Nmap download Windows:
1. Locate the downloaded file typically in your Downloads folder. Double-click on the Nmap installer for example nmap-x-x-setup.exe
.
2. If prompted by User Account Control (UAC), click ‘Yes’ to allow the installation. A Window will open by the Setup Wizard. Click ‘Next’ to proceed. Agree the End-User License Agreement after reading it.
Step 3: Choosing Components
The installer will then ask which components of Nmap should be installed. It includes:
- Nmap core files (mandatory)
- Npcap (required for packet capturing functionality)
- Zenmap GUI (optional but recommended for easy use)
- Netcat, Netdiff and Nping
Select all the components as per your requirement and click ‘Next’.
Install Nmap on Our Cheap Windows VPS!
Experience the unparalleled ease and speed of hosting Windows VPS with Ultahost. Enjoy blazing-fast SSD NVME speeds without any interruptions at a low cost.
Step 4: Selecting Installation Location
You can stick with the default directory or click ‘Browse’ to select a custom location. After selecting your preferred directory, click ‘Next’.
Step 5: Configuring Additional Tasks (Optional)
Install Nmap as a Windows system path which is recommended so it can be run from any command line. Search for System Properties in the Start menu. In the System Properties window, click on Environment Variables. Under System Variables, find and select the Path variable, then click on Edit.
Click on New and add the path to your Nmap installation.
Step 6: Finalize Installation and Verifying Installation
Review your choices and click ‘Install’ to begin copying files onto your computer. A completion screen will appear indicating a successful installation. Click ‘Finish’.
Open Command Prompt by typing cmd
in your search bar and hitting Enter. Type the following command to run Nmap on Windows:
nmap --version
If installation was successful it should display version information.
Ethical considerations
Always adhere to network privacy and security boundaries. Only scan networks where you have explicit permission. Nmap potential extends far beyond this guide. Refer to this guide Nmap cheat sheet essential commands and options for in-depth exploration of:
- Advanced scan types: Delve into SYN scans, UDP scans, and more, for specific testing needs.
- Flags and filters: Explore these modifiers to fine-tune your scans and gather precise information.
- Scripting: Suggestion of custom scripts to automate tasks and extend Nmap’s capabilities.
Conclusion
By following these steps and considering the ethical implications, you’ve empowered yourself with Nmap, a valuable tool for understanding and securing your network landscape. Use Nmap for ethical purposes, promoting a secure and responsible digital environment.
Nmap is commonly used in scanning networks, you can install Nmap on our server. Ultahost VPS hosting offers you an easy-to-manage, reliable, and economical hosting plan for businesses of all sizes. Get started today and enjoy the freedom and flexibility of a VPS!
FAQ
What is Nmap and why should I install it on Windows?
Nmap is a powerful network scanning tool used for security auditing and network exploration. Installing it on Windows enables you to assess your network’s security and discover connected devices.
How do I install Nmap on Windows?
You can install Nmap on Windows by downloading the installer from the official Nmap website and following the installation instructions.
Are there any prerequisites for installing Nmap on Windows?
No, there are no specific prerequisites for installing Nmap on Windows. You just need to ensure that your Windows system meets the minimum requirements specified by the Nmap installer.
Can I use Nmap on Windows Command Prompt or PowerShell?
Yes, once installed, you can use Nmap commands directly from the Command Prompt or PowerShell.
Nmap is a powerful and flexible tool used for port scanning and vulnerability assessments. It is an essential tool you need to be familiar with as a server administrator.
While the most popular way of using Nmap is through the command line, it also has a GUI called Zenmap.
Download Nmap for Windows 10/11/Server
Nmap supports both Windows and Linux-based operating systems. If you are on Windows, click on This Link to download Nmap.
Download the latest stable release of the self-installer, which provides both command-line and GUI versions of the Nmap for Windows.
After the download is complete, double-click the downloaded file to launch the installer.
In the Choose Components window, you can select which features of Nmap to install. Go with default selection, as shown in the following screenshot).
Make sure that the Register Nmap Path is selected to run the Nmap command from the CMD. The Zenmap package provides the graphical user interface (GUI) for the Nmap command.
Using Nmap and Zenmap
After the installation is complete, open a command prompt (CMD) or PowerShell, and execute the following command:
nmap --version
The above command will show the Nmap version installed on your Windows PC.
The syntax of nmap
is as follows:
nmap <options> <Target>
You can perform a simple scan just by using the IP Address (or hostname) of the remote computer:
nmap 192.168.1.10
Here is another example that checks if port 80 is open:
nmap -p 80 192.168.1.10
Run the nmap
command without any parameters and switches to show the help page:
Shortcut to the Nmap GUI (Zenmap) will be available in the Windows Start Menu.
The following screenshot shows the Zenmap interface:
To perform a quick scan: put the IP address in the Target field and then select Quick scan from the Profile drop-down list before clicking the Scan button.
In the Zenmap interface, click Help (Ctrl+H
) to open the documentation to learn more about the nmap
command.
Installing Nmap on Windows: A Step-by-Step Guide
Introduction
Nmap is a popular open-source network scanning and discovery tool that is widely used by security professionals and network administrators. It is known for its ability to scan a target system or network in a matter of seconds, providing detailed information about the system’s operating system, services, and other relevant details. In this article, we will guide you through the process of installing Nmap on Windows.
Prerequisites
Before we begin, make sure you have the following prerequisites:
- Windows 10 or later: Nmap is compatible with Windows 10, 8, 7, and 6. However, it may not work properly with Windows 7.
- Internet connection: You will need an internet connection to download and install Nmap.
- Admin privileges: You will need administrative privileges to install Nmap.
Installing Nmap on Windows
Here are the steps to install Nmap on Windows:
Step 1: Download the Nmap installer
You can download the Nmap installer from the official Nmap website: https://nmap.org/download.html
- Windows 10: Download the Nmap installer for Windows 10 from the official Nmap website.
- Windows 8: Download the Nmap installer for Windows 8 from the official Nmap website.
- Windows 7: Download the Nmap installer for Windows 7 from the official Nmap website.
- Windows 6: Download the Nmap installer for Windows 6 from the official Nmap website.
Step 2: Run the installer
Once you have downloaded the Nmap installer, run it and follow the prompts to install Nmap.
- Windows 10: Run the installer and select «Install» to begin the installation process.
- Windows 8: Run the installer and select «Install» to begin the installation process.
- Windows 7: Run the installer and select «Install» to begin the installation process.
- Windows 6: Run the installer and select «Install» to begin the installation process.
Step 3: Configure Nmap
After installation, you will need to configure Nmap to use the default settings. Here are the steps:
- Windows 10: Open the Command Prompt as an administrator and run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
- Windows 8: Open the Command Prompt as an administrator and run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
- Windows 7: Open the Command Prompt as an administrator and run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
- Windows 6: Open the Command Prompt as an administrator and run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
Step 4: Verify the installation
After configuring Nmap, you can verify that it has been installed correctly by running the following command:
- Windows 10: Run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
- Windows 8: Run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
- Windows 7: Run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
- Windows 6: Run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
Using Nmap
Once Nmap is installed and configured, you can use it to scan a target system or network. Here are the basic steps:
- Windows 10: Open the Command Prompt as an administrator and run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
- Windows 8: Open the Command Prompt as an administrator and run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
- Windows 7: Open the Command Prompt as an administrator and run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
- Windows 6: Open the Command Prompt as an administrator and run the following command:
nmap -O -sS -p80-1023 -T4 -n -oN C:nmapoutput.txt
Common Nmap Options
Here are some common Nmap options that you can use:
- -O: Output format (e.g. XML, CSV, JSON)
- -sS: Scan for services only
- -sT: Scan for TCP ports only
- -n: Disable DNS resolution
- -oN: Output to a file
- -v: Increase verbosity
- -w: Write output to a file
Common Nmap Commands
Here are some common Nmap commands that you can use:
- nmap: Basic Nmap command
- -O: Output format (e.g. XML, CSV, JSON)
- -sS: Scan for services only
- -sT: Scan for TCP ports only
- -n: Disable DNS resolution
- -oN: Output to a file
- -v: Increase verbosity
- -w: Write output to a file
Troubleshooting Nmap
Here are some common troubleshooting steps for Nmap:
- Nmap not starting: Check the Nmap executable file and ensure that it is in the system’s PATH.
- Nmap output is not being written to a file: Check the output format and ensure that it is set to the desired format.
- Nmap is not scanning the target system: Check the Nmap command and ensure that it is correct.
Conclusion
Installing Nmap on Windows is a straightforward process that requires minimal technical expertise. With this guide, you have learned how to install Nmap, configure it, and use it to scan a target system or network. Nmap is a powerful tool that can help you identify vulnerabilities and improve the security of your network.
Your friends have asked us these questions — Check out the answers!