tcpflow: A TCP flow recorder1

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 or debugging. tcpflow understands TCP sequence
numbers and will correctly reconstruct data streams regardless of
retransmissions or out-of-order delivery. Each stream is stored
in a separate file for later analysis. tcpflow is designed to be
portable, using the LBL packet capture library and GNU autoconf. It
works under most UNIX platforms and for most common network interface
types (ethernet, PPP, loopback, etc.).