A lightweight C++ tool that takes a capture file (e.g., PCAP or PCAPNG) as input and splits it into several PCAP files, one for each flow.
$ pcap_flow_splitter -P capture.pcap
$ pcap_flow_splitter -P capture.pcap -O output/ -T 120
$ pcap_flow_splitter --help
Allowed options:
--help produce help message
-P [ --pcap ] arg analyze packets from pcap file(s)
-O [ --output-dir ] arg output directory for pcap files
-T [ --timeout ] arg timeout for inactive flows (in seconds)
Building from source was tested on:
- Debian 11 x86_64 (5.10 kernel)
- GCC 10.2
- CMake 3.18.4
To build from source the following libraries must be available to CMake:
The following dependencies are bundled into the project as git submodules:
-
Initialize submodules:
git submodule update --init --recursive
-
Run CMake:
cmake -DCMAKE_BUILD_TYPE=Debug -S . -B cmake-build-debug
-
Build:
cmake --build cmake-build-debug --target pcap_flow_splitter -j 4
- Terminate flows on TCP connection close (FIN/ACK)
Download and start CICFlowMeter (requires Java):
git clone https://github.com/ahlashkari/CICFlowMeter.git
cd CICFlowMeter/
./gradlew execute
Select the folder with split PCAP files as Pcap dir and an arbitrary folder for output:
Click OK, which will generate a csv file for each PCAP file.