1#	$OpenBSD: sniffer,v 1.6 2016/04/28 12:26:40 sthen Exp $
2
3#------------------------------------------------------------------------------
4# sniffer:  file(1) magic for packet capture files
5#
6# From: guy@alum.mit.edu (Guy Harris)
7#
8
9#
10# Microsoft Network Monitor 1.x capture files.
11#
120	string		RTSS		NetMon capture file
13>5	byte		x		- version %d
14>4	byte		x		\b.%d
15>6	leshort		0		(Unknown)
16>6	leshort		1		(Ethernet)
17>6	leshort		2		(Token Ring)
18>6	leshort		3		(FDDI)
19>6	leshort		4		(ATM)
20>6	leshort		>4		(type %d)
21
22#
23# Microsoft Network Monitor 2.x capture files.
24#
250	string		GMBU		NetMon capture file
26>5	byte		x		- version %d
27>4	byte		x		\b.%d
28>6	leshort		0		(Unknown)
29>6	leshort		1		(Ethernet)
30>6	leshort		2		(Token Ring)
31>6	leshort		3		(FDDI)
32>6	leshort		4		(ATM)
33>6	leshort		5		(IP-over-IEEE 1394)
34>6	leshort		6		(802.11)
35>6	leshort		7		(Raw IP)
36>6	leshort		8		(Raw IP)
37>6	leshort		9		(Raw IP)
38>6	leshort		>9		(type %d)
39
40#
41# Network General Sniffer capture files.
42# Sorry, make that "Network Associates Sniffer capture files."
43# Sorry, make that "Network General old DOS Sniffer capture files."
44# Sorry, make that "NetScout Sniffer capture files."
45#
460	string		TRSNIFF\ data\ \ \ \ \032	Sniffer capture file
47>33	byte		2		(compressed)
48>23	leshort		x		- version %d
49>25	leshort		x		\b.%d
50>32	byte		0		(Token Ring)
51>32	byte		1		(Ethernet)
52>32	byte		2		(ARCNET)
53>32	byte		3		(StarLAN)
54>32	byte		4		(PC Network broadband)
55>32	byte		5		(LocalTalk)
56>32	byte		6		(Znet)
57>32	byte		7		(Internetwork Analyzer)
58>32	byte		9		(FDDI)
59>32	byte		10		(ATM)
60
61#
62# Cinco Networks NetXRay capture files.
63# Sorry, make that "Network General Sniffer Basic capture files."
64# Sorry, make that "Network Associates Sniffer Basic capture files."
65# Sorry, make that "Network Associates Sniffer Basic, and Windows
66# Sniffer Pro", capture files."
67# Sorry, make that "Network General Sniffer capture files."
68#
690	string		XCP\0		NetXRay capture file
70>4	string		>\0		- version %s
71>44	leshort		0		(Ethernet)
72>44	leshort		1		(Token Ring)
73>44	leshort		2		(FDDI)
74>44	leshort		3		(WAN)
75>44	leshort		8		(ATM)
76>44	leshort		9		(802.11)
77
78#
79# "libpcap" capture files.
80# (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
81# the main program that uses that format, but there are other programs
82# that use "libpcap", or that use the same capture file format.)
83#
840	ubelong		0xa1b2c3d4	tcpdump capture file (big-endian)
85>4	beshort		x		- version %d
86>6	beshort		x		\b.%d
87>20	belong		0		(No link-layer encapsulation
88>20	belong		1		(Ethernet
89>20	belong		2		(3Mb Ethernet
90>20	belong		3		(AX.25
91>20	belong		4		(ProNET
92>20	belong		5		(CHAOS
93>20	belong		6		(Token Ring
94>20	belong		7		(BSD ARCNET
95>20	belong		8		(SLIP
96>20	belong		9		(PPP
97>20	belong		10		(FDDI
98>20	belong		11		(RFC 1483 ATM
99>20	belong		12		(raw IP
100>20	belong		13		(BSD/OS SLIP
101>20	belong		14		(BSD/OS PPP
102>20	belong		19		(Linux ATM Classical IP
103>20	belong		50		(PPP or Cisco HDLC
104>20	belong		51		(PPP-over-Ethernet
105>20	belong		99		(Symantec Enterprise Firewall
106>20	belong		100		(RFC 1483 ATM
107>20	belong		101		(raw IP
108>20	belong		102		(BSD/OS SLIP
109>20	belong		103		(BSD/OS PPP
110>20	belong		104		(BSD/OS Cisco HDLC
111>20	belong		105		(802.11
112>20	belong		106		(Linux Classical IP over ATM
113>20	belong		107		(Frame Relay
114>20	belong		108		(OpenBSD loopback
115>20	belong		109		(OpenBSD IPsec encrypted
116>20	belong		112		(Cisco HDLC
117>20	belong		113		(Linux "cooked"
118>20	belong		114		(LocalTalk
119>20	belong		117		(OpenBSD PFLOG
120>20	belong		119		(802.11 with Prism header
121>20	belong		122		(RFC 2625 IP over Fibre Channel
122>20	belong		123		(SunATM
123>20	belong		127		(802.11 with radiotap header
124>20	belong		129		(Linux ARCNET
125>20	belong		138		(Apple IP over IEEE 1394
126>20	belong		139		(MTP2 with pseudo-header
127>20	belong		140		(MTP2
128>20	belong		141		(MTP3
129>20	belong		142		(SCCP
130>20	belong		143		(DOCSIS
131>20	belong		144		(IrDA
132>20	belong		147		(Private use 0
133>20	belong		148		(Private use 1
134>20	belong		149		(Private use 2
135>20	belong		150		(Private use 3
136>20	belong		151		(Private use 4
137>20	belong		152		(Private use 5
138>20	belong		153		(Private use 6
139>20	belong		154		(Private use 7
140>20	belong		155		(Private use 8
141>20	belong		156		(Private use 9
142>20	belong		157		(Private use 10
143>20	belong		158		(Private use 11
144>20	belong		159		(Private use 12
145>20	belong		160		(Private use 13
146>20	belong		161		(Private use 14
147>20	belong		162		(Private use 15
148>20	belong		163		(802.11 with AVS header
149>20	belong		165		(BACnet MS/TP
150>20	belong		166		(PPPD
151>20	belong		169		(GPRS LLC
152>20	belong		177		(Linux LAPD
153>20	belong		187		(Bluetooth HCI H4
154>20	belong		189		(Linux USB
155>20	belong		192		(PPI
156>20	belong		195		(802.15.4
157>20	belong		196		(SITA
158>20	belong		197		(Endace ERF
159>20	belong		201		(Bluetooth HCI H4 with pseudo-header
160>20	belong		202		(AX.25 with KISS header
161>20	belong		203		(LAPD
162>20	belong		204		(PPP with direction pseudo-header
163>20	belong		205		(Cisco HDLC with direction pseudo-header
164>20	belong		206		(Frame Relay with direction pseudo-header
165>20	belong		209		(Linux IPMB
166>20	belong		215		(802.15.4 with non-ASK PHY header
167>20	belong		220		(Memory-mapped Linux USB
168>20	belong		224		(Fibre Channel FC-2
169>20	belong		225		(Fibre Channel FC-2 with frame delimiters
170>20	belong		226		(Solaris IPNET
171>20	belong		227		(SocketCAN
172>20	belong		228		(Raw IPv4
173>20	belong		229		(Raw IPv6
174>20	belong		230		(802.15.4 without FCS
175>20	belong		231		(D-Bus messages
176>20	belong		235		(DVB-CI
177>20	belong		236		(MUX27010
178>20	belong		237		(STANAG 5066 D_PDUs
179>20	belong		239		(Linux netlink NFLOG messages
180>20	belong		240		(Hilscher netAnalyzer
181>20	belong		241		(Hilscher netAnalyzer with delimiters
182>20	belong		242		(IP-over-Infiniband
183>20	belong		243		(MPEG-2 Transport Stream packets
184>20	belong		244		(ng4t ng40
185>20	belong		245		(NFC LLCP
186>20	belong		247		(Infiniband
187>20	belong		248		(SCTP
188>16	belong		x		\b, capture length %d)
1890	ulelong		0xa1b2c3d4	tcpdump capture file (little-endian)
190>4	leshort		x		- version %d
191>6	leshort		x		\b.%d
192>20	lelong		0		(No link-layer encapsulation
193>20	lelong		1		(Ethernet
194>20	lelong		2		(3Mb Ethernet
195>20	lelong		3		(AX.25
196>20	lelong		4		(ProNET
197>20	lelong		5		(CHAOS
198>20	lelong		6		(Token Ring
199>20	lelong		7		(ARCNET
200>20	lelong		8		(SLIP
201>20	lelong		9		(PPP
202>20	lelong		10		(FDDI
203>20	lelong		11		(RFC 1483 ATM
204>20	lelong		12		(raw IP
205>20	lelong		13		(BSD/OS SLIP
206>20	lelong		14		(BSD/OS PPP
207>20	lelong		19		(Linux ATM Classical IP
208>20	lelong		50		(PPP or Cisco HDLC
209>20	lelong		51		(PPP-over-Ethernet
210>20	lelong		99		(Symantec Enterprise Firewall
211>20	lelong		100		(RFC 1483 ATM
212>20	lelong		101		(raw IP
213>20	lelong		102		(BSD/OS SLIP
214>20	lelong		103		(BSD/OS PPP
215>20	lelong		104		(BSD/OS Cisco HDLC
216>20	lelong		105		(802.11
217>20	lelong		106		(Linux Classical IP over ATM
218>20	lelong		107		(Frame Relay
219>20	lelong		108		(OpenBSD loopback
220>20	lelong		109		(OpenBSD IPsec encrypted
221>20	lelong		112		(Cisco HDLC
222>20	lelong		113		(Linux "cooked"
223>20	lelong		114		(LocalTalk
224>20	lelong		117		(OpenBSD PFLOG
225>20	lelong		119		(802.11 with Prism header
226>20	lelong		122		(RFC 2625 IP over Fibre Channel
227>20	lelong		123		(SunATM
228>20	lelong		127		(802.11 with radiotap header
229>20	lelong		129		(Linux ARCNET
230>20	lelong		138		(Apple IP over IEEE 1394
231>20	lelong		139		(MTP2 with pseudo-header
232>20	lelong		140		(MTP2
233>20	lelong		141		(MTP3
234>20	lelong		142		(SCCP
235>20	lelong		143		(DOCSIS
236>20	lelong		144		(IrDA
237>20	lelong		147		(Private use 0
238>20	lelong		148		(Private use 1
239>20	lelong		149		(Private use 2
240>20	lelong		150		(Private use 3
241>20	lelong		151		(Private use 4
242>20	lelong		152		(Private use 5
243>20	lelong		153		(Private use 6
244>20	lelong		154		(Private use 7
245>20	lelong		155		(Private use 8
246>20	lelong		156		(Private use 9
247>20	lelong		157		(Private use 10
248>20	lelong		158		(Private use 11
249>20	lelong		159		(Private use 12
250>20	lelong		160		(Private use 13
251>20	lelong		161		(Private use 14
252>20	lelong		162		(Private use 15
253>20	lelong		163		(802.11 with AVS header
254>20	lelong		165		(BACnet MS/TP
255>20	lelong		166		(PPPD
256>20	lelong		169		(GPRS LLC
257>20	lelong		177		(Linux LAPD
258>20	lelong		187		(Bluetooth HCI H4
259>20	lelong		189		(Linux USB
260>20	lelong		192		(PPI
261>20	lelong		195		(802.15.4
262>20	lelong		196		(SITA
263>20	lelong		197		(Endace ERF
264>20	lelong		201		(Bluetooth HCI H4 with pseudo-header
265>20	lelong		202		(AX.25 with KISS header
266>20	lelong		203		(LAPD
267>20	lelong		204		(PPP with direction pseudo-header
268>20	lelong		205		(Cisco HDLC with direction pseudo-header
269>20	lelong		206		(Frame Relay with direction pseudo-header
270>20	lelong		209		(Linux IPMB
271>20	lelong		215		(802.15.4 with non-ASK PHY header
272>20	lelong		220		(Memory-mapped Linux USB
273>20	lelong		224		(Fibre Channel FC-2
274>20	lelong		225		(Fibre Channel FC-2 with frame delimiters
275>20	lelong		226		(Solaris IPNET
276>20	lelong		227		(SocketCAN
277>20	lelong		228		(Raw IPv4
278>20	lelong		229		(Raw IPv6
279>20	lelong		230		(802.15.4 without FCS
280>20	lelong		231		(D-Bus messages
281>20	lelong		235		(DVB-CI
282>20	lelong		236		(MUX27010
283>20	lelong		237		(STANAG 5066 D_PDUs
284>20	lelong		239		(Linux netlink NFLOG messages
285>20	lelong		240		(Hilscher netAnalyzer
286>20	lelong		241		(Hilscher netAnalyzer with delimiters
287>20	lelong		242		(IP-over-Infiniband
288>20	lelong		243		(MPEG-2 Transport Stream packets
289>20	lelong		244		(ng4t ng40
290>20	lelong		245		(NFC LLCP
291>20	lelong		247		(Infiniband
292>20	lelong		248		(SCTP
293>16	lelong		x		\b, capture length %d)
294
295#
296# "libpcap"-with-Alexey-Kuznetsov's-patches capture files.
297# (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
298# the main program that uses that format, but there are other programs
299# that use "libpcap", or that use the same capture file format.)
300#
3010	ubelong		0xa1b2cd34	extended tcpdump capture file (big-endian)
302>4	beshort		x		- version %d
303>6	beshort		x		\b.%d
304>20	belong		0		(No link-layer encapsulation
305>20	belong		1		(Ethernet
306>20	belong		2		(3Mb Ethernet
307>20	belong		3		(AX.25
308>20	belong		4		(ProNET
309>20	belong		5		(CHAOS
310>20	belong		6		(Token Ring
311>20	belong		7		(ARCNET
312>20	belong		8		(SLIP
313>20	belong		9		(PPP
314>20	belong		10		(FDDI
315>20	belong		11		(RFC 1483 ATM
316>20	belong		12		(raw IP
317>20	belong		13		(BSD/OS SLIP
318>20	belong		14		(BSD/OS PPP
319>16	belong		x		\b, capture length %d)
3200	ulelong		0xa1b2cd34	extended tcpdump capture file (little-endian)
321>4	leshort		x		- version %d
322>6	leshort		x		\b.%d
323>20	lelong		0		(No link-layer encapsulation
324>20	lelong		1		(Ethernet
325>20	lelong		2		(3Mb Ethernet
326>20	lelong		3		(AX.25
327>20	lelong		4		(ProNET
328>20	lelong		5		(CHAOS
329>20	lelong		6		(Token Ring
330>20	lelong		7		(ARCNET
331>20	lelong		8		(SLIP
332>20	lelong		9		(PPP
333>20	lelong		10		(FDDI
334>20	lelong		11		(RFC 1483 ATM
335>20	lelong		12		(raw IP
336>20	lelong		13		(BSD/OS SLIP
337>20	lelong		14		(BSD/OS PPP
338>16	lelong		x		\b, capture length %d)
339
340#
341# "pcap-ng" capture files.
342# http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html
343# Pcap-ng files can contain multiple sections. Printing the endianness,
344# snaplen, or other information from the first SHB may be misleading.
345#
3460	ubelong		0x0a0d0d0a
347>8	ubelong		0x1a2b3c4d	pcap-ng capture file
348>>12	beshort		x		- version %d
349>>14	beshort		x		\b.%d
3500	ulelong		0x0a0d0d0a
351>8	ulelong		0x1a2b3c4d	pcap-ng capture file
352>>12	leshort		x		- version %d
353>>14	leshort		x		\b.%d
354
355#
356# AIX "iptrace" capture files.
357#
3580	string		iptrace\ 1.0	"iptrace" capture file
3590	string		iptrace\ 2.0	"iptrace" capture file
360
361#
362# Novell LANalyzer capture files.
363#
3640	leshort		0x1001		LANalyzer capture file
3650	leshort		0x1007		LANalyzer capture file
366
367#
368# HP-UX "nettl" capture files.
369#
3700	string		\x54\x52\x00\x64\x00	"nettl" capture file
371
372#
373# RADCOM WAN/LAN Analyzer capture files.
374#
3750	string		\x42\xd2\x00\x34\x12\x66\x22\x88	RADCOM WAN/LAN Analyzer capture file
376
377#
378# NetStumbler log files.  Not really packets, per se, but about as
379# close as you can get.  These are log files from NetStumbler, a
380# Windows program, that scans for 802.11b networks.
381#
3820	string		NetS		NetStumbler log file
383>8	lelong		x		\b, %d stations found
384
385#
386# *Peek "version 9" capture files.
387#
3880	string		\177ver		EtherPeek/AiroPeek/OmniPeek capture file
389
390#
391# Visual Networks traffic capture files.
392#
3930	string		\x05VNF		Visual Networks traffic capture file
394
395#
396# Network Instruments Observer capture files.
397#
3980	string		ObserverPktBuffe	Network Instruments Observer capture file
399
400#
401# Files from Accellent Group's 5View products.
402#
4030	string		\xaa\xaa\xaa\xaa	5View capture file
404