Nmap Vulnerability Scan: How to Find Weak Systems Easily (2024)

As a hacker, you need to identify vulnerabilities in a target system quickly. The easiest way to do this is with an Nmap vulnerability scan.

Nmap started as a simple network scanning command line tool. Through the power of the Nmap Scripting Engine (NSE), it can be extended into a powerful vulnerability scanner that allows you to enumerate target systems for the latest vulnerabilities.

Vulnerability scanning is a pivotal step during any penetration test, and Nmap is a tool many penetration testers rely on to do the job. It is lightweight, versatile, and completely free. In this article, you will learn how to use Nmap to perform vulnerability scans and quickly find weaknesses on target machines.

Let’s jump in and discover the full potential of Nmap!

Table Of Contents

  1. Scanning Fundamentals
  2. Nmap Command Generator
  3. Three Types of Vulnerability Scanning
  4. Using Vuln
  5. Using Vulners
  6. Using Vulscan
  7. Comparing Results
  8. Conclusion
  9. Frequently Asked Questions

Scanning Fundamentals

Nmap is a powerful network scanning tool that is designed to find open ports and services running on network-attached devices. It is free, open-source, and extensively used by penetration testers to perform security audits against target networks. It comes installed on Kali Linux by default.

To perform an Nmap scan, use the command nmap <target>. This command performs a default Nmap scan, which queries the top 1000 ports to see which are open.

The output of the Nmap scan shows the following:

  1. The Nmap command ran: nmap 10.0.100.5.
  2. The date and time the command was run.
  3. The network latency when connecting to the target system.
  4. A report showing the open ports.
  5. The time it took to complete the scan.

Here a single target was scanned. However, the target of your scan can be a single host, multiple hosts, or an entire subnet.

You can add options (a.k.a flags) to your scan to change its behavior and what Nmap queries for. The syntax for this is:

nmap <flags> <target>

The options you can use range from performing a specific type of scan to changing how a scan is performed. For instance, you can use the -sV flag to perform a service scan to reveal the specific network services running on each open port. An important step during enumeration.

To change how a scan is performed, you can use any of the following options:

  • Change the speed and aggressiveness of Nmap scans with timing templates -T1 to -T4.
  • Stop Nmap performing an Internet Control Message Protocol (ICMP) echo ping to discover targets with the -Pn option.
  • Stop Nmap trying to resolve DNS names with the -n option.
  • Scan all ports using the -p- option.

Nmap has a wide range of scans and options you can use. To learn more about Nmap and its various options, read How to Use Nmap to Scan a Network: A Step-by-Step Guide.

Nmap Command Generator

Say goodbye to the hassle of trying to remember the exact syntax for your Nmap commands! With our Nmap Command Generator, you can simply say what you need Nmap to do, and we will generate the command for you.

Three Types of Vulnerability Scanning

Although Nmap is typically used to perform network scans, it can also be used as a vulnerability scanner to find weaknesses in network-connected systems using the Nmap Scripting Engine (NSE). The NSE allows you to create and execute custom scripts that extend the functionality of Nmap.

You can use the NSE and Nmap’s scanning capabilities to turn this basic network scanner into a comprehensive vulnerability scanning tool by leveraging three powerful Nmap scripting options:

  • Vuln: The --script vuln option executes all NSE scripts that focus on identifying vulnerabilities in the target system you are scanning. It is an easy way to discover well-known vulnerabilities.
  • Vulners: The --script vulners option uses the vulners.com online database to scan targets for the latest vulnerabilities using Nmap. This database is regularly updated and may reveal information that other scans might miss.
  • vulscan: The --script vulscan option is a Nmap vulnerability scanning script that uses several offline vulnerability databases to test a target system for weaknesses. It uses the National Vulnerability Database (NVD), Common Vulnerability and Exposures (CVE) database, Open Vulnerability and Assessment Language (OVAL) repository, and others to scan for vulnerabilities on a local network, even when offline.
VulnVulnersVulscan
Executes multiple NSE scripts from Nmap’s vuln categoryExecutes a single script that pulls from an online databaseExecutes a single script that pulls from an offline database
Uses Nmap’s built-in scripts to scan for vulnerabilitiesUses the vulners.com online database to scan for vulnerabilitiesUses multiple offline databases to scan for vulnerabilities
Cannot update the vulnerabilities Nmap scans for without creating your own scripts and adding them to the vuln directory.The vulnerabilities to scan for are regularly updated automatically.The vulnerabilities to scan for must be manually updated by running the update.sh command in the vulscan directory.
Scans for the most common vulnerabilities.Scans for the latest vulnerabilities.Scans for a wide range of vulnerabilities.
Main advantage: built-in to NmapMain advantage: fast and accurate.Main advantage: performs comprehensive vulnerability scans offline.

Let’s look at how you can use each option to scan for vulnerabilities using Nmap.

Using Vuln

Nmap’s vuln scan will run the tool’s default vulnerability scanning scripts against a target. These are great for finding common vulnerabilities that you may be able to exploit. To run a vuln scan, use the following syntax:

nmap --script vuln <target>

The output returned from this scan shows the following:

  1. The command line that was used to run the vuln scan. This is followed by the default Nmap reporting header, as described above.
  2. The File Transfer Protocol (FTP) service is running on port 21 of the target machine. The specific service being used is vsFTPd version 2.3.4, which is supposedly vulnerable to CVE-2011-2523. Nmap even provides several references and a Metasploit module you can use to exploit the vulnerability.
  3. The Simple Mail Transfer Protocol (SMTP) service is running on port 25. This service is vulnerable to CVE-2014-3566. Again, Nmap provided references to this vulnerability.

From this output, you can begin exploiting this target machine by attacking the FTP or SMTP services running. You can use the Nmap references as a starting point for exploiting these vulnerabilities.

When to Use Vuln

Nmap’s vuln scan is a great option for scanning for commonly abused vulnerabilities on legacy systems or when you do not have an Internet connection.

Using Vulners

The vulners vulnerability scan is able to use the online database vulners.com to scan a target for the latest vulnerabilities. To perform this scan, use the following syntax:

nmap -sV --script vulners <target>

The output returned from this scan shows the following:

  1. The command line that was used to run the vulners scan.
  2. The Secure Shell (SSH) service is running on port 22 of the target machine. The specific service being used is OpenSSH version 4.7p1 Debian 8ubuntu1, which is supposedly vulnerable to several CVEs. The vulners script provides a reference to each CVE or other vulnerability ID.
  3. The *EXPLOIT* flag next to a vulnerability ID indicates that this vulnerability is exploitable, and you should be able to manually exploit it or find the exploit code online. You want to explore these vulnerabilities further, as they may lead to a successful exploit.
  4. The Domain Name Service (DNS) service is running on port 53. The specific service version running is ISC BIND 9.4.2, which is supposedly vulnerable to a range of vulnerabilities. Again, the vulners script provides a reference for each one and if the vulnerability is exploitable with the *EXPLOIT* flag.

This output indicates that you should try to exploit the SSH and DNS services running on the target machine. If you choose to target SSH, you should look for SSV:60656 on vulners.com because this vulnerability ID relates to an exploit. Meanwhile, if you try to exploit DNS, you can use the link to SSV:60184 or any other link with *EXPLOIT* next to it.

When to Use Vulners

Nmap’s vulners scan is perfect for scanning for the latest vulnerabilities on a modern system. Its speed and accuracy make it the go-to option for most of your vulnerability scanning needs.

Using Vulscan

Nmap’s vulscan option does not come with the tool by default. Instead, you need to download the vulnerability scanning script from its GitHub repository. You can do this by using the git clone command to download the vulscan script to the Nmap scripts directory.

Next, use the Linux ln command to create a symbolic link between the scipag_vulscan file and the Nmap vulscan script. This will allow you to use the vulscan option on Nmap’s command line.

Whenever you add a new NSE script to use in Nmap, you need to run the command nmap --script-updatedb to update Nmap’s database to recognize the new script. However,

the vulscan script is not included in Nmap by default, which means it can't be updated using the command. Instead, you need to use the update.sh script that comes with the GitHub repository you previously cloned to update Nmap’s database and the vulnerability databases vulscan pulls from. Run the following command:

./update.sh

You may need to change the file permissions on the update.sh file to execute it. Run the command chmod 744 update.sh to ensure you can execute the file. Linux file permissions are explained in detail in Linux File Permissions Cheat Sheet.

Once the vulscan script has been added to Nmap’s database, you can use the following syntax to run the vulscan vulnerability scan:

nmap -sV --script=vulscan/vulscan.nse <target>

The output returned from this scan shows the following:

  1. The command line used to run the vulners scan.
  2. The FTP service is running on port 21 of the target machine, specifically vsFTPd version 2.3.4.
  3. There are no findings in the VulDB vulnerability database that match this version of FTP.
  4. One CVE in the MITRE CVE vulnerability database matches this version of FTP (CVE-2011-0762).

The vulscan output continues to show that there are multiple matches for vulnerabilities in the Security Focus (5), IBM X-Force (6), and Exploit-DB (7) vulnerability databases for this version of FTP. From here, you can look up these vulnerabilities to see if there are any exploits you can use to target FTP on this system. A good place to start is Exploit-DB.

When to Use vulscan

Nmap’s vulscan is ideal for performing a comprehensive vulnerability scan against a target system or when you don’t have Internet access during scanning. Its use of various offline databases gives it the power to find a wide range of vulnerabilities.

Comparing Results

Let’s take a look at the results of all three Nmap vulnerability scans:

  • The Nmap vuln scan took a long time to run compared to the other two scans, and many of the vulnerabilities it found were outdated or incorrect.
  • The Nmap vulners scan was fast and found many more vulnerabilities. It also included useful links to each one and showed what was exploitable.
  • The Nmap vulscan scan was somewhere in between the vuln and vulners scans for speed but was a lot more thorough in its output. It provided a comprehensive report of every potential vulnerability present by querying multiple vulnerability databases. This is a benefit if you want completeness. However, you need to know what you are looking for in the output, or you may spend a long time sifting through it all.

Overall, you can probably skip the Nmap vuln scan in most cases. It is slow and outdated. Instead, focus on using the Nmap vulners scan and Nmap vulscan options. If you want a quick scan that provides succinct output, use the vulners scan. If you want a comprehensive vulnerability scan of the system you are targeting that leverages multiple vulnerability databases to find potential security weaknesses use the vulcan option.

It might be worthwhile doing a quick vulners scan and, if you don’t find anything exploitable, then doing a more comprehensive vulscan scan.

That said, Nmap is not the only vulnerability scanner you can use. You can use a range of free and commercial vulnerability scanners to find security weaknesses you can exploit. Read The Best Vulnerability Scanners for Kali Linux to learn more.

Conclusion

The Nmap vulnerability scan is an enumeration technique you must master as a penetration tester. Nmap is not just a tool for performing network scanning anymore. The powerful Nmap Scripting Engine (NSE) unlocks the full power of this tool and turns it into a complete vulnerability scanning command line application.

You saw this power using the Nmap vuln scan, vulners scan, and vulscan options. You also discovered that if you want an efficient scan, use the vulners options, while if you want a comprehensive vulnerability scan, use the vulscan option.

This is just a taste of how powerful Nmap can be. If you want to learn more about Nmap and sharpen your hacking skills, check out one of the courses below available to StationX Members:

Learn Ethical Hacking From Scratch

4.8

Nmap Vulnerability Scan: How to Find Weak Systems Easily (10)

The Complete Nmap Ethical Hacking Course: Network Security Assessment

4.9

Nmap Vulnerability Scan: How to Find Weak Systems Easily (12)

Nmap For Penetration Testing

4.8

Nmap Vulnerability Scan: How to Find Weak Systems Easily (14)

Frequently Asked Questions

Is port scanning legal?

Port scanning is an active reconnaissance activity that sends network packets to interact with a target’s system. It is generally illegal to perform port scanning against systems you do not have permission to scan. You should consult your state or country's legislation before performing any kind of scan. You can find out more in Is port scanning legal?

Can Nmap scans be detected?

Yes. Nmap scans can be detected by Network Intrusion Detection Systems (NIDS), firewalls, and other security solutions based on the network signatures the scan generates. However, Nmap does come with several built-in options that you can use to try to evade detection. Read Nmap Ping Sweep: How to Scan Networks for Live Hosts to learn more.

Do hackers use Nmap?

Yes. Nmap is a very popular network scanning tool that is extensively used by penetration testers and hackers. It is lightweight, provides powerful capabilities, and is extensible through the Nmap Scripting Engine (NSE). This makes it a perfect choice for scanning computer networks.

Is Nmap only on Linux?

No. Nmap comes installed by default on Kali Linux but is also available on Windows, macOS, Linux, and many other UNIX platforms (Solaris, Free/Net/OpenBSD, etc.). It is a portable network scanning tool that penetration testers and red team operators can use across operating systems and in many different situations. To find out how to install Nmap on Ubuntu, read How to Install Nmap on Ubuntu: A Comprehensive Guide.

Level Up in Cyber Security: Join Our Membership Today!

Nmap Vulnerability Scan: How to Find Weak Systems Easily (15)
Nmap Vulnerability Scan: How to Find Weak Systems Easily (16)

MEMBERSHIP

  • Nmap Vulnerability Scan: How to Find Weak Systems Easily (17)

    Adam Goss

    Adam is a seasoned cyber security professional with extensive experience in cyber threat intelligence and threat hunting. He enjoys learning new tools and technologies, and holds numerous industry qualifications on both the red and blue sides. Adam aims to share the unique insights he has gained from his experiences through his blog articles. You can find Adam on LinkedIn or check out his other projects on LinkTree.

Nmap Vulnerability Scan: How to Find Weak Systems Easily (2024)
Top Articles
The 9 Best Crypto-Friendly Banks (Expert Reviewed) | CoinLedger
Can I Legally Stop My Ex Introducing A New Partner To My Child? - Crisp & Co Solicitors
Chs.mywork
Minooka Channahon Patch
Ffxiv Shelfeye Reaver
Celebrity Extra
Online Reading Resources for Students & Teachers | Raz-Kids
THE 10 BEST Women's Retreats in Germany for September 2024
What's New on Hulu in October 2023
What Was D-Day Weegy
Roblox Character Added
Ncaaf Reference
Jessica Renee Johnson Update 2023
Es.cvs.com/Otchs/Devoted
The Shoppes At Zion Directory
Local Collector Buying Old Motorcycles Z1 KZ900 KZ 900 KZ1000 Kawasaki - wanted - by dealer - sale - craigslist
735 Reeds Avenue 737 & 739 Reeds Ave., Red Bluff, CA 96080 - MLS# 20240686 | CENTURY 21
Mission Impossible 7 Showtimes Near Marcus Parkwood Cinema
Accuweather Mold Count
Schedule An Oil Change At Walmart
Air Traffic Control Coolmathgames
Bethel Eportal
Stihl Dealer Albuquerque
Page 2383 – Christianity Today
Star Wars Armada Wikia
8002905511
Duke University Transcript Request
Progressbook Newark
100 Million Naira In Dollars
Syracuse Jr High Home Page
The Latest: Trump addresses apparent assassination attempt on X
The value of R in SI units is _____?
Manuel Pihakis Obituary
Solarmovie Ma
Slv Fed Routing Number
Diana Lolalytics
Suspect may have staked out Trump's golf course for 12 hours before the apparent assassination attempt
Missouri State Highway Patrol Will Utilize Acadis to Improve Curriculum and Testing Management
The 50 Best Albums of 2023
Whitehall Preparatory And Fitness Academy Calendar
Main Street Station Coshocton Menu
Gravel Racing
Ferhnvi
Zipformsonline Plus Login
Amateur Lesbian Spanking
Bank Of America Appointments Near Me
Secrets Exposed: How to Test for Mold Exposure in Your Blood!
Fresno Craglist
Walmart Front Door Wreaths
Ubg98.Github.io Unblocked
Latest Posts
Article information

Author: Twana Towne Ret

Last Updated:

Views: 6460

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Twana Towne Ret

Birthday: 1994-03-19

Address: Apt. 990 97439 Corwin Motorway, Port Eliseoburgh, NM 99144-2618

Phone: +5958753152963

Job: National Specialist

Hobby: Kayaking, Photography, Skydiving, Embroidery, Leather crafting, Orienteering, Cooking

Introduction: My name is Twana Towne Ret, I am a famous, talented, joyous, perfect, powerful, inquisitive, lovely person who loves writing and wants to share my knowledge and understanding with you.