CINXE.COM

Linux Distributions | Nmap Network Scanning

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Linux Distributions | Nmap Network Scanning</title><link rel="stylesheet" type="text/css" href="/shared/css/db5.css?v=2"/><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"/><link rel="prev" href="inst-source.html" title="Linux/Unix Compilation and Installation from Source Code"/><link rel="next" href="inst-windows.html" title="Windows"/><link rel="canonical" href="https://nmap.org/book/inst-linux.html"/> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="theme-color" content="#2A0D45"> <link rel="preload" as="image" href="/images/sitelogo.png" imagesizes="168px" imagesrcset="/images/sitelogo.png, /images/sitelogo-2x.png 2x"> <link rel="preload" as="image" href="/shared/images/nst-icons.svg"> <link rel="stylesheet" href="/shared/css/nst.css?v=2"> <script async src="/shared/js/nst.js?v=2"></script> <link rel="stylesheet" href="/shared/css/nst-foot.css?v=2" media="print" onload="this.media='all'"> <link rel="stylesheet" href="/site.css"> <!--Google Analytics Code--> <link rel="preload" href="https://www.google-analytics.com/analytics.js" as="script"> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-11009417-1', 'auto'); ga('send', 'pageview'); </script> <!--END Google Analytics Code--> <META NAME="ROBOTS" CONTENT="NOARCHIVE"> <link rel="shortcut icon" href="/shared/images/tiny-eyeicon.png" type="image/png"> </head> <body><div id="nst-wrapper"> <div id="menu"> <div class="blur"> <header id="nst-head"> <a id="menu-open" href="#menu" aria-label="Open menu"> <img width="44" height="44" alt="" aria-hidden="true" src="/shared/images/nst-icons.svg#menu"> </a> <a id="menu-close" href="#" aria-label="Close menu"> <img width="44" height="44" alt="" aria-hidden="true" src="/shared/images/nst-icons.svg#close"> </a> <a id="nst-logo" href="/" aria-label="Home page"> <img alt="Home page logo" srcset="/images/sitelogo.png, /images/sitelogo-2x.png 2x" src="/images/sitelogo.png" onerror="this.onerror=null;this.srcset=this.src" height=90 width=168></a> <nav id="nst-gnav"> <a class="nlink" href="https://nmap.org/">Nmap.org</a> <a class="nlink" href="https://npcap.com/">Npcap.com</a> <a class="nlink" href="https://seclists.org/">Seclists.org</a> <a class="nlink" href="https://sectools.org">Sectools.org</a> <a class="nlink" href="https://insecure.org/">Insecure.org</a> </nav> <form class="nst-search" id="nst-head-search" action="/search/"> <input class="nst-search-q" name="q" type="search" placeholder="Site Search"> <button class="nst-search-button" title="Search"> <img style="width:100%;aspect-ratio:1/1;" alt="" aria-hidden="true" src="/shared/images/nst-icons.svg#search"> </button> </form> </header> </div> </div> <main id="nst-content"> <nav id="nst-sitenav"> <a class="nlink" href="/download.html">Download</a> <a class="nlink" href="/book/man.html">Reference Guide</a> <a class="nlink" href="/book/">Book</a> <a class="nlink" href="/docs.html">Docs</a> <a class="nlink" href="/zenmap/">Zenmap GUI</a> <a class="nlink" href="/movies/">In the Movies</a> </nav> <header><ul class="breadcrumb-nav"><li class="breadcrumb"><a href="toc.html">Nmap Network Scanning</a></li><li class="breadcrumb"><a href="install.html">Chapter 2. Obtaining, Compiling, Installing, and Removing Nmap</a></li><li class="breadcrumb current">Linux Distributions</li></ul><nav class="docnav-header"><div class="dn-unit"><a class="dn-link dn-prev" href="inst-source.html" accesskey="p">Prev</a></div><div class="dn-unit"><a class="dn-link dn-next" href="inst-windows.html" accesskey="n">Next</a></div></nav></header><section class="sect1" id="inst-linux"><div class="titlepage"><div><div><h2 class="title" style="clear: both">Linux Distributions</h2></div></div></div><p> Linux is the most popular platform for running Nmap. In one user survey, 86% said that Linux was at least one of the platforms on which they run Nmap. The first release of Nmap in 1997 <span class="emphasis"><em>only</em></span> ran on Linux.</p><p>Linux users can choose between a source code install or using binary packages provided by their distribution or Insecure.Org. The binary packages are generally quicker and easier to install, and are often slightly customized to use the distribution's standard directory paths and such. These packages also allow for consistent management in terms of upgrading, removing, or surveying software on the system. A downside is that packages created by the distributions are necessarily behind the Nmap.Org source releases. Most Linux distributions keep their Nmap package relatively current, though a few are way out of date. Choosing the source install allows for more flexibility in determining how Nmap is built and optimized for your system. To build Nmap from source, see <a class="xref" href="inst-source.html" title="Linux/Unix Compilation and Installation from Source Code">the section called “Linux/Unix Compilation and Installation from Source Code”</a>. Here are simple package instructions for the most common distributions.</p><section class="sect2" id="inst-rpm"><div class="titlepage"><div><div><h3 class="title">RPM-based Distributions (Red Hat, Mandrake, SUSE, Fedora)</h3></div></div></div><a id="idm45751293284832" class="indexterm"></a><a id="idm45751293284048" class="indexterm"></a><a id="idm45751293282784" class="indexterm"></a><a id="idm45751293281504" class="indexterm"></a><a id="idm45751293280384" class="indexterm"></a><a id="idm45751293279264" class="indexterm"></a><p>I build RPM packages for every release of Nmap and post them to the Nmap download page at <a class="ulink" href="https://nmap.org/download.html" target="_top"><code class="systemitem">https://nmap.org/download.html</code></a>. I build two packages: The <code class="literal">nmap</code> package contains just the command-line executable and data files, while the <code class="literal">zenmap</code> package contains the optional <span class="application">Zenmap</span> graphical frontend (see <a class="xref" href="zenmap.html" title="Chapter 12. Zenmap GUI Users' Guide">Chapter 12, <em>Zenmap GUI Users' Guide</em></a>). The <code class="literal">zenmap</code> package requires that the <code class="literal">nmap</code> package be installed first.</p><p> <a id="idm45751293271968" class="indexterm"></a> Installing via <span class="application">RPM</span> is quite easy—it even downloads the package for you when given the proper URLs. The following example downloads and installs Nmap 4.68, including the frontend. Of course you should use the latest version at the download site above instead. Any existing RPM-installed versions are upgraded. <a class="xref" href="inst-linux.html#ex-nmap-install-from-rpms" title="Example 2.8. Installing Nmap from binary RPMs">Example 2.8</a> demonstrates this installation process.</p><div class="example" id="ex-nmap-install-from-rpms"><div class="example-title">Example 2.8. Installing Nmap from binary RPMs</div><div class="example-contents"><pre class="screen"># <strong class="userinput"><code>rpm -vhU https://nmap.org/dist/nmap-4.68-1.i386.rpm</code></strong> Retrieving https://nmap.org/dist/nmap-4.68-1.i386.rpm Preparing... ########################################### [100%] 1:nmap ########################################### [100%] # <strong class="userinput"><code>rpm -vhU https://nmap.org/dist/zenmap-4.68-1.noarch.rpm</code></strong> Retrieving https://nmap.org/dist/zenmap-4.68-1.noarch.rpm Preparing... ########################################### [100%] 1:zenmap ########################################### [100%] </pre></div></div><br class="example-break"/><p>As the filenames above imply, these binary RPMs were created for normal PCs (x86 architecture).<a id="idm45751293264688" class="indexterm"></a> I also distribute x86_64<a id="idm45751293263824" class="indexterm"></a> binaries for 64-bit Linux users. These binaries won't work for the relatively few Linux users on other platforms such as SPARC, Alpha, or PowerPC. They also may refuse to install if your library versions are sufficiently different from what the RPMs were initially built on. One option in these cases would be to find binary RPMs prepared by your Linux vendor for your specific distribution. The original install CDs or DVD are a good place to start. Unfortunately, those may not be current or available. Another option is to install Nmap from source code as described previously, though you lose the binary package maintenance consistency benefits. A third option is to build and install your own binary RPMs from the source RPMs distributed from the download page above. <a class="xref" href="inst-linux.html#ex-nmap-install-from-srpms" title="Example 2.9. Building and installing Nmap from source RPMs">Example 2.9</a> demonstrates this technique with Nmap 4.68.</p><div class="example" id="ex-nmap-install-from-srpms"><div class="example-title">Example 2.9. Building and installing Nmap from source RPMs</div><div class="example-contents"><pre class="screen">&gt; <strong class="userinput"><code>rpmbuild --rebuild https://nmap.org/dist/nmap-4.68-1.src.rpm</code></strong> [ hundreds of lines cut ] Wrote: /home/fyodor/rpmdir/RPMS/i386/nmap-4.68-1.i386.rpm [ cut ] &gt; <strong class="userinput"><code>su</code></strong> Password: # <strong class="userinput"><code>rpm -vhU /home/fyodor/rpmdir/RPMS/i386/nmap-4.68-1.i386.rpm</code></strong> Preparing... ########################################### [100%] 1:nmap ########################################### [100%] # </pre></div></div><br class="example-break"/><p>It is not necessary to rebuild Zenmap in this fashion because the Zenmap RPM is architecture-independent (<span class="quote">“<span class="quote">noarch</span>”</span>). For that reason there are no Zenmap source RPMs.</p><p>Removing RPM packages is as easy as <span class="command"><strong>rpm -e nmap zenmap</strong></span>.</p></section><section class="sect2" id="inst-yum"><div class="titlepage"><div><div><h3 class="title">Updating Red Hat, Fedora, Mandrake, and Yellow Dog Linux with Yum</h3></div></div></div><a id="idm45751293253872" class="indexterm"></a><a id="idm45751293253088" class="indexterm"></a><a id="idm45751293251984" class="indexterm"></a><a id="idm45751293250864" class="indexterm"></a><a id="idm45751293249744" class="indexterm"></a><a id="idm45751293248624" class="indexterm"></a><p>The Red Hat, Fedora, Mandrake, and Yellow Dog Linux distributions have an application named <span class="application">Yum</span> which manages software installation and updates from central RPM repositories. This makes software installation and updates trivial. Since distribution-specific Yum repositories are normally used, you know the software has already been tested for compatibility with your particular distribution. Most distributions do maintain Nmap in their Yum repository, but they don't always keep it up to date. This is particularly problematic if you (like most people) don't always quickly update to the latest release of your distribution. If you are running a two-year old Linux release, Yum will often give you a two-year-old version of Nmap. Even the latest version of distributions often take months to update to a new Nmap release. So for the latest version of Nmap on these systems, try the RPMs we distribute as described in the previous section. But if our RPMs aren't compatible with your system or you are in a great hurry, installing Nmap from Yum is usually as simple as executing <span class="command"><strong>yum install nmap</strong></span> (run <span class="command"><strong>yum install nmap zenmap</strong></span> if you would like the GUI too, though some distributions don't yet package Zenmap). Yum takes care of contacting a repository on the Internet, finding the appropriate package for your architecture, and then installing it along with any necessary dependencies. This is shown (edited for brevity) in <a class="xref" href="inst-linux.html#ex-nmap-install-from-yum" title="Example 2.10. Installing Nmap from a system Yum repository">Example 2.10</a>. You can later perform <span class="command"><strong>yum update</strong></span> to install available updates to Nmap and other packages in the repository.</p><div class="example" id="ex-nmap-install-from-yum"><div class="example-title">Example 2.10. Installing Nmap from a system Yum repository</div><div class="example-contents"><pre class="screen">flog~# <strong class="userinput"><code>yum install nmap</code></strong> Setting up Install Process Parsing package install arguments Resolving Dependencies --&gt; Running transaction check ---&gt; Package nmap.x86_64 2:4.52-1.fc8 set to be updated --&gt; Finished Dependency Resolution Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: nmap x86_64 2:4.52-1.fc8 updates 1.0 M Transaction Summary ============================================================================= Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 1.0 M Is this ok [y/N]: y Downloading Packages: (1/1): nmap-4.52-1.fc8.x8 100% |=========================| 1.0 MB 00:02 Running Transaction Test Transaction Test Succeeded Running Transaction Installing: nmap ######################### [1/1] Installed: nmap.x86_64 2:4.52-1.fc8 Complete! </pre></div></div><br class="example-break"/></section><section class="sect2" id="inst-debian"><div class="titlepage"><div><div><h3 class="title">Debian Linux and Derivatives such as Ubuntu</h3></div></div></div><a id="idm45751293236400" class="indexterm"></a><a id="idm45751293234736" class="indexterm"></a><a id="idm45751293233920" class="indexterm"></a><p>LaMont Jones <a id="idm45751293232816" class="indexterm"></a> maintaining the Nmap <code class="literal">deb</code> packages, including keeping them reasonably up-to-date. The proper upgrade/install command is <span class="command"><strong>apt-get install nmap</strong></span>. <a id="idm45751293230512" class="indexterm"></a> This works for Debian derivatives such as Ubuntu too. Information on the latest Debian <span class="quote">“<span class="quote">stable</span>”</span> Nmap package is available at <a class="ulink" href="http://packages.debian.org/stable/nmap" target="_top"><code class="systemitem">http://packages.debian.org/stable/nmap</code></a> and the development (<span class="quote">“<span class="quote">unstable</span>”</span>) Nmap and Zenmap packages are available from <a class="ulink" href="http://packages.debian.org/unstable/nmap" target="_top"><code class="systemitem">http://packages.debian.org/unstable/nmap</code></a> and <a class="ulink" href="http://packages.debian.org/unstable/zenmap" target="_top"><code class="systemitem">http://packages.debian.org/unstable/zenmap</code></a>.</p><p>Sometimes Debian's Nmap releases are a year or more behind the current Nmap version. One option for obtaining the latest release is to compile from source code, as described in <a class="xref" href="inst-source.html" title="Linux/Unix Compilation and Installation from Source Code">the section called “Linux/Unix Compilation and Installation from Source Code”</a>. Another option is to download the RPM-format binaries from the Nmap download page, convert them to <code class="literal">deb</code> packages using the <span class="application">alien</span> command, and then install them using <span class="application">dpkg</span>, as described in the following list:</p><div class="orderedlist" id="install-list-deb"><div class="orderedlist-title">Steps for converting Nmap RPM files to Debian/Ubuntu <code class="filename">deb</code> format for installation on Debian/Ubuntu</div><ol class="orderedlist" type="1"><li class="listitem"><p>If you don't have the <span class="application">alien</span> command, install it with a command such as <span class="command"><strong>sudo apt-get install alien</strong></span></p></li><li class="listitem"><p>Download the Nmap RPMs for your platform (x86 or x86-64) from <a class="ulink" href="https://nmap.org/download.html" target="_top"><code class="systemitem">https://nmap.org/download.html</code></a>. This description will use <code class="filename">nmap-5.21-1.x86_64.rpm</code></p></li><li class="listitem"><p>Verify the download integrity as described in <a class="xref" href="install.html#inst-integrity" title="Verifying the Integrity of Nmap Downloads">the section called “Verifying the Integrity of Nmap Downloads”</a>.</p></li><li class="listitem"><p>Generate a Debian package with a command such as <span class="command"><strong>sudo alien nmap-5.21-1.x86_64.rpm</strong></span></p></li><li class="listitem"><p>Install the Debian package with a command such as <span class="command"><strong>sudo dpkg --install nmap_5.21-2_amd64.deb</strong></span></p></li><li class="listitem"><p>Steps 2–5 can be repeated for the other Nmap RPMs such as Zenmap, Ncat, and Nping.</p></li></ol></div></section><section class="sect2" id="inst-linux-other"><div class="titlepage"><div><div><h3 class="title">Other Linux Distributions</h3></div></div></div><p>There are far too many Linux distributions available to list here, but even many of the obscure ones include Nmap in their package tree. If they don't, you can simply compile from source code as described in <a class="xref" href="inst-source.html" title="Linux/Unix Compilation and Installation from Source Code">the section called “Linux/Unix Compilation and Installation from Source Code”</a>. </p></section></section><footer><hr/><nav class="docnav-footer"><div class="dn-unit"><a class="dn-link dn-prev" href="inst-source.html">Prev</a><span class="dn-title">Linux/Unix Compilation and Installation from Source Code</span></div><div class="dn-unit"><a class="dn-link dn-up" href="install.html" accesskey="u">Up</a><span class="dn-title">Chapter 2. Obtaining, Compiling, Installing, and Removing Nmap</span></div><div class="dn-unit"><a class="dn-link dn-home" href="toc.html" accesskey="h">Home</a></div><div class="dn-unit"><a class="dn-link dn-next" href="inst-windows.html">Next</a><span class="dn-title">Windows</span></div></nav></footer> </main><!-- content --> <footer id="nst-foot"> <form class="nst-search" id="nst-foot-search" action="/search/"> <input class="nst-search-q" name="q" type="search" placeholder="Site Search"> <button class="nst-search-button" title="Search"> <img style="width:100%;aspect-ratio:1/1;" alt="" aria-hidden="true" src="/shared/images/nst-icons.svg#search"> </button> </form> <div class="flexlists"> <div class="fl-unit"> <h2><a class="nlink" href="https://nmap.org/">Nmap Security Scanner</a></h2> <ul> <li><a class="nlink" href="https://nmap.org/book/man.html">Ref Guide</a> <li><a class="nlink" href="https://nmap.org/book/install.html">Install Guide</a> <li><a class="nlink" href="https://nmap.org/docs.html">Docs</a> <li><a class="nlink" href="https://nmap.org/download.html">Download</a> <li><a class="nlink" href="https://nmap.org/oem/">Nmap OEM</a> </ul> </div> <div class="fl-unit"> <h2><a class="nlink" href="https://npcap.com/">Npcap packet capture</a></h2> <ul> <li><a class="nlink" href="https://npcap.com/guide/">User's Guide</a> <li><a class="nlink" href="https://npcap.com/guide/npcap-devguide.html#npcap-api">API docs</a> <li><a class="nlink" href="https://npcap.com/#download">Download</a> <li><a class="nlink" href="https://npcap.com/oem/">Npcap OEM</a> </ul> </div> <div class="fl-unit"> <h2><a class="nlink" href="https://seclists.org/">Security Lists</a></h2> <ul> <li><a class="nlink" href="https://seclists.org/nmap-announce/">Nmap Announce</a> <li><a class="nlink" href="https://seclists.org/nmap-dev/">Nmap Dev</a> <li><a class="nlink" href="https://seclists.org/fulldisclosure/">Full Disclosure</a> <li><a class="nlink" href="https://seclists.org/oss-sec/">Open Source Security</a> <li><a class="nlink" href="https://seclists.org/dataloss/">BreachExchange</a> </ul> </div> <div class="fl-unit"> <h2><a class="nlink" href="https://sectools.org">Security Tools</a></h2> <ul> <li><a class="nlink" href="https://sectools.org/tag/vuln-scanners/">Vuln scanners</a> <li><a class="nlink" href="https://sectools.org/tag/pass-audit/">Password audit</a> <li><a class="nlink" href="https://sectools.org/tag/web-scanners/">Web scanners</a> <li><a class="nlink" href="https://sectools.org/tag/wireless/">Wireless</a> <li><a class="nlink" href="https://sectools.org/tag/sploits/">Exploitation</a> </ul> </div> <div class="fl-unit"> <h2><a class="nlink" href="https://insecure.org/">About</a></h2> <ul> <li><a class="nlink" href="https://insecure.org/fyodor/">About/Contact</a> <li><a class="nlink" href="https://insecure.org/privacy.html">Privacy</a> <li><a class="nlink" href="https://insecure.org/advertising.html">Advertising</a> <li><a class="nlink" href="https://nmap.org/npsl/">Nmap Public Source License</a> </ul> </div> <div class="fl-unit social-links"> <a class="nlink" href="https://twitter.com/nmap" title="Visit us on Twitter"> <img width="32" height="32" src="/shared/images/nst-icons.svg#twitter" alt="" aria-hidden="true"> </a> <a class="nlink" href="https://facebook.com/nmap" title="Visit us on Facebook"> <img width="32" height="32" src="/shared/images/nst-icons.svg#facebook" alt="" aria-hidden="true"> </a> <a class="nlink" href="https://github.com/nmap/" title="Visit us on Github"> <img width="32" height="32" src="/shared/images/nst-icons.svg#github" alt="" aria-hidden="true"> </a> <a class="nlink" href="https://reddit.com/r/nmap/" title="Discuss Nmap on Reddit"> <img width="32" height="32" src="/shared/images/nst-icons.svg#reddit" alt="" aria-hidden="true"> </a> </div> </div> </footer> </div><!-- wrapper --> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10