Skip to content

Instantly share code, notes, and snippets.

@scratchadams
Created September 26, 2022 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scratchadams/a5ac0b9102966d433fb7804578ae263f to your computer and use it in GitHub Desktop.
Save scratchadams/a5ac0b9102966d433fb7804578ae263f to your computer and use it in GitHub Desktop.
xx example for icmp pcap
╟ PCAP File Header ╢
╒═════════════════════════════════════════════════════╕
│ │
│ ┌ ┐ ════════════════════════════ │
d4c3 b2a1 │ Magic Number
│ │ ╌╌╌╌ ╌╌╌╌ │ ════════════════════════════ │
0200 0400 │ Major Version/Minor Version
│ │ ╌╌╌╌ ╌╌╌╌ │ ════════════════════════════ │
0000 0000 │ Reserved
│ │ ╌╌╌╌ ╌╌╌╌ │ ════════════════════════════ │
0000 0000 │ Reserved
│ │ ╌╌╌╌ ╌╌╌╌ │ ════════════════════════════ │
0000 0400 │ SnapLen
│ │ ╌╌╌╌ ╌╌╌╌ │ ════════════════════════════ │
0100 0000 │ FCS |f| LinkType
│ │ ╌╌╌╌ ╌╌╌╌ │ ════════════════════════════ │
│ └ ┘ │
╘═════════════════════════════════════════════════════╛
╟ Packet Record ╢
╒═════════════════════════════════════════════════════╕
│ │
│ ┌ ┐ ════════════════════════════ │
47e2 3163 │ Timestamp (Seconds)
│ │ ╌╌╌╌ ╌╌╌╌ │ ════════════════════════════ │
f63e 0900 │ Timestamp (ms or ns)
│ │ ╌╌╌╌ ╌╌╌╌ │ ════════════════════════════ │
3a00 0000 │ Captured Packet Length
│ │ ╌╌╌╌ ╌╌╌╌ │ ════════════════════════════ │
3a00 0000 │ Original Packet Length
│ │ ╌╌╌╌ ╌╌╌╌ │ ════════════════════════════ │
│ └ ┘ │
╘═════════════════════════════════════════════════════╛
╟ Ethernet Header ╢
╒════════════════════════════════════════════════════════════╕
│ │
│ ┌ ┐ ════════════════════════════ │
00 00 5e 00 53 7f │ Destination MAC
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
00 00 5e 00 cf 47 │ Source MAC
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
0800 │ Type
│ | ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
│ └ ┘ │
╘════════════════════════════════════════════════════════════╛
╟ IPv4 Header ╢
╒════════════════════════════════════════════════════════════╕
│ │
│ ┌ ┐ ════════════════════════════ │
45 │ Version/Header Length
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
00 │ DSCP
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
00 2c │ Total Length
│ | ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
01 d2 │ Identification
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
40 00 │ Flags/Fragment Offset
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
40 │ TTL
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
01 │ Protocol
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
1e 12 │ Checksum
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
0a 00 00 b6 │ Source Address
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
08 08 08 08 │ Destination Address
│ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
│ └ ┘ │
╘════════════════════════════════════════════════════════════╛
╟ ICMP Header ╢
╒════════════════════════════════════════════════════════════╕
│ │
│ ┌ ┐ ════════════════════════════ │
08 │ Type
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
00 │ Code
│ │ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
db 9c │ Checksum
│ | ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
00 0b │ Identifier
│ | ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
00 01 │ Sequence Number
│ | ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
47e2 3163 0000 0000 │ Timestamp
│ | ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
4141 4141 4141 4141 │ Data
│ | ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ │ ════════════════════════════ │
│ └ ┘ │
╘════════════════════════════════════════════════════════════╛
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment