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
|
.\" $OpenBSD: tcpdmatch.8,v 1.14 2003/07/08 13:47:28 jmc Exp $
.\"
.\" Copyright (c) 1997, Jason Downs. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS
.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd June 23, 1997
.Dt TCPDMATCH 8
.Os
.Sh NAME
.Nm tcpdmatch
.Nd tcp wrapper oracle
.Sh SYNOPSIS
.Nm tcpdmatch
.Op Fl d
.Op Fl i Ar inet_conf
.Ar daemon
.Ar client
.Pp
.Nm tcpdmatch
.Op Fl d
.Op Fl i Ar inet_conf
.Ar daemon Op Ar @server
.Op Ar user@
.Ar client
.Sh DESCRIPTION
.Nm
predicts how the tcp wrapper would handle a specific request for service.
Examples are given below.
.Pp
The program examines the
.Xr tcpd 8
access control tables (default
.Pa /etc/hosts.allow
and
.Pa /etc/hosts.deny )
and prints its conclusion.
For maximal accuracy, it extracts additional information from your
.Xr inetd 8
network configuration file.
.Pp
When
.Nm
finds a match in the access control tables, it identifies the matched rule.
In addition, it displays the optional
shell commands or options in a pretty-printed format; this makes it
easier for you to spot any discrepancies between what you want and what
the program understands.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl d
Examine
.Pa hosts.allow
and
.Pa hosts.deny
files in the current directory instead of the default ones.
.It Fl i Ar inet_conf
Specify this option when
.Nm
is unable to find your
.Pa inetd.conf
network configuration file, or when you wish to test with a non-default one.
.El
.Pp
The following two arguments are always required:
.Pp
.Bl -tag -width XXXXXX -compact
.It Ar daemon
A daemon process name.
Typically, the last component of a daemon executable pathname.
.It Ar client
A host name or network address, or one of the
.Dq unknown
or
.Dq paranoid
wildcard patterns.
.El
.Pp
When a client host name is specified,
.Nm
gives a prediction for each address listed for that client.
.Pp
When a client address is specified,
.Nm
predicts what
.Xr tcpd 8
would do when client name lookup fails.
.Pp
Optional information specified with the
.Ar daemon@server
form:
.Pp
.Bl -tag -width XXXXXX -compact
.It Ar server
A host name or network address, or one of the
.Dq unknown
or
.Dq paranoid
wildcard patterns.
The default server name is
.Dq unknown .
.El
.Pp
Optional information specified with the
.Ar user@client
form:
.Pp
.Bl -tag -width XXXXXX -compact
.It Ar user
A client user identifier.
Typically, a login name or a numeric user ID.
The default user name is
.Dq unknown .
.El
.Sh FILES
The default locations of the
.Xr tcpd 8
access control tables are:
.Pp
.Bl -tag -width /etc/hosts.allow -compact
.It Pa /etc/hosts.allow
access control table (allow list)
.It Pa /etc/hosts.deny
access control table (deny list)
.El
.Sh EXAMPLES
To predict how
.Xr tcpd 8
would handle a telnet request from the local system:
.Pp
.Dl $ tcpdmatch telnetd localhost
.Pp
The same request, pretending that hostname lookup failed:
.Pp
.Dl $ tcpdmatch telnetd 127.0.0.1
.Pp
To predict what
.Xr tcpd 8
would do when the client name does not match the client address:
.Pp
.Dl $ tcpdmatch telnetd paranoid
.\" .Pp
.\" On some systems, daemon names have no `in.' prefix, or
.\" .Nm tcpdmatch\
.\" may need some help to locate the inetd configuration file.
.Sh SEE ALSO
.Xr hosts_access 5 ,
.Xr hosts_options 5 ,
.Xr inetd.conf 5 ,
.Xr tcpdchk 8
.Sh AUTHORS
.Bd -unfilled -offset indent
Wietse Venema (wietse@wzv.win.tue.nl),
Department of Mathematics and Computing Science,
Eindhoven University of Technology
Den Dolech 2, P.O. Box 513,
5600 MB Eindhoven, The Netherlands
.Ed
.\" @(#) tcpdmatch.8 1.5 96/02/11 17:01:35
|