Convert Diameter msg hex string to Wireshark pcap

A “raw” hex string can be converted into Wireshark pcap:

query="<hex string here>"

export FILE="$HOME/Downloads/capture"

echo -n "${query}" > "${FILE}.bin.txt"

xxd -r -p "${FILE}.bin.txt" | od -Ax -tx1 > "${FILE}.hex.txt"

/Users/jhartman/Tools/Utilities/Wireshark.app/Contents/MacOS/text2pcap -o none -E wireshark-upper-pdu -P diameter -F pcap "${FILE}.hex.txt" "${FILE}.pcap"

open "${FILE}.pcap"

This can be nicely automatised as an Alfred Workflow:

Then invoke:

…and enjoy decoded packet in Wireshark:

Download: Hex stream to pcap

Convert Diameter msg hex string to Wireshark pcap
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *