Files Related to Scripting
The scripts used by the Nmap Scripting Engine may be considered
another kind of data file. Scripts are stored in a
scripts subdirectory of one of the directories
listed in
the section called “Using Customized Data Files”.
The name of
each script file ends in
.nse.
For all the details on scripts see Chapter 9, Nmap Scripting Engine.
All of the files in the script directory are executable scripts,
except for one:
script.db.
This file is a plain-text cache of which categories each script belongs
to. It should not be edited directly; use the
--script-updatedb
option instead.
Each of NSE's extension modules
(see
the section called “Lua Extensions”) is stored in one of two places. Pure Lua
extensions are kept in the nselib subdirectory of
the Nmap data directory, normally the same one
scripts is in. This is where modules like
shortport and stdnse are kept, in
files whose names end in
.lua.
Compiled C modules for NSE like bit are stored
in a separate place. On Unix they are normally in
/usr/libexec/nmap/nselib-bin or
/usr/local/libexec/nmap/nselib-bin. On Windows they
are likely in
C:\Program Files\Nmap\nselib-bin. Compiled NSE
modules have names ending in .so on Unix and
.dll on Windows. To modify a module or install
a new one, follow the instructions in
???.