aboutsummaryrefslogtreecommitdiff
path: root/executables/extract-pcap.sh
blob: 6f3a5d3f023d11babb501262a1dc6669c62bacfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
# Usage: ./extract_udp_hex.sh input.pcap output.txt

if [ "$#" -ne 2 ]; then
    echo "Usage: $0 <input.pcap> <output.txt>"
    exit 1
fi

INPUT="$1"
OUTPUT="$2"

# Extract UDP payloads as hex, one per line
tshark -r "$INPUT" -Y "udp" -T fields -e data > "$OUTPUT"

echo "UDP hex streams written to $OUTPUT"