FlowCarp logo

FlowCarp

FlowCarp identifies application-layer protocols in network traffic based on behavior instead of port numbers. FlowCarp reads packet data in the form of PCAP, PcapNG or TZSP streams and outputs information about the flows it finds, including the detected application layer protocol for each flow.

FlowCarp Downloads

Latest version: 0.8.4

Linux ARM Linux ARM64 Linux musl ARM64 Linux musl x64 (Docker) Linux x64 macOS-ARM64 macOS-x64 Windows x64

Protocol Identification

The protocol identification feature in FlowCarp is similar to what some vendors refer to as "App-ID" or "application identification" or "NBAR", which are methods that use deep packet inspection (DPI) to determine the traffic category for each flow. FlowCarp also inspects the application-layer data, but without protocol parsers or signature rules. Instead, it computes a few statistical measurements of the data and compares those measurements to known protocols. This special technique allows FlowCarp to identify proprietary and undocumented protocols, since it doesn't require any protocol specification.

Input: Network Packets

FlowCarp takes packet data as input. The following packet input methods and formats are currently supported:

The input packets can be previously captured packets in a PCAP file on disk, but it is also possible to let FlowCarp analyze real-time traffic on the fly.

Read PCAP from disk:

flowcarp --input dump.pcap --output -

Real-time view of local live capture:

tcpdump -U -w - | flowcarp --input - --realtime --preview --output -

Fetch live traffic from PCAP-over-IP service, like Fox-IT's pcap-broker:

flowcarp --input tcpconnect:127.0.0.1:57012 --realtime --preview --output -

Receive packets in real-time from remote MikroTik device:

flowcarp --input tzsp:37008 --realtime --preview --output -

Output: Flows and Alerts

The primary output from FlowCarp is flow data, i.e. information about TCP/UDP/ICMP connections in the input data. The flow output includes information about IP addresses, port numbers and — more importantly — the application-layer protocol for each flow. Many of the supported flow output formats also include additional information, such as timestamp, duration, number of bytes and packets transferred and the Community ID for each flow.

FlowCarp can also produce alerts when it detects application layer protocols that are tagged as "MALICIOUS". This includes traffic like malware command-and-control (C2), protocols used to steal or exfiltrate information from hacked devices as well as remote management tools that are often used by malicious actors to interact with hacked computers.

The following flow and alert output formats are supported:

Flows Alerts
Comma-separated values (CSV)
Tab-separated values (TSV)
Suricata Eve JSON
Zeek conn log (JSON)
Zeek notice log (JSON)

The Eve JSON output is the most versatile, as it can contain both flows and alerts, as well as additional metadata. Eve and Zeek formatted JSON outputs can be parsed and filtered with jq. You can additionally render FlowCarp's Eve JSON output to an EveBox web UI.

Custom Protocol Models

FlowCarp includes built-in detection of several protocols, but you can create custom models for additional protocols. Collect at least 10 sessions where the protocol is in use, and save that traffic to a single PCAP file or to a dedicated directory containing only capture files with that protocol.

Pro-tip: collect 100+ sessions from different sources for higher precision

Create a local protocol model file with "--output model" like this:

flowcarp --input directory:Once:/path/to/pcaps/ --output model:"Example RAT":MALICIOUS:myExampleRAT.fcp

Load a custom protocol into FlowCarp with "--model":

flowcarp --input malware.pcap --model myExampleRAT.fcp --output - --format EveJsonAlert

Usage

Usage: flowcarp [arguments] -h, --help Print this help and quit -v, --verbose Log more information to stderr --clearcache Clear cached data and protocols --debug Log debug info --flush <seconds> Flush active flows every <seconds>. For real-time monitoring. Can output flow duplicates. --format <format> Flow output format, where <format> can be: CSV Comma separated values (default) TSV Tab separated values EveJson Suricata Eve JSON, alerts and flows EveJsonAlert Suricata Eve JSON, alerts only EveJsonFlow Suricata Eve JSON, flows only ZeekConn Zeek conn log, flows only ZeekNotice Zeek notice log, alerts only --input <source> Network traffic/packet input, where <source> can be: FILE Read pcap(ng) file from path specified in FILE URI Download pcap(ng) file from URI - Read pcap(ng) stream from stdin directory:<mode>:PATH Search for pcap(ng) files in PATH, where <mode> can be: Once Process files in PATH, then quit OnceRecursive Process files in PATH and sub directories thereof, then quit Monitor Process files in PATH, then monitor for new files to process in PATH tcp:PORT Start PCAP-over-IP listener on TCP port, for example tcp:57012 tcpconnect:IP:PORT Connect to a PCAP-over-IP server, such as PolarProxy or Fox-IT's pcap-broker tzsp:PORT Listen for MikroTik TZSP stream(s) on UDP port, for example tzsp:37008 --key <license> Use license key <license> to identify more protocols --logtime Include timestamps in log output --model <file> Load custom protocol model from file (create with --output model) --output <type> Output flow data as <type>, which can be any of: FILE Write flow data to FILE DIR Write flow data to new file in DIR - Output flow data to stdout tcp[:IP]:PORT Create flow output service listening on specified TCP port tcpconnect:IP:PORT Send flow output to specified IP and TCP port model:PROTO:[TAGS]:FILE Generate custom protocol model for PROTO from input packets and save it to .fcp FILE. Use comma separated TAGS, such as MALICIOUS,COINMINER (MALICIOUS is required to generate alerts). --preview Output early preview of active flows. For real-time monitoring. Can output flow duplicates. --realtime Read input pcap data at maximum speed, with risk of dropping some frames --timeout <seconds> Input timeout. Default = 0 (no timeout). --version Show version number and quit --webservice <uri-prefix> Start pcap-to-flows web service on URI prefix, such as http://127.0.0.1:57080/ or http://+:57080/

Example commands:

Demo Server

There is a FlowCarp demo server available on demo.flowcarp.com. This server runs in the "--webservice" mode with a commercial license that can identify over 600 protocols. The demo server is free to use if you want to try out FlowCarp's unique state-of-the-art protocol identification functionality.

Submit packet capture files to the demo server like this:

The server responds with a Suricata Eve JSON structure containing the detected flows, protocols and alerts. The jq tool can be used to filter the JSON data from FlowCarp. As an example, this command can be used to only show alerts from when it detects protocols tagged as MALICIOUS:

This jq query shows the top 10 most common protocols and their corresponding port numbers:

Free to Use — but with limitations

FlowCarp is released under a CC BY-ND 4.0 license, which means you are free to use the software for any purpose, even commercially. But there is a limitation on how much data that can be read with the free community edition. A company, organization or individual can only analyze up to 10 000 flows per day without a commercial license. FlowCarp continues extracting flow information from PCAP data when the daily limit is reached, but it does not identify additional protocols.

Another benefit with having a commercial FlowCarp license is that it can identify much more protocols than the free community edition. All FlowCarp users get access to the free community protocol package, which can identify the following common and malicious protocols:

Common protocols

Malicious protocols

The commercial protocol packages, on the other hand, can identify up to 600+ protocols. The most advanced protocol package can even detect what we call sub-protocols, which are protocols inside of other protocols. This sub-protocol detection enables users to differentiate between different types of HTTP based communications like Windows Update, CRL, OCSP or WebSocket.

FlowCarp's sub-protocol identification feature can also detect many malicious protocols that run on top of HTTP, such as AdaptixC2, DCRat, Formbook, LummaC2, NetSupport RAT, RedLine and StealC. The sub-protocol identification feature can even detect what's running inside of a TLS encrypted session, without having to decrypt the traffic! Identification of sub-TLS protocols is much more complex than for HTTP, which is why the precision is lower. But it can usually accurately identify many legitimate as well as malicious protocols that run on top of TLS, regardless of which port is being used.

𓆟 𓆞 𓆝 𓆟