Documente Academic
Documente Profesional
Documente Cultură
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. Nmap supports Windows 7,
Windows Server 2008 and 2003, Windows Vista, and Windows XP SP1 and later. We
also have a help page for users who must run Nmap on earlier versions of Windows.
While it has improved dramatically, the Windows port is not quite as efficient as on
Unix. Here are the known limitations:
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 haven't yet worked around. If you really want to do this, use a
TCP connect scan without pinging (-sT -Pn) as that uses the high level socket API
rather than sending raw packets.
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.
Scan speeds on Windows are generally comparable to those on Unix, though the latter
often has a slight performance edge. One exception to this is connect scan ( -sT), which is
often much slower on Windows because of deficiencies in the Windows networking API.
This is a shame, since that is the one TCP scan that works against localhost and over all
networking types (not just ethernet, like the raw packet scans). Connect scan
performance can be improved substantially by applying the Registry changes in
the nmap_performance.reg file included with Nmap. By default these changes are applied
for you by the Nmap executable installer. This registry file is in the nmap<version> directory of the Windows binary zip file, 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 onnmap_performance.reg, or by running the
command regedt32 nmap_performance.reg. To make the changes by hand, add these
three Registry DWORD values
toHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters:
MaxUserPort
Set a large value such as 65534 (0x0000fffe). See MS KB Q196271.
TCPTimedWaitDelay
Windows users have three choices for installing Nmap, all of which are available from
the download page at http://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
WinPcap. 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
Most users prefer installing Nmap with the self-installer discussed previously.
Every stable Nmap release comes with Windows command-line binaries and associated
files in a Zip archive. No graphical interface is included, so you need to
runnmap.exe from a DOS/command window. Or you can download and install a superior
command shell such as those included with the free Cygwin system available
fromhttp://www.cygwin.com. Here are the step-by-step instructions for installing and
executing the Nmap .zip binaries.
Installing the Nmap zip binaries
4. Uncompress the source code file you just downloaded. The source code directory
and the nmap-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.
5. Open Visual Studio and the Nmap solution file ( nmap<version>/mswin32/nmap.sln).
6. Right click on Solution 'nmap' in the Solution Explorer sidebar and
choose Configuration Manager. Ensure that the active solution configuration
is Release and then close the Configuration Manager.
7. 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.
8. The executable and data files can be found in nmap-<version>/mswin32/Release/.
You can copy them to a preferred directory as long as they are all kept together.
9. Ensure that you have WinPcap installed. You can obtain it by installing our binary
self-installer or executing winpcap-nmap-<version>.exe from our zip package.
Alternatively, you can obtain the official installer at http://www.winpcap.org.
10.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:
1. Make sure the user you are logged in as has administrative privileges on the
computer (user should be a member of the administrators group).
c:
cd "\Program Files (x86)\Nmap"
If you execute Nmap frequently, you can add the Nmap directory ( c:\Program Files
(x86)\Nmap by default on Windows 7) to your command execution path. The exact place
to set this varies by Windows platform. On my Windows XP box, which installs Nmap
in c:\Program Files\Nmap, I do the following:
1. From the desktop, right click on My Computer and then click properties.
2. In the System Properties window, click the Advanced tab.
variables
Files\Nmap)
6. Open a new DOS window and you should be able to execute a command such
as nmap scanme.nmap.org from any directory.
to