xref: /freebsd/contrib/file/magic/Magdir/sniffer (revision b6cee71de37d56e36dbc118e2d9b03e7cece5709)
1*b6cee71dSXin LI
2*b6cee71dSXin LI#------------------------------------------------------------------------------
3*b6cee71dSXin LI# $File: sniffer,v 1.19 2013/01/06 01:11:04 christos Exp $
4*b6cee71dSXin LI# sniffer:  file(1) magic for packet capture files
5*b6cee71dSXin LI#
6*b6cee71dSXin LI# From: guy@alum.mit.edu (Guy Harris)
7*b6cee71dSXin LI#
8*b6cee71dSXin LI
9*b6cee71dSXin LI#
10*b6cee71dSXin LI# Microsoft Network Monitor 1.x capture files.
11*b6cee71dSXin LI#
12*b6cee71dSXin LI0	string		RTSS		NetMon capture file
13*b6cee71dSXin LI>5	byte		x		- version %d
14*b6cee71dSXin LI>4	byte		x		\b.%d
15*b6cee71dSXin LI>6	leshort		0		(Unknown)
16*b6cee71dSXin LI>6	leshort		1		(Ethernet)
17*b6cee71dSXin LI>6	leshort		2		(Token Ring)
18*b6cee71dSXin LI>6	leshort		3		(FDDI)
19*b6cee71dSXin LI>6	leshort		4		(ATM)
20*b6cee71dSXin LI>6	leshort		>4		(type %d)
21*b6cee71dSXin LI
22*b6cee71dSXin LI#
23*b6cee71dSXin LI# Microsoft Network Monitor 2.x capture files.
24*b6cee71dSXin LI#
25*b6cee71dSXin LI0	string		GMBU		NetMon capture file
26*b6cee71dSXin LI>5	byte		x		- version %d
27*b6cee71dSXin LI>4	byte		x		\b.%d
28*b6cee71dSXin LI>6	leshort		0		(Unknown)
29*b6cee71dSXin LI>6	leshort		1		(Ethernet)
30*b6cee71dSXin LI>6	leshort		2		(Token Ring)
31*b6cee71dSXin LI>6	leshort		3		(FDDI)
32*b6cee71dSXin LI>6	leshort		4		(ATM)
33*b6cee71dSXin LI>6	leshort		5		(IP-over-IEEE 1394)
34*b6cee71dSXin LI>6	leshort		6		(802.11)
35*b6cee71dSXin LI>6	leshort		7		(Raw IP)
36*b6cee71dSXin LI>6	leshort		8		(Raw IP)
37*b6cee71dSXin LI>6	leshort		9		(Raw IP)
38*b6cee71dSXin LI>6	leshort		>9		(type %d)
39*b6cee71dSXin LI
40*b6cee71dSXin LI#
41*b6cee71dSXin LI# Network General Sniffer capture files.
42*b6cee71dSXin LI# Sorry, make that "Network Associates Sniffer capture files."
43*b6cee71dSXin LI# Sorry, make that "Network General old DOS Sniffer capture files."
44*b6cee71dSXin LI#
45*b6cee71dSXin LI0	string		TRSNIFF\ data\ \ \ \ \032	Sniffer capture file
46*b6cee71dSXin LI>33	byte		2		(compressed)
47*b6cee71dSXin LI>23	leshort		x		- version %d
48*b6cee71dSXin LI>25	leshort		x		\b.%d
49*b6cee71dSXin LI>32	byte		0		(Token Ring)
50*b6cee71dSXin LI>32	byte		1		(Ethernet)
51*b6cee71dSXin LI>32	byte		2		(ARCNET)
52*b6cee71dSXin LI>32	byte		3		(StarLAN)
53*b6cee71dSXin LI>32	byte		4		(PC Network broadband)
54*b6cee71dSXin LI>32	byte		5		(LocalTalk)
55*b6cee71dSXin LI>32	byte		6		(Znet)
56*b6cee71dSXin LI>32	byte		7		(Internetwork Analyzer)
57*b6cee71dSXin LI>32	byte		9		(FDDI)
58*b6cee71dSXin LI>32	byte		10		(ATM)
59*b6cee71dSXin LI
60*b6cee71dSXin LI#
61*b6cee71dSXin LI# Cinco Networks NetXRay capture files.
62*b6cee71dSXin LI# Sorry, make that "Network General Sniffer Basic capture files."
63*b6cee71dSXin LI# Sorry, make that "Network Associates Sniffer Basic capture files."
64*b6cee71dSXin LI# Sorry, make that "Network Associates Sniffer Basic, and Windows
65*b6cee71dSXin LI# Sniffer Pro", capture files."
66*b6cee71dSXin LI# Sorry, make that "Network General Sniffer capture files."
67*b6cee71dSXin LI# Sorry, make that "NetScout Sniffer capture files."
68*b6cee71dSXin LI#
69*b6cee71dSXin LI0	string		XCP\0		NetXRay capture file
70*b6cee71dSXin LI>4	string		>\0		- version %s
71*b6cee71dSXin LI>44	leshort		0		(Ethernet)
72*b6cee71dSXin LI>44	leshort		1		(Token Ring)
73*b6cee71dSXin LI>44	leshort		2		(FDDI)
74*b6cee71dSXin LI>44	leshort		3		(WAN)
75*b6cee71dSXin LI>44	leshort		8		(ATM)
76*b6cee71dSXin LI>44	leshort		9		(802.11)
77*b6cee71dSXin LI
78*b6cee71dSXin LI#
79*b6cee71dSXin LI# "libpcap" capture files.
80*b6cee71dSXin LI# (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
81*b6cee71dSXin LI# the main program that uses that format, but there are other programs
82*b6cee71dSXin LI# that use "libpcap", or that use the same capture file format.)
83*b6cee71dSXin LI#
84*b6cee71dSXin LI0	name		pcap-be
85*b6cee71dSXin LI>4	beshort		x		- version %d
86*b6cee71dSXin LI>6	beshort		x		\b.%d
87*b6cee71dSXin LI>20	belong		0		(No link-layer encapsulation
88*b6cee71dSXin LI>20	belong		1		(Ethernet
89*b6cee71dSXin LI>20	belong		2		(3Mb Ethernet
90*b6cee71dSXin LI>20	belong		3		(AX.25
91*b6cee71dSXin LI>20	belong		4		(ProNET
92*b6cee71dSXin LI>20	belong		5		(CHAOS
93*b6cee71dSXin LI>20	belong		6		(Token Ring
94*b6cee71dSXin LI>20	belong		7		(BSD ARCNET
95*b6cee71dSXin LI>20	belong		8		(SLIP
96*b6cee71dSXin LI>20	belong		9		(PPP
97*b6cee71dSXin LI>20	belong		10		(FDDI
98*b6cee71dSXin LI>20	belong		11		(RFC 1483 ATM
99*b6cee71dSXin LI>20	belong		12		(raw IP
100*b6cee71dSXin LI>20	belong		13		(BSD/OS SLIP
101*b6cee71dSXin LI>20	belong		14		(BSD/OS PPP
102*b6cee71dSXin LI>20	belong		19		(Linux ATM Classical IP
103*b6cee71dSXin LI>20	belong		50		(PPP or Cisco HDLC
104*b6cee71dSXin LI>20	belong		51		(PPP-over-Ethernet
105*b6cee71dSXin LI>20	belong		99		(Symantec Enterprise Firewall
106*b6cee71dSXin LI>20	belong		100		(RFC 1483 ATM
107*b6cee71dSXin LI>20	belong		101		(raw IP
108*b6cee71dSXin LI>20	belong		102		(BSD/OS SLIP
109*b6cee71dSXin LI>20	belong		103		(BSD/OS PPP
110*b6cee71dSXin LI>20	belong		104		(BSD/OS Cisco HDLC
111*b6cee71dSXin LI>20	belong		105		(802.11
112*b6cee71dSXin LI>20	belong		106		(Linux Classical IP over ATM
113*b6cee71dSXin LI>20	belong		107		(Frame Relay
114*b6cee71dSXin LI>20	belong		108		(OpenBSD loopback
115*b6cee71dSXin LI>20	belong		109		(OpenBSD IPsec encrypted
116*b6cee71dSXin LI>20	belong		112		(Cisco HDLC
117*b6cee71dSXin LI>20	belong		113		(Linux "cooked"
118*b6cee71dSXin LI>20	belong		114		(LocalTalk
119*b6cee71dSXin LI>20	belong		117		(OpenBSD PFLOG
120*b6cee71dSXin LI>20	belong		119		(802.11 with Prism header
121*b6cee71dSXin LI>20	belong		122		(RFC 2625 IP over Fibre Channel
122*b6cee71dSXin LI>20	belong		123		(SunATM
123*b6cee71dSXin LI>20	belong		127		(802.11 with radiotap header
124*b6cee71dSXin LI>20	belong		129		(Linux ARCNET
125*b6cee71dSXin LI>20	belong		138		(Apple IP over IEEE 1394
126*b6cee71dSXin LI>20	belong		139		(MTP2 with pseudo-header
127*b6cee71dSXin LI>20	belong		140		(MTP2
128*b6cee71dSXin LI>20	belong		141		(MTP3
129*b6cee71dSXin LI>20	belong		142		(SCCP
130*b6cee71dSXin LI>20	belong		143		(DOCSIS
131*b6cee71dSXin LI>20	belong		144		(IrDA
132*b6cee71dSXin LI>20	belong		147		(Private use 0
133*b6cee71dSXin LI>20	belong		148		(Private use 1
134*b6cee71dSXin LI>20	belong		149		(Private use 2
135*b6cee71dSXin LI>20	belong		150		(Private use 3
136*b6cee71dSXin LI>20	belong		151		(Private use 4
137*b6cee71dSXin LI>20	belong		152		(Private use 5
138*b6cee71dSXin LI>20	belong		153		(Private use 6
139*b6cee71dSXin LI>20	belong		154		(Private use 7
140*b6cee71dSXin LI>20	belong		155		(Private use 8
141*b6cee71dSXin LI>20	belong		156		(Private use 9
142*b6cee71dSXin LI>20	belong		157		(Private use 10
143*b6cee71dSXin LI>20	belong		158		(Private use 11
144*b6cee71dSXin LI>20	belong		159		(Private use 12
145*b6cee71dSXin LI>20	belong		160		(Private use 13
146*b6cee71dSXin LI>20	belong		161		(Private use 14
147*b6cee71dSXin LI>20	belong		162		(Private use 15
148*b6cee71dSXin LI>20	belong		163		(802.11 with AVS header
149*b6cee71dSXin LI>20	belong		165		(BACnet MS/TP
150*b6cee71dSXin LI>20	belong		166		(PPPD
151*b6cee71dSXin LI>20	belong		169		(GPRS LLC
152*b6cee71dSXin LI>20	belong		177		(Linux LAPD
153*b6cee71dSXin LI>20	belong		187		(Bluetooth HCI H4
154*b6cee71dSXin LI>20	belong		189		(Linux USB
155*b6cee71dSXin LI>20	belong		192		(PPI
156*b6cee71dSXin LI>20	belong		195		(802.15.4
157*b6cee71dSXin LI>20	belong		196		(SITA
158*b6cee71dSXin LI>20	belong		197		(Endace ERF
159*b6cee71dSXin LI>20	belong		201		(Bluetooth HCI H4 with pseudo-header
160*b6cee71dSXin LI>20	belong		202		(AX.25 with KISS header
161*b6cee71dSXin LI>20	belong		203		(LAPD
162*b6cee71dSXin LI>20	belong		204		(PPP with direction pseudo-header
163*b6cee71dSXin LI>20	belong		205		(Cisco HDLC with direction pseudo-header
164*b6cee71dSXin LI>20	belong		206		(Frame Relay with direction pseudo-header
165*b6cee71dSXin LI>20	belong		209		(Linux IPMB
166*b6cee71dSXin LI>20	belong		215		(802.15.4 with non-ASK PHY header
167*b6cee71dSXin LI>20	belong		220		(Memory-mapped Linux USB
168*b6cee71dSXin LI>20	belong		224		(Fibre Channel FC-2
169*b6cee71dSXin LI>20	belong		225		(Fibre Channel FC-2 with frame delimiters
170*b6cee71dSXin LI>20	belong		226		(Solaris IPNET
171*b6cee71dSXin LI>20	belong		227		(SocketCAN
172*b6cee71dSXin LI>20	belong		228		(Raw IPv4
173*b6cee71dSXin LI>20	belong		229		(Raw IPv6
174*b6cee71dSXin LI>20	belong		230		(802.15.4 without FCS
175*b6cee71dSXin LI>20	belong		231		(D-Bus messages
176*b6cee71dSXin LI>20	belong		235		(DVB-CI
177*b6cee71dSXin LI>20	belong		236		(MUX27010
178*b6cee71dSXin LI>20	belong		237		(STANAG 5066 D_PDUs
179*b6cee71dSXin LI>20	belong		239		(Linux netlink NFLOG messages
180*b6cee71dSXin LI>20	belong		240		(Hilscher netAnalyzer
181*b6cee71dSXin LI>20	belong		241		(Hilscher netAnalyzer with delimiters
182*b6cee71dSXin LI>20	belong		242		(IP-over-Infiniband
183*b6cee71dSXin LI>20	belong		243		(MPEG-2 Transport Stream packets
184*b6cee71dSXin LI>20	belong		244		(ng4t ng40
185*b6cee71dSXin LI>20	belong		245		(NFC LLCP
186*b6cee71dSXin LI>20	belong		247		(Infiniband
187*b6cee71dSXin LI>20	belong		248		(SCTP
188*b6cee71dSXin LI>16	belong		x		\b, capture length %d)
189*b6cee71dSXin LI
190*b6cee71dSXin LI0	ubelong		0xa1b2c3d4	tcpdump capture file (big-endian)
191*b6cee71dSXin LI!:mime	application/vnd.tcpdump.pcap
192*b6cee71dSXin LI>0	use	pcap-be
193*b6cee71dSXin LI0	ulelong		0xa1b2c3d4	tcpdump capture file (little-endian)
194*b6cee71dSXin LI!:mime	application/vnd.tcpdump.pcap
195*b6cee71dSXin LI>0	use	\^pcap-be
196*b6cee71dSXin LI
197*b6cee71dSXin LI#
198*b6cee71dSXin LI# "libpcap"-with-Alexey-Kuznetsov's-patches capture files.
199*b6cee71dSXin LI# (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
200*b6cee71dSXin LI# the main program that uses that format, but there are other programs
201*b6cee71dSXin LI# that use "libpcap", or that use the same capture file format.)
202*b6cee71dSXin LI#
203*b6cee71dSXin LI0	ubelong		0xa1b2cd34	extended tcpdump capture file (big-endian)
204*b6cee71dSXin LI>0	use	pcap-be
205*b6cee71dSXin LI0	ulelong		0xa1b2cd34	extended tcpdump capture file (little-endian)
206*b6cee71dSXin LI>0	use	\^pcap-be
207*b6cee71dSXin LI
208*b6cee71dSXin LI#
209*b6cee71dSXin LI# "pcap-ng" capture files.
210*b6cee71dSXin LI# http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html
211*b6cee71dSXin LI# Pcap-ng files can contain multiple sections. Printing the endianness,
212*b6cee71dSXin LI# snaplen, or other information from the first SHB may be misleading.
213*b6cee71dSXin LI#
214*b6cee71dSXin LI0	ubelong		0x0a0d0d0a
215*b6cee71dSXin LI>8	ubelong		0x1a2b3c4d	pcap-ng capture file
216*b6cee71dSXin LI>>12	beshort		x		- version %d
217*b6cee71dSXin LI>>14	beshort		x		\b.%d
218*b6cee71dSXin LI0	ulelong		0x0a0d0d0a
219*b6cee71dSXin LI>8	ulelong		0x1a2b3c4d	pcap-ng capture file
220*b6cee71dSXin LI>>12	leshort		x		- version %d
221*b6cee71dSXin LI>>14	leshort		x		\b.%d
222*b6cee71dSXin LI
223*b6cee71dSXin LI#
224*b6cee71dSXin LI# AIX "iptrace" capture files.
225*b6cee71dSXin LI#
226*b6cee71dSXin LI0	string		iptrace\ 1.0	"iptrace" capture file
227*b6cee71dSXin LI0	string		iptrace\ 2.0	"iptrace" capture file
228*b6cee71dSXin LI
229*b6cee71dSXin LI#
230*b6cee71dSXin LI# Novell LANalyzer capture files.
231*b6cee71dSXin LI#
232*b6cee71dSXin LI0	leshort		0x1001		LANalyzer capture file
233*b6cee71dSXin LI0	leshort		0x1007		LANalyzer capture file
234*b6cee71dSXin LI
235*b6cee71dSXin LI#
236*b6cee71dSXin LI# HP-UX "nettl" capture files.
237*b6cee71dSXin LI#
238*b6cee71dSXin LI0	string		\x54\x52\x00\x64\x00	"nettl" capture file
239*b6cee71dSXin LI
240*b6cee71dSXin LI#
241*b6cee71dSXin LI# RADCOM WAN/LAN Analyzer capture files.
242*b6cee71dSXin LI#
243*b6cee71dSXin LI0	string		\x42\xd2\x00\x34\x12\x66\x22\x88	RADCOM WAN/LAN Analyzer capture file
244*b6cee71dSXin LI
245*b6cee71dSXin LI#
246*b6cee71dSXin LI# NetStumbler log files.  Not really packets, per se, but about as
247*b6cee71dSXin LI# close as you can get.  These are log files from NetStumbler, a
248*b6cee71dSXin LI# Windows program, that scans for 802.11b networks.
249*b6cee71dSXin LI#
250*b6cee71dSXin LI0	string		NetS		NetStumbler log file
251*b6cee71dSXin LI>8	lelong		x		\b, %d stations found
252*b6cee71dSXin LI
253*b6cee71dSXin LI#
254*b6cee71dSXin LI# *Peek tagged capture files.
255*b6cee71dSXin LI#
256*b6cee71dSXin LI0	string		\177ver		EtherPeek/AiroPeek/OmniPeek capture file
257*b6cee71dSXin LI
258*b6cee71dSXin LI#
259*b6cee71dSXin LI# Visual Networks traffic capture files.
260*b6cee71dSXin LI#
261*b6cee71dSXin LI0	string		\x05VNF		Visual Networks traffic capture file
262*b6cee71dSXin LI
263*b6cee71dSXin LI#
264*b6cee71dSXin LI# Network Instruments Observer capture files.
265*b6cee71dSXin LI#
266*b6cee71dSXin LI0	string		ObserverPktBuffe	Network Instruments Observer capture file
267*b6cee71dSXin LI
268*b6cee71dSXin LI#
269*b6cee71dSXin LI# Files from Accellent Group's 5View products.
270*b6cee71dSXin LI#
271*b6cee71dSXin LI0	string		\xaa\xaa\xaa\xaa	5View capture file
272