欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

How-to: install an Nmap script

程序员文章站 2022-12-04 08:38:17
author:Ron Hey all, I often find myself explaining to people how to install a script that isn’...

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.

Step 1: Figure out where your scripts are stored

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

Linux:

find / -name *.nse

How-to: install an Nmap script

The common places are:

c:Program FilesNmapScripts

While 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 + libraries

Usually, 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.

How-to: install an Nmap script

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>

How-to: install an Nmap script

Conclusion

So basically, you find the path where the scripts are stored, copy the script there, and run it. Simple!