Wireshark does a good job of extracting bittorrent PIECE messages sent to specific peers from other peers using a filter like the following e.g.:
bittorrent.piece.data and ip.dst_host == 192.168.3.14 and ip.src_host == 192.168.3.15
I want automate the generation of a dump of this piece data for post/inline processing with a Python application e.g. graphing piece throughput against time with matplotlib.
Can someone tell me the tshark command-line arguments to achieve this assuming:
- Input pcap file is input.pcap
- Desired output is output.txt containing packet summary info followed by actual packet bytes as hex-array
As mentioned, I am planning to import output.txt into my Python analysis application, but also need the raw piece data to reassemble the pieces in Python for integrity checking. In my case the pieces are parts of a video. I can do the reassembly within Python no problem.
All I need is time offset, piece index, and the raw piece data which I have verified can be exported from within the Wireshark > Export dialog by selecting the Packet Summary and Packet Bytes options with the above filter in effect. I want to avoid having to do this export manually though for the many captures I have to make over the coming weeks and months.
Thanks in advance.