1 .\" $OpenBSD: pf.os.5,v 1.8 2007/05/31 19:19:58 jmc Exp $
3 .\" Copyright (c) 2003 Mike Frantzen <frantzen@w4g.org>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 .Nd format of the operating system fingerprints file
27 program can both fingerprint the operating system of hosts that
28 originate an IPv4 TCP connection.
29 The file consists of newline-separated records, one per fingerprint,
33 These fields are as follows:
35 .Bl -tag -width Description -offset indent -compact
41 The presence of the IPv4 don't fragment bit.
43 The size of the initial TCP packet.
45 An ordered list of the TCP options.
47 The class of operating system.
49 The version of the operating system.
51 The subtype of patchlevel of the operating system.
53 The overall textual description of the operating system, version and subtype.
58 field corresponds to the th->th_win field in the TCP header and is the
59 source host's advertised TCP window size.
60 It may be between zero and 65,535 inclusive.
61 The window size may be given as a multiple of a constant by prepending
62 the size with a percent sign
64 and the value will be used as a modulus.
65 Three special values may be used for the window size:
67 .Bl -tag -width xxx -offset indent -compact
69 An asterisk will wildcard the value so any window size will match.
71 Allow any window size which is a multiple of the maximum segment size (MSS).
73 Allow any window size which is a multiple of the maximum transmission unit
79 value is the initial time to live in the IP header.
80 The fingerprint code will account for the volatility of the packet's TTL
81 as it traverses a network.
85 bit corresponds to the Don't Fragment bit in an IPv4 header.
86 It tells intermediate routers not to fragment the packet and is used for
88 It may be either a zero or a one.
92 is the literal size of the full IP packet and is a function of all of
93 the IP and TCP options.
97 field is an ordered list of the individual TCP options that appear in the
99 Each option is described by a single character separated by a comma and
100 certain ones may include a value.
103 .Bl -tag -width Description -offset indent -compact
105 maximum segment size (MSS) option.
106 The value is the maximum packet size of the network link which may
109 modulus or match all MSSes with the
113 the NOP option (NO Operation).
115 the timestamp option.
116 Certain operating systems always start with a zero timestamp in which
117 case a zero value is added to the option; otherwise no value is appended.
119 the Selective ACKnowledgement OK (SACKOK) option.
121 window scaling option.
122 The value is the size of the window scaling which may include the
124 modulus or match all window scalings with the
129 No TCP options in the fingerprint may be given with a single dot
136 .Dl M*,N,N,S,N,W0,N,N,T
140 is the MSS option and will match all values.
141 The second and third options
146 will match the SACKOK option.
149 will match another NOP.
152 will match a window scaling option with a zero scaling size.
153 The seventh and eighth
155 options will match two NOPs.
156 And the ninth and final option
158 will match the timestamp option with any time value.
160 The TCP options in a fingerprint will only match packets with the
161 exact same TCP options in the same order.
165 field is the class, genre or vendor of the operating system.
169 is the version of the operating system.
170 It is used to distinguish between different fingerprints of operating
171 systems of the same class but different versions.
175 is the subtype or patch level of the operating system version.
176 It is used to distinguish between different fingerprints of operating
177 systems of the same class and same version but slightly different
182 is a general description of the operating system, its version,
183 patchlevel and any further useful details.
185 The fingerprint of a plain
189 16384:64:1:64:M*,N,N,S,N,W0,N,N,T:OpenBSD:3.3::OpenBSD 3.3
192 The fingerprint of an
194 host behind a PF scrubbing firewall with a no-df rule would be:
196 16384:64:0:64:M*,N,N,S,N,W0,N,N,T:OpenBSD:3.3:!df:OpenBSD 3.3 scrub no-df
199 An absolutely braindead embedded operating system fingerprint could be:
201 65535:255:0:40:.:DUMMY:1.1:p3:Dummy embedded OS v1.1p3
208 # tcpdump -s128 -c1 -nv 'tcp[13] == 2'
209 03:13:48.118526 10.0.0.1.3377 > 10.0.0.2.80: S [tcp sum ok] \e
210 534596083:534596083(0) win 57344 <mss 1460> (DF) [tos 0x10] \e
211 (ttl 64, id 11315, len 44)
214 almost translates into the following fingerprint
216 57344:64:1:44:M1460: exampleOS:1.0::exampleOS 1.0