Rup0rt / pcapfix

repair corrupted pcap files
http://f00l.de/pcapfix/
GNU General Public License v3.0
202 stars 34 forks source link

[IDEA] Standard I/O and pipe support? #32

Open AshkanArabim opened 1 year ago

AshkanArabim commented 1 year ago

I'm working on a project that involves transmitting tcpdump data from an android phone over ADB. pcapfix has been a life-saver, but it could be much more versatile if it could fix a stream of packets on the fly using stdin and stdout. This way I could use it as part of a pipeline directly into Wireshark.

andrew-morris commented 1 year ago

just chiming in that I'd really love this, trying to figure out how to hand jam this:

$ kcat -b 127.0.0.1:29092 -t lmao | ~/Downloads/pcapfix-1.1.7/pcapfix -v /dev/stdin
pcapfix 1.1.7 (c) 2012-2021 Robert Krause

[*] Reading from file: /dev/stdin
[*] Writing to file: fixed_stdin
[*] File size: -1 bytes.
% Auto-selecting Consumer mode (use -P or -C to override)
[+] This is a PCAP file.
[-] File is too small to read pcap global header.
[-] FAILED: Unable to recover pcap file.

You may help to improve pcapfix by sending your pcap file to ruport@f00l.de

% ERROR: Write error for message of 721 bytes in lmao [0] at offset 411: Broken pipe