1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-07 22:16:33 +00:00

document --script all

This commit is contained in:
fyodor
2007-11-29 22:52:02 +00:00
parent 5a24e1a0e7
commit 5e50f5084a
3 changed files with 72 additions and 48 deletions

View File

@@ -1946,47 +1946,58 @@ way.</para>
</varlistentry>
<varlistentry>
<term><option>--script=&lt;script-categories|directory|filename&gt;</option>
<indexterm><primary>--script</primary></indexterm></term>
<term><option>--script &lt;script-categories|directory|filename|all&gt;</option><indexterm><primary>--script</primary></indexterm></term>
<listitem>
<listitem>
<para>Runs a script scan (like <option>-sC</option>) with the scripts you have chosen rather than the defaults. Arguments can be script categories, single scripts or directories with scripts which are to be run against the target hosts instead of the default set. Nmap will try to interpret the arguments at first as categories and afterwards as files or directories. Absolute paths are used as is, relative paths are searched in the following places until found:
<filename>--datadir/</filename>;
<filename>$(NMAPDIR)/</filename>;
<filename>~user/nmap/</filename> (not searched on Windows);
<filename>NMAPDATADIR/</filename> or
<filename>./</filename>. A <filename>scripts/</filename> subdirectory is also tried in each of these. Give the argument <literal>all</literal> to execute all scripts in the Nmap script database.
</para>
<para>
gives you the opportunity to choose from a custom set of
scripts. You can specify script-categories, single scripts and/or
directories with scripts which are to be run against the target hosts
instead of the default set. Nmap will try to interpret the arguments
at first as categories and afterwards as files or directories in one
of the following places
<filename>--datadir/</filename> ;
<filename>$(NMAPDIR)/</filename> ;
<filename>~user/nmap/</filename> (only on *nix-platforms);
<filename>NMAPDATADIR/</filename> or
<filename>./</filename> (optionally inside a
<filename>scripts/</filename> subdirectory).
</para>
</listitem>
</varlistentry>
<para>If a directory is specified and found, Nmap loads all NSE
scripts (any filenames ending with <literal>.nse</literal>) from that
directory. They must have the filename extension
<literal>nse</literal>. Nmap does not recurse into subdirectories to
find scripts. When individual file names are specified, the file
extension does not have to be <literal>nse</literal>.
</para>
<para>Nmap scripts are stored in a <filename>scripts</filename>
subdirectory of the Nmap data directory
by default. Scripts are indexed in a database stored in
<filename>scripts/script.db</filename>. The database lists all of the
scripts in each category. A single script may be in several
categories.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--script-args=&lt;name1=value1,name2={name3=value3},name4=value4&gt;</option>
<indexterm><primary>--script-args</primary></indexterm></term>
<listitem>
<term><option>--script-args=&lt;name1=value1,name2={name3=value3},name4=value4&gt;</option><indexterm><primary>--script-args</primary></indexterm></term>
<listitem>
<para>lets you provide arguments to NSE-scripts. Arguments are passed
as <literal>name=value</literal> pairs. The provided argument is processed and stored
inside a Lua table, to which all scripts have access. The names are
taken as strings (which must be alphanumeric values) and used as
keys inside the <literal>argument-table</literal>. Values are either strings or tables
themselves (surrounded by &lsquo;<literal>{</literal>&rsquo; and &lsquo;<literal>}</literal>&rsquo;. Subtables make
it possible to override arguments for specific scripts (e.g. when you
want to provide different login/password pairs for different scripts).
For example, you could pass the comma-separated arguments:
<literal>user=bar</literal>,<literal>password=foo</literal>, and <literal>anonFTP={password=nobody@foobar.com}</literal>. If you want to override an option to a script, you should
index the subtable with the script's <literal>id</literal>, since this
is the only way the script knows about its special argument.</para>
</listitem> </varlistentry>
as <literal>name=value</literal> pairs. The provided argument is
processed and stored inside a Lua table, to which all scripts have
access. The names are taken as strings (which must be alphanumeric
values) and used as keys inside the
<literal>argument-table</literal>. Values are either strings or tables
themselves (surrounded by &lsquo;<literal>{</literal>&rsquo; and
&lsquo;<literal>}</literal>&rsquo;. Subtables make it possible to
override arguments for specific scripts (e.g. when you want to provide
different login/password pairs for different scripts). For example,
you could pass the comma-separated arguments:
<literal>user=bar</literal>,<literal>password=foo</literal>, and
<literal>anonFTP={password=nobody@foobar.com}</literal>. If you want
to override an option to a script, you should index the subtable with
the script's <literal>id</literal>, since this is the only way the
script knows about its special argument.</para>
</listitem>
</varlistentry>
<varlistentry>