Magic Numbers

ADVANCED TOPICS
ANALYZE PCAP
OBTAIN PCAP
GET STARTED
Pcap/ng

The first 4-16 bytes of a capture
3 min |  Ross Jacobs |  August 8, 2019

Table of Contents


The magic number is the first 4 or more bytes in a file that allow an operating system to identify it. On *nix systems, magic numbers are preferred whereas on Windows, the file extension is used instead. On *nix systems, this can lead to the curiosity of having a file with data of one type but an extension of another. For packet captures, it is easy to fix this.

This is a work in progress. Only about half of capture file formats that I’ve collected data on are shown.

Magic Numbers Table

The magic numbers in the hex shown here is in network order (i.e. big-endian). Big-endian is the default for xxd, which is used extensively here to gather values. If there are little-endian values here, please file a bug. This table aims to contain the magic numbers for formats that hold packets.

In the tables below, name and description come from tshark -F and capinfos in the format “name - description”.

The values shown here are best effort, and are based upon available information. If you see a problem with these file encodings, please file an issue, along with relevant files.

Available via -F flag

namedescriptionhexstringextensionLinks
5viewsInfoVista 5View captureaa aa aa aaªªªª5vw
btsnoopSymbian OS btsnoop62 74 73 6e 6f 6f 70 00btsnoop.log
commviewTamoSoft CommView--ncf
dct2000Catapult DCT2000 trace53 65 73 73 69 6f 6e 20
54 72 61 6e 73 63 72 69
70 74
Session
Transcri
pt
out
eyesdnEyeSDN USB S0/E1 ISDN45 79 65 53 44 4eEyeSDNtrc
lanalyzerNovell LANalyzer01 10 4c 00 01 05 54 72
61 63 65 20 44 69 73 70
6c 61 79 20 54 72 61 63
65 20 46 69 6c 65
..L...Tr
ace Disp
lay Trac
e File
tr1WS
modpcapModified tcpdump - pcap34 cd b2 a14...pcap
netmon1Microsoft NetMon 1.x52 54 53 53RTSS
netmon2Microsoft NetMon 2.x47 4d 42 55GMBU
nettlHP-UX nettl trace00 00 00 01 00 00 00 00
00 07 D0 00
........
....
trc0;trc1WS
ngsnifferSniffer (DOS)54 52 53 4e 49 46 46 20
64 61 74 61 20 20 20 20
TRSNIFF
data
cap;enc;trc;fdc;syc
niobserverNetwork Instruments Observer4f 62 73 65 72 76 65 72
50 6b 74 42 75 66 66 65
72 56 65 72 73 69 6f 6e
Observer
PktBuffe
rVersion
bfrWS
pcapWireshark/tcpdump/… - pcapd4 c3 b2 a1Ôò¡pcap;cap;dmp
pcapngWireshark/… - pcapng0a 0d 0d 0a\n\r\r\npcapng;ntar
rf5Tektronix K12xx 32-bit00 00 02 00 12 05 00 10........rf5
snoopSun snoop (RFC 1761)73 6e 6f 6f 70 00 00 00snoop...snoop
suse6_3pcapSuSE 6.3 tcpdump - pcap34 cd b2 a14...pcapEX
visualVisual Networks traffic capture05 56 4e 46.VNFeth;pcap;pkt;vn;vntcWS EX

Not identified by -F flag

namedescriptionhexstringextensionLinks
aethraAethra .aps file56 30 32 30 38V0208aps
capsaColasoft Capsa63 70 73 65cpsecscpkt
Savvius *Peek7f 76 65 72.verpkt;tpc;apc;wpzWS
mplogMicropross mplog4d 50 43 53 49 49MPCSIImplogWS EX
Etherwatch45 54 48 45 52 57 41 54
43 48 20
ETHERWAT
CH
netscreen28 6f 29 20 6c 65 6e 3d(o) len= 1
radcom42 D2 00 34 12 66 22 88B..4.f".

WS: Wireshark code, when available

EX: File of this type, when available

  1. Can also be 2869 2920 6c65 6e3d / (i) len=

A vast majority of this info comes directly from Wireshark’s wiretap folder, and specifically, file_access.c.

Further Reading