Using NSE scripts against a target host
The Nmap project introduced a feature named the Nmap Scripting Engine that allows users to extend the capabilities of Nmap via Lua scripts. NSE scripts are very powerful and have become one of Nmap's main strengths, performing tasks from advanced version detection to vulnerability exploitation. At the moment, there are more than 600 scripts helping users perform a wide range of tasks using the target information obtained from the executed scan. Using host and port rules, they can even be configured to run without port scanning a target, something that is really useful during reconnaissance tasks.
This recipe describes how to run NSE scripts, and the different options available to configure their execution.
How to do it...
Enable script scan using the Nmap -sC
option. This mode will select all NSE scripts belonging to the default category and execute them against our targets based on their host and port rules:
$ nmap -sC <target...