1 2#------------------------------------------------------------------------------ 3# $File: sniffer,v 1.14 2009/09/19 16:28:12 christos Exp $ 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 21# 22# Microsoft Network Monitor 2.x capture files. 23# 240 string GMBU NetMon capture file 25>5 byte x - version %d 26>4 byte x \b.%d 27>6 leshort 0 (Unknown) 28>6 leshort 1 (Ethernet) 29>6 leshort 2 (Token Ring) 30>6 leshort 3 (FDDI) 31>6 leshort 4 (ATM) 32 33# 34# Network General Sniffer capture files. 35# Sorry, make that "Network Associates Sniffer capture files." 36# Sorry, make that "Network General old DOS Sniffer capture files." 37# 380 string TRSNIFF\ data\ \ \ \ \032 Sniffer capture file 39>33 byte 2 (compressed) 40>23 leshort x - version %d 41>25 leshort x \b.%d 42>32 byte 0 (Token Ring) 43>32 byte 1 (Ethernet) 44>32 byte 2 (ARCNET) 45>32 byte 3 (StarLAN) 46>32 byte 4 (PC Network broadband) 47>32 byte 5 (LocalTalk) 48>32 byte 6 (Znet) 49>32 byte 7 (Internetwork Analyzer) 50>32 byte 9 (FDDI) 51>32 byte 10 (ATM) 52 53# 54# Cinco Networks NetXRay capture files. 55# Sorry, make that "Network General Sniffer Basic capture files." 56# Sorry, make that "Network Associates Sniffer Basic capture files." 57# Sorry, make that "Network Associates Sniffer Basic, and Windows 58# Sniffer Pro", capture files." 59# Sorry, make that "Network General Sniffer capture files." 60# 610 string XCP\0 NetXRay capture file 62>4 string >\0 - version %s 63>44 leshort 0 (Ethernet) 64>44 leshort 1 (Token Ring) 65>44 leshort 2 (FDDI) 66>44 leshort 3 (WAN) 67>44 leshort 8 (ATM) 68>44 leshort 9 (802.11) 69 70# 71# "libpcap" capture files. 72# (We call them "tcpdump capture file(s)" for now, as "tcpdump" is 73# the main program that uses that format, but there are other programs 74# that use "libpcap", or that use the same capture file format.) 75# 760 ubelong 0xa1b2c3d4 tcpdump capture file (big-endian) 77>4 beshort x - version %d 78>6 beshort x \b.%d 79>20 belong 0 (No link-layer encapsulation 80>20 belong 1 (Ethernet 81>20 belong 2 (3Mb Ethernet 82>20 belong 3 (AX.25 83>20 belong 4 (ProNET 84>20 belong 5 (CHAOS 85>20 belong 6 (Token Ring 86>20 belong 7 (BSD ARCNET 87>20 belong 8 (SLIP 88>20 belong 9 (PPP 89>20 belong 10 (FDDI 90>20 belong 11 (RFC 1483 ATM 91>20 belong 12 (raw IP 92>20 belong 13 (BSD/OS SLIP 93>20 belong 14 (BSD/OS PPP 94>20 belong 19 (Linux ATM Classical IP 95>20 belong 50 (PPP or Cisco HDLC 96>20 belong 51 (PPP-over-Ethernet 97>20 belong 99 (Symantec Enterprise Firewall 98>20 belong 100 (RFC 1483 ATM 99>20 belong 101 (raw IP 100>20 belong 102 (BSD/OS SLIP 101>20 belong 103 (BSD/OS PPP 102>20 belong 104 (BSD/OS Cisco HDLC 103>20 belong 105 (802.11 104>20 belong 106 (Linux Classical IP over ATM 105>20 belong 107 (Frame Relay 106>20 belong 108 (OpenBSD loopback 107>20 belong 109 (OpenBSD IPsec encrypted 108>20 belong 112 (Cisco HDLC 109>20 belong 113 (Linux "cooked" 110>20 belong 114 (LocalTalk 111>20 belong 117 (OpenBSD PFLOG 112>20 belong 119 (802.11 with Prism header 113>20 belong 122 (RFC 2625 IP over Fibre Channel 114>20 belong 123 (SunATM 115>20 belong 127 (802.11 with radiotap header 116>20 belong 129 (Linux ARCNET 117>20 belong 138 (Apple IP over IEEE 1394 118>20 belong 140 (MTP2 119>20 belong 141 (MTP3 120>20 belong 143 (DOCSIS 121>20 belong 144 (IrDA 122>20 belong 147 (Private use 0 123>20 belong 148 (Private use 1 124>20 belong 149 (Private use 2 125>20 belong 150 (Private use 3 126>20 belong 151 (Private use 4 127>20 belong 152 (Private use 5 128>20 belong 153 (Private use 6 129>20 belong 154 (Private use 7 130>20 belong 155 (Private use 8 131>20 belong 156 (Private use 9 132>20 belong 157 (Private use 10 133>20 belong 158 (Private use 11 134>20 belong 159 (Private use 12 135>20 belong 160 (Private use 13 136>20 belong 161 (Private use 14 137>20 belong 162 (Private use 15 138>20 belong 163 (802.11 with AVS header 139>16 belong x \b, capture length %d) 1400 ulelong 0xa1b2c3d4 tcpdump capture file (little-endian) 141>4 leshort x - version %d 142>6 leshort x \b.%d 143>20 lelong 0 (No link-layer encapsulation 144>20 lelong 1 (Ethernet 145>20 lelong 2 (3Mb Ethernet 146>20 lelong 3 (AX.25 147>20 lelong 4 (ProNET 148>20 lelong 5 (CHAOS 149>20 lelong 6 (Token Ring 150>20 lelong 7 (ARCNET 151>20 lelong 8 (SLIP 152>20 lelong 9 (PPP 153>20 lelong 10 (FDDI 154>20 lelong 11 (RFC 1483 ATM 155>20 lelong 12 (raw IP 156>20 lelong 13 (BSD/OS SLIP 157>20 lelong 14 (BSD/OS PPP 158>20 lelong 19 (Linux ATM Classical IP 159>20 lelong 50 (PPP or Cisco HDLC 160>20 lelong 51 (PPP-over-Ethernet 161>20 lelong 99 (Symantec Enterprise Firewall 162>20 lelong 100 (RFC 1483 ATM 163>20 lelong 101 (raw IP 164>20 lelong 102 (BSD/OS SLIP 165>20 lelong 103 (BSD/OS PPP 166>20 lelong 104 (BSD/OS Cisco HDLC 167>20 lelong 105 (802.11 168>20 lelong 106 (Linux Classical IP over ATM 169>20 lelong 107 (Frame Relay 170>20 lelong 108 (OpenBSD loopback 171>20 lelong 109 (OpenBSD IPsec encrypted 172>20 lelong 112 (Cisco HDLC 173>20 lelong 113 (Linux "cooked" 174>20 lelong 114 (LocalTalk 175>20 lelong 117 (OpenBSD PFLOG 176>20 lelong 119 (802.11 with Prism header 177>20 lelong 122 (RFC 2625 IP over Fibre Channel 178>20 lelong 123 (SunATM 179>20 lelong 127 (802.11 with radiotap header 180>20 lelong 129 (Linux ARCNET 181>20 lelong 138 (Apple IP over IEEE 1394 182>20 lelong 140 (MTP2 183>20 lelong 141 (MTP3 184>20 lelong 143 (DOCSIS 185>20 lelong 144 (IrDA 186>20 lelong 147 (Private use 0 187>20 lelong 148 (Private use 1 188>20 lelong 149 (Private use 2 189>20 lelong 150 (Private use 3 190>20 lelong 151 (Private use 4 191>20 lelong 152 (Private use 5 192>20 lelong 153 (Private use 6 193>20 lelong 154 (Private use 7 194>20 lelong 155 (Private use 8 195>20 lelong 156 (Private use 9 196>20 lelong 157 (Private use 10 197>20 lelong 158 (Private use 11 198>20 lelong 159 (Private use 12 199>20 lelong 160 (Private use 13 200>20 lelong 161 (Private use 14 201>20 lelong 162 (Private use 15 202>20 lelong 163 (802.11 with AVS header 203>16 lelong x \b, capture length %d) 204 205# 206# "libpcap"-with-Alexey-Kuznetsov's-patches capture files. 207# (We call them "tcpdump capture file(s)" for now, as "tcpdump" is 208# the main program that uses that format, but there are other programs 209# that use "libpcap", or that use the same capture file format.) 210# 2110 ubelong 0xa1b2cd34 extended tcpdump capture file (big-endian) 212>4 beshort x - version %d 213>6 beshort x \b.%d 214>20 belong 0 (No link-layer encapsulation 215>20 belong 1 (Ethernet 216>20 belong 2 (3Mb Ethernet 217>20 belong 3 (AX.25 218>20 belong 4 (ProNET 219>20 belong 5 (CHAOS 220>20 belong 6 (Token Ring 221>20 belong 7 (ARCNET 222>20 belong 8 (SLIP 223>20 belong 9 (PPP 224>20 belong 10 (FDDI 225>20 belong 11 (RFC 1483 ATM 226>20 belong 12 (raw IP 227>20 belong 13 (BSD/OS SLIP 228>20 belong 14 (BSD/OS PPP 229>16 belong x \b, capture length %d) 2300 ulelong 0xa1b2cd34 extended tcpdump capture file (little-endian) 231>4 leshort x - version %d 232>6 leshort x \b.%d 233>20 lelong 0 (No link-layer encapsulation 234>20 lelong 1 (Ethernet 235>20 lelong 2 (3Mb Ethernet 236>20 lelong 3 (AX.25 237>20 lelong 4 (ProNET 238>20 lelong 5 (CHAOS 239>20 lelong 6 (Token Ring 240>20 lelong 7 (ARCNET 241>20 lelong 8 (SLIP 242>20 lelong 9 (PPP 243>20 lelong 10 (FDDI 244>20 lelong 11 (RFC 1483 ATM 245>20 lelong 12 (raw IP 246>20 lelong 13 (BSD/OS SLIP 247>20 lelong 14 (BSD/OS PPP 248>16 lelong x \b, capture length %d) 249 250# 251# AIX "iptrace" capture files. 252# 2530 string iptrace\ 1.0 "iptrace" capture file 2540 string iptrace\ 2.0 "iptrace" capture file 255 256# 257# Novell LANalyzer capture files. 258# 2590 leshort 0x1001 LANalyzer capture file 2600 leshort 0x1007 LANalyzer capture file 261 262# 263# HP-UX "nettl" capture files. 264# 2650 string \x54\x52\x00\x64\x00 "nettl" capture file 266 267# 268# RADCOM WAN/LAN Analyzer capture files. 269# 2700 string \x42\xd2\x00\x34\x12\x66\x22\x88 RADCOM WAN/LAN Analyzer capture file 271 272# 273# NetStumbler log files. Not really packets, per se, but about as 274# close as you can get. These are log files from NetStumbler, a 275# Windows program, that scans for 802.11b networks. 276# 2770 string NetS NetStumbler log file 278>8 lelong x \b, %d stations found 279 280# 281# EtherPeek/AiroPeek "version 9" capture files. 282# 2830 string \177ver EtherPeek/AiroPeek capture file 284 285# 286# Visual Networks traffic capture files. 287# 2880 string \x05VNF Visual Networks traffic capture file 289 290# 291# Network Instruments Observer capture files. 292# 2930 string ObserverPktBuffe Network Instruments Observer capture file 294 295# 296# Files from Accellent Group's 5View products. 297# 2980 string \xaa\xaa\xaa\xaa 5View capture file 299