How-to: install an Nmap script
author:Ron
Hey all,
I often find myself explaining to people how to install a script that isn’t included in Nmap. Rather than write it over and over, this is a quick tutorial.
First, you have to find out where your scripts are installed. The easiest way to do that is to search your harddrive for *.nse files.
Windows:
Windows Key + F, *.nse find / -name *.nseThe common places are:
c:Program FilesNmapScriptsWhile you’re at it, in the same folder as ‘scripts’, there should be another folder called ‘nselib’, which contains files named *.lua. That’s where libraries go.
Step 2: Get the script + librariesUsually, I’ll provide you with a link to the .nse file. All you have to do is download it and copy it into one of the directories above. If there are libraries to go with it (.lua files), copy them into the nselib folder.
Alternatively, you might be able to download them from the Nmap site itself, typically in the scripts folder.
Step 3: Update script database (optional)If you want to run the script using a wildcard or category, you have to run Nmap’s script update command:
$ nmap –script-updatedb
Note: if you’re ok with giving the full name of the script, this isn’t necessary.
Step 4: Run it!The last step is to run the script. Whether you are on the commandline or using Zenmap, the argument is the same: –script <scriptname>
ConclusionSo basically, you find the path where the scripts are stored, copy the script there, and run it. Simple!