Skip to content

Instantly share code, notes, and snippets.

@vdm
Created December 10, 2024 17:49
Show Gist options
  • Save vdm/9e7676ca6651f300adfce11dfbe80e80 to your computer and use it in GitHub Desktop.
Save vdm/9e7676ca6651f300adfce11dfbe80e80 to your computer and use it in GitHub Desktop.
tcpdump -x single column
# $ tshark -e udp.payload
# $ tcpdump -x | awk -f tcpdump-x.awk
END {
if (header != "") { print header " " hex }
}
/^[^\t]/ {
if (header != "") { print header " " hex }
header = $0
hex = ""
next
}
/^\t0x/ {
if (NF > 9) NF = 9
for (i=2; i<=NF; i++) {
hex = hex $i
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment