Published on January 22, 2025
Nmap’s scripting engine (NSE) goes beyond simple port scanning, letting you detect vulnerabilities and gather more detailed data. This article covers how NSE scripts are categorized, where they live on your system, and how to run them to spot known CVEs on a target.
NSE scripts are grouped by categories like vuln, safe,
intrusive, and more. You can see these categories in
/usr/share/nmap/scripts/script.db
on Kali. A single script
can belong to multiple categories—scripts labeled “intrusive” might
cause a service to crash, so use them with caution.
To use Nmap for lightweight vulnerability scanning, you can run all vuln category scripts with:
sudo nmap -sV -p 443 --script "vuln" <target-IP>
Service detection (-sV
) helps Nmap identify software
versions. The vulners
script, for example, checks its
database for matching CVEs and displays details like severity and PoCs.
If an official script for a specific CVE doesn’t exist, you can often
find one online (e.g. GitHub). Place it in
/usr/share/nmap/scripts/
, then update the local database:
sudo nmap --script-updatedb
You can then reference it by filename:
sudo nmap -sV -p 443 --script "http-vuln-cve2021-41773" <target-IP>