~ubuntu-branches/ubuntu/karmic/tcpspy/karmic

« back to all changes in this revision

Viewing changes to debian/tcpspy.8

  • Committer: Bazaar Package Importer
  • Author(s): Pablo Lorenzzoni
  • Date: 2002-01-25 00:00:00 UTC
  • Revision ID: james.westby@ubuntu.com-20020125000000-acrs0yl4g2xchacd
Tags: 1.7d-1
* Fixes a crash with an empty ruleset.
* Fixes the split rule problem.
* Fixes the /proc/net/tcp incompatibility problem (Closes: #115613).
* The upstream said that he is out of time to release v2.0, so he'll
  get the 1.x series a little far than originally expected.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" This file is part of tcpspy, a TCP/IP connection monitor.
 
2
.\"
 
3
.\" Copyright (c) 2000, 2001 Tim J. Robbins. 
 
4
.\" All rights reserved.
 
5
.\" 
 
6
.\" Redistribution and use in source and binary forms, with or without
 
7
.\" modification, are permitted provided that the following conditions
 
8
.\" are met:
 
9
.\" 1. Redistributions of source code must retain the above copyright
 
10
.\"    notice, this list of conditions and the following disclaimer.
 
11
.\" 2. Redistributions in binary form must reproduce the above copyright
 
12
.\"    notice, this list of conditions and the following disclaimer in the
 
13
.\"    documentation and/or other materials provided with the distribution.
 
14
.\" 3. The name of the author may not be used to endorse or promote products
 
15
.\"    derived from this software without specific prior written permission.
 
16
.\" 
 
17
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
 
18
.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 
19
.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
 
20
.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 
21
.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 
22
.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 
23
.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 
24
.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 
25
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 
26
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
27
.\"
 
28
.\" $Id: tcpspy.8,v 1.39 2001/05/20 11:52:12 tim Stab $
 
29
.TH TCPSPY 8 "May 2001" TJR "tcpspy 1.7"
 
30
.SH NAME
 
31
tcpspy \- TCP/IP Connection Monitor
 
32
.SH SYNOPSIS
 
33
.B tcpspy
 
34
.RB [ "-dp" ]
 
35
.RB [ "-e"
 
36
.IR "rule" ]...
 
37
.RB [ "-f"
 
38
.IR "rulefile" ]...
 
39
.RB [ "-F"
 
40
.IR "facility" ]
 
41
.RB [ "-I"
 
42
.IR "interval" ]
 
43
.RB [ "-U"
 
44
.IR "user" ]
 
45
.RB [ "-G"
 
46
.IR "group" ]
 
47
.SH DESCRIPTION
 
48
.I tcpspy
 
49
logs information about selected incoming and outgoing TCP/IP connections to
 
50
syslog. The following information is logged: username, local address and port,
 
51
remote address, port, and optionally the filename of the executable. At
 
52
present, only the IPv4 protocol is supported.
 
53
.PP
 
54
.SS "Options"
 
55
.TP
 
56
.BI -e " 'rule'"
 
57
Log only connections matching the specified rule. Rule syntax is outlined
 
58
below. If this option is specified more than once, connections matching any
 
59
of the specified rules are logged. You should quote the rule, as shown above.
 
60
.TP
 
61
.BI -f " rulefile"
 
62
Read rules from
 
63
.IR rulefile .
 
64
Each rule is on a new line. The `#' character may be used to add comments;
 
65
everything from this character to the end of the line is ignored.
 
66
 
 
67
The
 
68
.B -e
 
69
and
 
70
.B -f
 
71
options may be used together.
 
72
.TP
 
73
.BI -F " facility"
 
74
Log to syslog facility
 
75
.I facility
 
76
instead of the compile-time default setting. See the
 
77
.BR syslog.conf (5)
 
78
manual page for a list of facilities.
 
79
.TP
 
80
.BI -I " interval"
 
81
Update the internal state every
 
82
.I interval
 
83
milliseconds, instead of the default of 1000 ms. Connections that last less
 
84
than
 
85
.I interval
 
86
milliseconds may be missed, so you should experiment to find a value small
 
87
enough that it catches most connections, but not so small that it causes
 
88
tcpspy to use too much CPU time.
 
89
.TP
 
90
.BI -U " user"
 
91
Switch to the specified user after startup.
 
92
.I user
 
93
may be a numeric user id or a user name from the system password file.
 
94
.TP
 
95
.BI -G " group"
 
96
Switch to the specified group after startup.
 
97
.I group
 
98
may be a numeric group id or a group name from the system group file.
 
99
If a username to switch to with the
 
100
.B -U
 
101
option is specified but
 
102
.B -G
 
103
is omitted, tcpspy will switch to that specified user's primary group.
 
104
.TP
 
105
.B -d
 
106
Debugging mode; if this option is specified, tcpspy will not detach from the
 
107
console after initialisation, and will log connections to standard output
 
108
instead of syslog.
 
109
.TP
 
110
.B -p
 
111
Log the filename of the executable that created/accepted the connection.
 
112
You may require superuser privileges to obtain this information for processes
 
113
you do not own (this is a kernel limitation).
 
114
 
 
115
This option can greatly increase the amount of CPU time required to
 
116
process each connection/disconnection.
 
117
 
 
118
.PP
 
119
.SS "Rule Syntax"
 
120
A rule may be specified with the
 
121
.B -e
 
122
option to log information about connections matching this rule, overriding
 
123
the default of logging all connections.
 
124
.PP
 
125
The following comparison operations are defined:
 
126
.TP
 
127
.BI user " uid"
 
128
True if the local user initiating or accepting the connection has the
 
129
.B effective
 
130
user id
 
131
.IR uid .
 
132
.TP
 
133
.BI user " \N'34'username\N'34'"
 
134
Same as above, but using a username instead of a user id.
 
135
.TP
 
136
.BI lport " port"
 
137
True if the local end of the connection has port number
 
138
.IR port .
 
139
.TP
 
140
.BI lport " [low] - [high]"
 
141
True if the local end of the connection has a port number
 
142
greater than or equal to
 
143
.I low
 
144
and less than or equal to
 
145
.IR high .
 
146
If the form
 
147
.I low-
 
148
is used, high is assumed to be 65535.
 
149
If the form
 
150
.I -high
 
151
is used, low is assumed to be 0. It is an error to omit both
 
152
.IR low " and " high .
 
153
.TP
 
154
.BI lport " \N'34'service\N'34'"
 
155
Same as above, but using a service name from
 
156
.I /etc/services
 
157
instead of a port number.
 
158
.TP
 
159
.B rport
 
160
Same as
 
161
.B lport
 
162
but compares the port number of the remote end of the connection.
 
163
.TP
 
164
.BI laddr " n.n.n.n[/m.m.m.m]"
 
165
Interpreted as a "net/mask" expression; true if "net" is equal to the bitwise
 
166
AND of the local address of the connection and "mask". If no mask is specified,
 
167
a default mask with all bits set (255.255.255.255) is used.
 
168
.TP
 
169
.B raddr
 
170
Same as
 
171
.B laddr
 
172
but compares the remote address.
 
173
.TP
 
174
.BI exe " \N'34'pattern\N'34'"
 
175
True if the full filename (including directory) of the executable that 
 
176
created/accepted the connection matches
 
177
.IR pattern ,
 
178
a
 
179
.BR glob (7)-style
 
180
wildcard pattern.
 
181
 
 
182
The pattern "" (an empty string) matches connections created/accepted by 
 
183
processes whose executable filename is unknown.
 
184
 
 
185
If the
 
186
.B -p
 
187
option is not specified, a warning message will be printed, and the result of
 
188
this comparison will always be true.
 
189
.PP
 
190
Expressions (including the  comparisons listed above) may be joined together
 
191
with the following logical operations:
 
192
.TP
 
193
.IB expr1 " or " expr2
 
194
True if either of
 
195
.I expr1
 
196
or
 
197
.I expr2
 
198
are true (logical OR).
 
199
.TP
 
200
.IB expr1 " and " expr2
 
201
True if both
 
202
.I expr1
 
203
and
 
204
.I expr2
 
205
are true (logical AND).
 
206
.TP
 
207
.BI not " expr"
 
208
True if
 
209
.I expr
 
210
is false (logical NOT).
 
211
.PP
 
212
Rules are evaluated from left to right. Whitespace (space, tab and newline)
 
213
characters are ignored between "words". Rules consisting of only whitespace
 
214
match no connections, but do not cause an error.
 
215
Parentheses, '(' and ')' may be placed around expressions to affect the order
 
216
of evaluation.
 
217
.PP
 
218
The Examples section contains some sample rules which further demonstrate how
 
219
they are constructed.
 
220
 
 
221
.SH "EXIT STATUS"
 
222
.TP
 
223
0
 
224
The daemon was successfully started
 
225
.TP
 
226
>0
 
227
An error occurred
 
228
 
 
229
.SH SIGNALS
 
230
.TP
 
231
.I TERM
 
232
Shut down at most
 
233
.I interval
 
234
milliseconds from now.
 
235
.TP
 
236
.I INT
 
237
(Debugging mode only) Handled identically to
 
238
.IR TERM .
 
239
.PP
 
240
All other signals retain their default behaviour, which is documented in
 
241
.BR signal (7).
 
242
 
 
243
.SH EXAMPLES
 
244
.TP
 
245
tcpspy -e 'user "joe" and rport "ssh"'
 
246
Log connections made by user "joe" for the service "ssh".
 
247
.TP
 
248
tcpspy -e 'not raddr 10.0.0.0/255.0.0.0 and rport 25 and (user "bob" or user "joe")'
 
249
Log connections made by users "bob" and "joe" to remote port 25 on machines
 
250
not on a fictional "intranet".
 
251
.TP
 
252
tcpspy -e 'exe "/usr/bin/irc"'
 
253
Log connections made by /usr/bin/irc (probably ircII).
 
254
 
 
255
.SH AUTHOR
 
256
Tim J. Robbins <tim@robbins.dropbear.id.au>
 
257
 
 
258
.SH SEE ALSO
 
259
.BR glob (7),
 
260
.BR proc (5),
 
261
.BR services (5),
 
262
.BR signal (7),
 
263
.BR syslog (3),
 
264
.BR syslog.conf (5),
 
265
.BR tcpspy.rules (5)