tcpflow is a program that captures data transmitted as part of TCP connections (flows), and stores the data in a way that is convenient for protocol analysis and debugging. Each TCP flow is stored in its own file. Thus, the typical TCP flow will be stored in two files, one for each direction. tcpflow can also process stored ‘tcpdump’ packet flows.
tcpflow is similar to ‘tcpdump’, in that both process packets from the wire or from a stored file. But it’s different in that it reconstructs the actual data streams and stores each flow in a separate file for later analysis.
tcpflow understands sequence numbers and will correctly reconstruct data streams regardless of retransmissions or out-of-order delivery. Version 1.0 adds support for VLAN demultiplexing. However, tcpflow currently does not understand IP fragments; flows containing IP fragments will not be recorded properly.
tcpflow is based on the LBL Packet Capture Library (available from LBL) and therefore supports the same rich filtering expressions that programs like ‘tcpdump’ support. It should compile under most popular versions of UNIX; see the INSTALL file for details.
tcpflow stores all captured data in files that have names of the form:
where the contents of the above file would be data transmitted from host 18.104.22.168 port 2345, to host 10.11.12.13 port 45103. VLAN information, if provided is stored in brackets.
Simson Garfinkel uses tcpflow to analyze IP packets that were captured by packet sniffers or that were left in memory of computer systems under analysis. Jeremy Elson originally wrote this program to capture the data being sent by various programs that use undocumented network protocols in an attempt to reverse engineer those protocols. RealPlayer (and most other streaming media players), ICQ, and AOL IM are good examples of this type of application. It was later used for HTTP protocol analysis.
Please enter bug reports into the github issues tracker. tcpflow currently does not understand IP fragments. Flows containing IP fragments will not be recorded correctly.
Please see the downloads section to download tcpflow releases.