1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
|
<HTML>
<HEAD>
<TITLE>ngen - create a baseline set of nmap results from command-line
specifications and/or an nmap results file.</TITLE>
<LINK REV="made" HREF="mailto:root@porky.devel.redhat.com">
</HEAD>
<BODY>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#NAME">NAME</A>
<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
<LI><A HREF="#OPTIONS">OPTIONS</A>
<LI><A HREF="#DATA_STORES">DATA STORES</A>
<LI><A HREF="#SUBSTITUTIONS">SUBSTITUTIONS</A>
<LI><A HREF="#BUGS">BUGS</A>
<LI><A HREF="#AUTHOR">AUTHOR</A>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="NAME">NAME</A></H1>
<P>
ngen - create a baseline set of nmap results from command-line
specifications and/or an nmap results file.
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<P>
<PRE> ngen [-o|-output <filename-or-:tag>] [-p|-ports <port list>]
[-h|-host <specification> ... -h|-host <specification N>]
</PRE>
<P>
<PRE> <specification> =
[!]<host spec>[:<port spec>][:ignored state]
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
The ngen utility creates an nmap-style machine-readable results file for
use as a baseline for ndiff comparision.
<P>
<HR>
<H1><A NAME="OPTIONS">OPTIONS</A></H1>
<DL>
<DT><STRONG><A NAME="item__o">-o <filename-or-:tag></A></STRONG><DD>
<DT><STRONG><A NAME="item__output">-output <filename-or-:tag></A></STRONG><DD>
<P>
Specifies the output filename, or optionally a data store tag, if begins
with a colon (:). See <A HREF="#DATA_STORES">DATA STORES</A> below for more information.
<DT><STRONG><A NAME="item__p">-p <port list></A></STRONG><DD>
<DT><STRONG><A NAME="item__ports">-ports <port list></A></STRONG><DD>
<P>
Specifies the set of all ports scanned, comma-separated. Ranges may be
specified. For example:
<P>
<PRE> -p 80,443,6000-6010,22
-ports 53
</PRE>
<P>
By default, tcp is assumed; udp may be specified by appending the ``u''
flag. (``t'' may be specified but is redundant)
<P>
<PRE> -p 323u,80,6000-6010t
</PRE>
<P>
If the <STRONG>-p</STRONG> option is omitted, ngen will grab the set of ports from
/usr/local/lib/nmap/nmap-services and /etc/services.
<P>
The default, ``Ignored'' specified for a given host is applied to all ports
in this list, except for ``interesting'' ports, which are specified below
with the <STRONG>-h</STRONG> option.
<P>
See the description of port specifications with the <STRONG>-h</STRONG> option below for more information.
<DT><STRONG><A NAME="item__h">-h [!]<host ranges>[:<port ranges>][:<ignored state>]</A></STRONG><DD>
<DT><STRONG><A NAME="item__host">-host [!]<host ranges>[:<port ranges>][:<ignored state>]</A></STRONG><DD>
<P>
Adds a host or range of hosts. For example
<P>
<PRE> -h 192.168.2.2 # one host
-h 10.0.2.0-64 # 65 hosts
-host 192.168.1.0/26 # 64 hosts
-host 192.168.*.* # 65536 hosts
</PRE>
<P>
<PRE>
The above examples add hosts with all ports closed. To add
ports to the hosts, append a colon and a port spec. For example
to add localhost with tcp ports 80 and 53 open, ignored state "closed",
the specification would be
</PRE>
<P>
<PRE> -host 127.0.0.1:80,53
</PRE>
<P>
Flags may be appended to change the protocol or state for a given port, for
example:
<P>
<PRE> -host 127.0.0.1:7uf
</PRE>
<P>
which adds echo service, udp port 7 filtered state.
<P>
The full list of port flags are as follows:
<P>
<PRE> t - tcp port (default)
u - udp port
</PRE>
<P>
<PRE> o - port is in open state (default)
c - port is in closed state
f - port is in filtered state
x - port is in unfiltered state
</PRE>
<P>
The ignored state for the host may be specified by appending a colon and
the state to the host spec. Acceptable state labels are ``open'',
``closed'', ``filtered'', and ``unfiltered''.
<P>
<PRE> -h 10.0.2.0:80f:closed
</PRE>
<P>
which says all scanned ports default to closed state, except for 80/tcp
which is filtered.
<P>
A host spec is treated as a negation if it starts with ``!''. If ports are
specified as part of the host spec, those ports are deleted from any hosts
previously added which fall in the host range.
<P>
Host specs are applied in order as they appear on the command line, and
their effects are cumulative.
</DL>
<P>
<HR>
<H1><A NAME="DATA_STORES">DATA STORES</A></H1>
<P>
Nrun and its related tools can manipulate results in regular nmap-format
files, in any user-specified location, or they can handle storing and
organizing the data on behalf of the user, through a user-configurable
``data store''.
<P>
Whenever you precede a results tag with a colon (:), the tag will be
treated as a unique key into a data store, identifying the results set.
<P>
Currently the only supported data store is nmap format files placed in a
preconfigured directory. Other types may be added at a later date.
<P>
A legal tag may contain any alphanumeric string, plus dash, underscore, and
dot. %-style substitutions in the ilk of the ``date'' command are also
supported, allowing a tag to contain date, time, or the local hostname. See <A HREF="#SUBSTITUTIONS">SUBSTITUTIONS</A>
below for more information.
<P>
<HR>
<H1><A NAME="SUBSTITUTIONS">SUBSTITUTIONS</A></H1>
<P>
%-style substitutions supported in tags as follows:
<DL>
<DT><STRONG><A NAME="item__H">%H = hour</A></STRONG><DD>
<DT><STRONG><A NAME="item__M">%M = minute</A></STRONG><DD>
<DT><STRONG><A NAME="item__S">%S = second</A></STRONG><DD>
<DT><STRONG><A NAME="item__D">%D = day of month</A></STRONG><DD>
<DT><STRONG><A NAME="item__m">%m = month of year (01-12)</A></STRONG><DD>
<DT><STRONG><A NAME="item__Y">%Y = year, four digits</A></STRONG><DD>
<DT><STRONG><A NAME="item__j">%j = day of year, three digits</A></STRONG><DD>
<DT><STRONG><A NAME="item__w">%w = day of week (0-6) one digit</A></STRONG><DD>
</DL>
<P>
Except where noted, the above items are two digits, and local time. All are
zero-padded as appropriate.
<P>
In addtion-
<DL>
<DT><STRONG><A NAME="item__F">%F = output of "hostname" on the local machine</A></STRONG><DD>
</DL>
<P>
<HR>
<H1><A NAME="BUGS">BUGS</A></H1>
<P>
It is possible to create invalid nmap result files with ngen if you really
try to. No support for human-readable hostnames and portnames.
<P>
<HR>
<H1><A NAME="AUTHOR">AUTHOR</A></H1>
<P>
James Levine <<A HREF="mailto:jdl@vinecorp.com">jdl@vinecorp.com</A>>
</BODY>
</HTML>
|