

$ nmap -script filename|category|directory|expression. The syntax for enabling scripts is as follows: $ nmap -sC target #load default scripts NSE scripts are loaded using the -script flag, which also allows you to run your own scripts by providing categories, script file names, or the name of directories where your scripts are located. usr/share/nmap/scripts/allseeingeye-info.nse usr/share/nmap/scripts/afp-showmount.nse usr/share/nmap/scripts/afp-serverinfo.nse usr/share/nmap/scripts/afp-path-vuln.nse To see the location of all available NSE scripts, run the locate utility on the terminal, like this: $ locate *.nse Nmap uses the scripts/script.db database to figure out the available default scripts and categories.

Considering this, it is recommended to use a prerule for purposes of consistency.

Host scripts – are scripts executed after Nmap has performed normal operations such as host discovery, port scanning, version detection, and OS detection against a target host.Prerule scripts – are scripts that run before any of Nmap’s scan operations, they are executed when Nmap hasn’t gathered any information about a target yet.There are four types of NSE scripts, namely: Read Also: 29 Practical Examples of Nmap Commands for Linux It enables you to write your own scripts in Lua programming language, and possibly share these scripts with other Nmap users out there. One of the interesting features of Nmap is the Nmap Script Engine ( NSE), which brings even more flexibility and efficiency to it. It can also help you get an overview of systems that connected your network you can use it to find out all IP addresses of live hosts, scan open ports and services running on those hosts, and so much more. Nmap is a popular, powerful and cross-platform command-line network security scanner and exploration tool.
