Testing network security controls and discovering vulnerabilities are essential part of any organization’s security plan. Nmap or Network Mapper is a tool that helps a lot for security engineers in testing network security controls and discover vulnerabilities, and it helps network engineers troubleshooting various network issues. Let’s see three different ways to install Nmap on Linux Mint or Ubuntu.
Nmap, or Network Mapper, is an open-source network security scanner. Nmap works by using IP packets in a variety of ways to scan networks for hosts, open ports, and vulnerabilities. Nmap can also use the information it receives to determine the services operating on those ports, applications running on the device, and even the device’s operating system.
Nmap was created in 1997, and it still continues to expand its capability more than 20 years later. Nmap is a very versatile tool that can be used to test network security controls in place on a system. Nmap primarily tests security controls by conducting port scans, which display the open ports on a device. These ports sometimes show vulnerabilities in a system. Examples of vulnerabilities are outdated services, applications, and protocols in use on network devices. Open ports and older services can be used by hackers to exploit these devices.
Other valuable features of Nmap enable network administrators and information security personnel to conduct an inventory of devices that are online. The operating system detection feature can also be used to detect rogue or unauthorized devices that are placed on the network. Examples of these devices are unauthorized Wi-Fi access points or network hubs that need to be removed. As you can see, more than 20 years later, Nmap is still a versatile and capable tool that can be leveraged quickly in a variety of ways.
In Linux, programs can be installed in multiple ways. The two common ways are the installation of compelled binaries from the official repositories and the installation from the source code. In this post, we are using the Linux Mint for demonstration. However, this work is on other Debian-based Linux distributions such as Ubuntu, Raspberry Pi OS, etc. Let’s see how to install Nmap in three different ways on Linux Mint or Ubuntu.
Apt is an official repository in the Debian-based Linux distribution. It has readily compelled binaries in its repository. When you install a program from apt repositories, you are installing the compelled program on Linux. It is simple and straight to install Nmap from the apt repository.
$ sudo apt update
$ sudo apt install nmap
$ nmap --version
Snap is a universal or cross-distribution software packaging repository. It is developed by Canonical, who developed Ubuntu. It is considered an advanced package distribution because of its cross-distribution, dependency-free, and easy-to-install applications package support. A package built-in Snap can be run on all major Linux distributions such as Ubuntu, Debian, Fedora, Arch Linux, Manjaro, and CentOS/RHEL. Let’s see how to install Nmap from the snap package repository.
Note: snapd is included in the default installation set in Ubuntu. If not, you can install snapd either from the Software Manager or from the terminal command ‘sudo apt install snapd’. However, If you are installing snapd on Linux Mint. You may see a problem in reading the package from the repository. You should enable snap on Linux Mint before install.
Press Ctrl+Alt+t to open the terminal.
Remove ‘nosnap.pref‘ from the location /etc/apt/preferences.d/nosnap.pref:
Update the repository.
$ sudo rm /etc/apt/preferences.d/nosnap.pref
$ sudo apt update
$ sudo apt install snapd
$ sudo apt install snapd
$ sudo snap install nmap
$ nmap --version
The third meaningful way of installation on Linux is installing programs directly compelling the source codes. Source codes are the actual programs in text files. You need to build a package from the source code before installing it on the Linux distribution. Let’s see how to install Nmap from the source code.
$ sudo apt install build-essential
$ wget https://nmap.org/dist/nmap-7.91.tar.bz2
$ tar xf nmap-7.91.tar.bz2
$ cd nmap-7.91/
$ sudo ./configure
$ sudo make
$ sudo make install
$ nmap --version
Now you know the three different ways to install Nmap on Linux Mint. What if you want to uninstall Nmap? It is always recommended to know the uninstallation of the program which you are going to install. Let’s see how to uninstall Nmap from Linux Mint or Ubuntu.
Run this command to remove the Nmap package alone using apt.
$ sudo apt remove nmap
Run this command to remove along with configurations and dependent packages.
$ sudo apt purge nmap
Run this command to remove Nmap through snap
$ sudo snap remove nmap
If you want to uninstall Nmap from the local build. Change directory to the installed directory, then issue make uninstall command.
$ cd nmap-7.91/
$ sudo make uninstall
We hope this post would help you in learning 3 Different Ways to Install Nmap on Linux Mint or Ubuntu. Visit our social media page on Facebook, LinkedIn, Twitter, Telegram, Tumblr, & Medium, and follow us to receive updates like this.
You may also like these articles:
Arun KL is a cybersecurity professional with 15+ years of experience in IT infrastructure, cloud security, vulnerability management, Penetration Testing, security operations, and incident response. He is adept at designing and implementing robust security solutions to safeguard systems and data. Arun holds multiple industry certifications including CCNA, CCNA Security, RHCE, CEH, and AWS Security.
“Knowledge Arsenal: Empowering Your Security Journey through Continuous Learning”
"Cybersecurity All-in-One For Dummies" offers a comprehensive guide to securing personal and business digital assets from cyber threats, with actionable insights from industry experts.
BurpGPT is a cutting-edge Burp Suite extension that harnesses the power of OpenAI's language models to revolutionize web application security testing. With customizable prompts and advanced AI capabilities, BurpGPT enables security professionals to uncover bespoke vulnerabilities, streamline assessments, and stay ahead of evolving threats.
PentestGPT, developed by Gelei Deng and team, revolutionizes penetration testing by harnessing AI power. Leveraging OpenAI's GPT-4, it automates and streamlines the process, making it efficient and accessible. With advanced features and interactive guidance, PentestGPT empowers testers to identify vulnerabilities effectively, representing a significant leap in cybersecurity.
Tenable BurpGPT is a powerful Burp Suite extension that leverages OpenAI's advanced language models to analyze HTTP traffic and identify potential security risks. By automating vulnerability detection and providing AI-generated insights, BurpGPT dramatically reduces manual testing efforts for security researchers, developers, and pentesters.
Microsoft Security Copilot is a revolutionary AI-powered security solution that empowers cybersecurity professionals to identify and address potential breaches effectively. By harnessing advanced technologies like OpenAI's GPT-4 and Microsoft's extensive threat intelligence, Security Copilot streamlines threat detection and response, enabling defenders to operate at machine speed and scale.