pcapfix

pcapfix tries to repair your broken pcap and pcapng files.

To fix your pcap files the tool first checks for an intact pcap global header and repairs it if there are some corrupted bytes. It there seems to be no global header at all, pcapfix adds a self-created one at the beginning of the file. In a second step the tool tries to find pcap packet headers inside the file, below the global header. It checks if the values are correct (or seem to be correct) and tries to repair a packet if there is something wrong.

To fix your pcapng files the tool loops through all packet headers that can be found in the file. It checks for mandatory Section Header and Interface Description Block and creates them if missing. Pcapfix checks for correct block sizes and valid option fields. If something is wrong, invalid fields are repaired (if possible) or skipped and adjusted to finally get a proper pcapng file.

Why?

Sometimes your captured pcap files get cut off or are being corrupted in other ways. Also some capture the flag challenges deal with damaged pcap files periodically. Therefore this tool has been written!

Algorithm

pcapfix will first step through the packets respectively blocks top down until it recognizes corrupted data by checking field validity and using plausibility checks. After that the tool will brute force further pcap packet headers respectively block headers by reading the file byte by byte. If another proper packet or block is found, pcapfix restores the data in between by adding a well-formed pcap packet header or skips it if unusable.

Online Version

If you have any problems in compiling pcapfix or are not able to use it on your platform, tell me about this to improve pcapfix. As long as your problems remain you can use the online version of pcapfix too.

It is available HERE.

What it looks like...

Reparation of pcapng file with broken name resolution block


Verbose reparation of pcap file including two corrupted packets


text output

What you can do to help

You can help out by telling me your futher wishes and features you would like pcapfix to have got. Furthermore you can send me bug reports and error messages or any broken pcap files if pcapfix is not able to repair them correctly. Last but not least, if there are any other file formats you would to have repaired and there is no tool available yet, then tell me about your idea!

Licence

Pcapfix is licensed under the GNU General Public License (GPL).

FAQ

I get missing DLL error of file 'cygwin1.dll'.

In this case please try to download following FILE and put it into pcapfix extraction path.

Download

pcapfix-1.1.7.tar.gz (signature)    pcapfix-1.1.7-win32.zip (precompiled windows binary)    Changelog

pcapfix-1.1.6.tar.gz (signature)    pcapfix-1.1.6-win32.zip (precompiled windows binary)    Changelog

pcapfix-1.1.5.tar.gz (signature)    pcapfix-1.1.5-win32.zip (precompiled windows binary)    Changelog

pcapfix-1.1.4.tar.gz (signature)    pcapfix-1.1.4-win32.zip (precompiled windows binary)    Changelog

pcapfix-1.1.3.tar.gz (signature)    pcapfix-1.1.3-win32.zip (precompiled windows binary)    Changelog

pcapfix-1.1.2.tar.gz (signature)    pcapfix-1.1.2-win32.zip (precompiled windows binary)    Changelog

pcapfix-1.1.1.tar.gz (signature)    pcapfix-1.1.1-win32.zip (precompiled windows binary)    Changelog

pcapfix-1.1.0.tar.gz (signature)    pcapfix-1.1.0-win32.zip (precompiled windows binary)    Changelog

pcapfix-1.0.2.tar.gz (signature)    pcapfix-1.0.2-win32.zip (precompiled windows binary)    Changelog

pcapfix-1.0.1.tar.gz    pcapfix-1.0.1-win32.zip (precompiled windows binary)    Changelog

pcapfix-1.0.0.tar.gz    pcapfix-1.0.0-win32.zip (precompiled windows binary)    Changelog

pcapfix-0.7.3.tar.gz    pcapfix-0.7.3-win32.zip (precompiled windows binary)    Changelog

pcapfix-0.7.2.tar.gz    pcapfix-0.7.2-win32.zip (precompiled windows binary)    Changelog

pcapfix-0.7.1.tar.gz    pcapfix-0.7.1-win32.zip (precompiled windows binary)    Changelog

pcapfix-0.7.tar.gz    pcapfix-0.7-win32.zip (precompiled windows binary)    Changelog

pcapfix-0.6.tar.gz    pcapfix-0.6-win32.zip (precompiled windows binary)    Changelog

pcapfix-0.5.tar.gz    pcapfix-0.5-win32.zip (precompiled windows binary)    Changelog

pcapfix-0.4.tar.gz    pcapfix-0.4-win32.zip (precompiled windows binary)    Changelog

pcapfix-0.3.tar.gz    Changelog

pcapfix-0.2.tar.gz    Changelog

pcapfix-0.1.tar.gz

The latest development version is available at GitHub.