/usr/share/doc/tcpspy/tcpspy.8.html is in tcpspy 1.7d-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | <!-- Creator : groff version 1.20.1 -->
<!-- CreationDate: Sun May 16 19:52:01 2010 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
p { margin-top: 0; margin-bottom: 0; vertical-align: top }
pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
table { margin-top: 0; margin-bottom: 0; vertical-align: top }
h1 { text-align: center }
</style>
<title>TCPSPY</title>
</head>
<body>
<h1 align="center">TCPSPY</h1>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#EXIT STATUS">EXIT STATUS</a><br>
<a href="#SIGNALS">SIGNALS</a><br>
<a href="#EXAMPLES">EXAMPLES</a><br>
<a href="#BUGS">BUGS</a><br>
<a href="#AUTHOR">AUTHOR</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<hr>
<h2>NAME
<a name="NAME"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">tcpspy −
TCP/IP Connection Monitor</p>
<h2>SYNOPSIS
<a name="SYNOPSIS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>tcpspy</b>
[<b>-dp</b>] [<b>-e</b> <i>rule</i>]... [<b>-f</b>
<i>rulefile</i>]... [<b>-F</b> <i>facility</i>] [<b>-I</b>
<i>interval</i>] [<b>-U</b> <i>user</i>] [<b>-G</b>
<i>group</i>]</p>
<h2>DESCRIPTION
<a name="DESCRIPTION"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><i>tcpspy</i>
logs information about selected incoming and outgoing TCP/IP
connections to syslog. The following information is logged:
username, local address and port, remote address, port, and
optionally the filename of the executable. At present, only
the IPv4 protocol is supported.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Options <br>
-e</b> <i>’rule’</i></p>
<p style="margin-left:22%;">Log only connections matching
the specified rule. Rule syntax is outlined below. If this
option is specified more than once, connections matching any
of the specified rules are logged. You should quote the
rule, as shown above.</p>
<p style="margin-left:11%;"><b>-f</b> <i>rulefile</i></p>
<p style="margin-left:22%;">Read rules from
<i>rulefile</i>. Each rule is on a new line. The
’#’ character may be used to add comments;
everything from this character to the end of the line is
ignored.</p>
<p style="margin-left:22%; margin-top: 1em">The <b>-e</b>
and <b>-f</b> options may be used together.</p>
<p style="margin-left:11%;"><b>-F</b> <i>facility</i></p>
<p style="margin-left:22%;">Log to syslog facility
<i>facility</i> instead of the compile-time default setting.
See the <b>syslog.conf</b>(5) manual page for a list of
facilities.</p>
<p style="margin-left:11%;"><b>-I</b> <i>interval</i></p>
<p style="margin-left:22%;">Update the internal state every
<i>interval</i> milliseconds, instead of the default of 1000
ms. Connections that last less than <i>interval</i>
milliseconds may be missed, so you should experiment to find
a value small enough that it catches most connections, but
not so small that it causes tcpspy to use too much CPU
time.</p>
<p style="margin-left:11%;"><b>-U</b> <i>user</i></p>
<p style="margin-left:22%;">Switch to the specified user
after startup. <i>user</i> may be a numeric user id or a
user name from the system password file.</p>
<p style="margin-left:11%;"><b>-G</b> <i>group</i></p>
<p style="margin-left:22%;">Switch to the specified group
after startup. <i>group</i> may be a numeric group id or a
group name from the system group file. If a username to
switch to with the <b>-U</b> option is specified but
<b>-G</b> is omitted, tcpspy will switch to that specified
user’s primary group.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p><b>-d</b></p></td>
<td width="8%"></td>
<td width="78%">
<p>Debugging mode; if this option is specified, tcpspy will
not detach from the console after initialisation, and will
log connections to standard output instead of syslog.</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p><b>-p</b></p></td>
<td width="8%"></td>
<td width="78%">
<p>Log the filename of the executable that created/accepted
the connection. You may require superuser privileges to
obtain this information for processes you do not own (this
is a kernel limitation).</p></td></tr>
</table>
<p style="margin-left:22%; margin-top: 1em">This option can
greatly increase the amount of CPU time required to process
each connection/disconnection.</p>
<p style="margin-left:11%; margin-top: 1em"><b>Rule
Syntax</b> <br>
A rule may be specified with the <b>-e</b> option to log
information about connections matching this rule, overriding
the default of logging all connections.</p>
<p style="margin-left:11%; margin-top: 1em">The following
comparison operations are defined: <b><br>
user</b> <i>uid</i></p>
<p style="margin-left:22%;">True if the local user
initiating or accepting the connection has the
<b>effective</b> user id <i>uid</i>.</p>
<p style="margin-left:11%;"><b>user</b>
<i>"username"</i></p>
<p style="margin-left:22%;">Same as above, but using a
username instead of a user id.</p>
<p style="margin-left:11%;"><b>lport</b> <i>port</i></p>
<p style="margin-left:22%;">True if the local end of the
connection has port number <i>port</i>.</p>
<p style="margin-left:11%;"><b>lport</b> <i>[low] -
[high]</i></p>
<p style="margin-left:22%;">True if the local end of the
connection has a port number greater than or equal to
<i>low</i> and less than or equal to <i>high</i>. If the
form <i>low-</i> is used, high is assumed to be 65535. If
the form <i>-high</i> is used, low is assumed to be 0. It is
an error to omit both <i>low</i> and <i>high</i>.</p>
<p style="margin-left:11%;"><b>lport</b>
<i>"service"</i></p>
<p style="margin-left:22%;">Same as above, but using a
service name from <i>/etc/services</i> instead of a port
number.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="7%">
<p><b>rport</b></p></td>
<td width="4%"></td>
<td width="78%">
<p>Same as <b>lport</b> but compares the port number of the
remote end of the connection.</p></td></tr>
</table>
<p style="margin-left:11%;"><b>laddr</b>
<i>n.n.n.n[/m.m.m.m]</i></p>
<p style="margin-left:22%;">Interpreted as a
"net/mask" expression; true if "net" is
equal to the bitwise AND of the local address of the
connection and "mask". If no mask is specified, a
default mask with all bits set (255.255.255.255) is
used.</p>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="7%">
<p><b>raddr</b></p></td>
<td width="4%"></td>
<td width="70%">
<p>Same as <b>laddr</b> but compares the remote
address.</p> </td>
<td width="8%">
</td></tr>
</table>
<p style="margin-left:11%;"><b>exe</b>
<i>"pattern"</i></p>
<p style="margin-left:22%;">True if the full filename
(including directory) of the executable that
created/accepted the connection matches <i>pattern</i>, a
<b>glob</b>(7)-style wildcard pattern.</p>
<p style="margin-left:22%; margin-top: 1em">The pattern
"" (an empty string) matches connections
created/accepted by processes whose executable filename is
unknown.</p>
<p style="margin-left:22%; margin-top: 1em">If the
<b>-p</b> option is not specified, a warning message will be
printed, and the result of this comparison will always be
true.</p>
<p style="margin-left:11%; margin-top: 1em">Expressions
(including the comparisons listed above) may be joined
together with the following logical operations: <i><br>
expr1</i> <b>or</b> <i>expr2</i></p>
<p style="margin-left:22%;">True if either of <i>expr1</i>
or <i>expr2</i> are true (logical OR).</p>
<p style="margin-left:11%;"><i>expr1</i> <b>and</b>
<i>expr2</i></p>
<p style="margin-left:22%;">True if both <i>expr1</i> and
<i>expr2</i> are true (logical AND).</p>
<p style="margin-left:11%;"><b>not</b> <i>expr</i></p>
<p style="margin-left:22%;">True if <i>expr</i> is false
(logical NOT).</p>
<p style="margin-left:11%; margin-top: 1em">Rules are
evaluated from left to right. Whitespace (space, tab and
newline) characters are ignored between "words".
Rules consisting of only whitespace match no connections,
but do not cause an error. Parentheses, ’(’ and
’)’ may be placed around expressions to affect
the order of evaluation.</p>
<p style="margin-left:11%; margin-top: 1em">The Examples
section contains some sample rules which further demonstrate
how they are constructed.</p>
<h2>EXIT STATUS
<a name="EXIT STATUS"></a>
</h2>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p style="margin-top: 1em">0</p></td>
<td width="8%"></td>
<td width="53%">
<p style="margin-top: 1em">The daemon was successfully
started</p> </td>
<td width="25%">
</td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="3%">
<p>>0</p></td>
<td width="8%"></td>
<td width="53%">
<p>An error occurred</p></td>
<td width="25%">
</td></tr>
</table>
<h2>SIGNALS
<a name="SIGNALS"></a>
</h2>
<table width="100%" border="0" rules="none" frame="void"
cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td width="11%"></td>
<td width="6%">
<p style="margin-top: 1em"><i>TERM</i></p></td>
<td width="5%"></td>
<td width="76%">
<p style="margin-top: 1em">Shut down at most
<i>interval</i> milliseconds from now.</p></td>
<td width="2%">
</td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="6%">
<p><i>INT</i></p></td>
<td width="5%"></td>
<td width="76%">
<p>(Debugging mode only) Handled identically to
<i>TERM</i>.</p> </td>
<td width="2%">
</td></tr>
</table>
<p style="margin-left:11%; margin-top: 1em">All other
signals retain their default behaviour, which is documented
in <b>signal</b>(7).</p>
<h2>EXAMPLES
<a name="EXAMPLES"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">tcpspy -e
’user "joe" and rport
"ssh"’</p>
<p style="margin-left:22%;">Log connections made by user
"joe" for the service "ssh".</p>
<p style="margin-left:11%;">tcpspy -e ’not raddr
10.0.0.0/255.0.0.0 and rport 25 and (user "bob" or
<br>
user "joe")’</p>
<p style="margin-left:22%;">Log connections made by users
"bob" and "joe" to remote port 25 on
machines not on a fictional "intranet".</p>
<p style="margin-left:11%;">tcpspy -e ’exe
"/usr/bin/irc"’</p>
<p style="margin-left:22%;">Log connections made by
/usr/bin/irc (probably ircII).</p>
<h2>BUGS
<a name="BUGS"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">Empty rule
files cause <b>tcpspy</b> to log no connections instead of
all connections.</p>
<h2>AUTHOR
<a name="AUTHOR"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em">Tim J. Robbins
<tim@robbins.dropbear.id.au></p>
<h2>SEE ALSO
<a name="SEE ALSO"></a>
</h2>
<p style="margin-left:11%; margin-top: 1em"><b>glob</b>(7),
<b>proc</b>(5), <b>services</b>(5), <b>signal</b>(7),
<b>syslog</b>(3), <b>syslog.conf</b>(5)</p>
<hr>
</body>
</html>
|