Capturing Network Traffic
Overview for Datumize Data Dumper (DDD), used to capture network traffic.
One relevant source for Dark Data is found in network transactions. By doing a careful examination of the network traffic and reconstruction of the conversations, hidden metrics can be non-intrusively recovered.
Datumize Data Dumper (DDD) is a Datumize product aimed at capturing network packets very efficiently at a deep operating system level with minimal-to-no packet loss. It usually works in combination with DDC; DDD manages the segmentation, filtering and temporary persistence of network packets in PCAP files, while DDC efficiently picks-up the segmented files to deliver the further processing. The diagram below represents DDD in action, receiving network packets from the operating systems, capturing, filtering and structuring the output into binary files that will be later processed by Datumize Data Collector (DDC).
Datumize Data Dumper is a software component that uses tcplib and tcpdump for capturing network packets while in memory of the operating system, apply some filters to select just the traffic needed, and store in packets in PCAP files minimizing the overall packet loss. Some important concepts to keep in mind:
- libpcap: library used to intercept packets at operating system level, open source. It works on the user space and works very well from a software perspective. If you need to capture extreme bandwidth, either you go for dedicated hardware (appliance) or use different libraries working at the kernel space; Datumize uses this approach because you can run libpcap in multiple standard operating systems.
- tcpdump: a very handy capture, filter and store program, open source (releases). Wrapped within DDD with extra goodies.
- BNF filter: the network filtering syntax, extremely flexible and powerful. Using the Berkeley Packet Filter (BPF) syntax.
- Operating system: although libpcap is portable and there are Unix and Windows versions, Linux tends to be more robust and minimizes packet loss.
- PCAP: this binary format supports the storage of network packets for further analysis. DDD supports this format for persisting the selected packets.
- Storage: the output files are organized in a directory, and pcap output files have different partitioning options.
DDD is very sensitive to configuration. Make sure you know what you're doing.
Datumize Data Dumper (DDD) configuration details the different properties you can adjust in the product.
Memory buffer size in KB. This buffer is used to temporarily hold network packets before applying the filtering and eventually copying the packet to the output.
|Device||DEV||Network device (as shown by ifconfig)||String|
PCAP Network Filter as supported by tcpdump. The filter must be quoted, i.e.
Packet snapshot length determines the size of the window (in bytes) used for packet capture. This is a very sensitive property.
Rotate output pcap files every number of seconds.
|Owner||USER||Output pcap folder and files owner (user:group notation)||String|
|Staging directory||RAMFS||Absolute path of ramfs (memory filesystem) folder.||Path|
|Output directory||OUTPUT||Absolute path of pcap output folder.||Path|
|Log file||LOGFILE||Relative or absolute log file path||Path|
|Pcap split||SPLITNUM||Use pcap spliter if exist and split into number of times set.||Integer|
|Sleep on move||SLEEP|
Sleep a number of seconds after moving recently close pcap file to output directory.
|Extra parameters||EXTRA||Use specific user privileges. Usually used to add ||String|
DDD is automatically installed through Datumize Zentral (DZ) and that should be fine for most configurations.
Important considerations to snapshot length:
- Big snapshot length decreases the performance of DDD and could generate high amounts of packet losses. The bigger the window, the more CPU cycles to do any processing, filtering and copying.
- Small snapshot length could yield truncated packets. If the snapshot is smaller than the actual packet size, you will get just the amount of bytes defined in the snapshot.
- Smaller snapshot might be fine if you just want to analyze packet headers.
Linux system limits can be tweaked for better TCP performance. Check reference1 and reference2.
Memory mounted file (ramfs) is being used by DDD to increase the packet capture and performance.
Using tcpdump from command line
Eventually you might need to use tcpdump from the command line to understand some traffic being captured, decide the proper filter or fine-tune some DDD parameters.
|Capture all interfaces|
|Show IP instead domain names|
|Split large pcap into smaller pcaps (ex. 200MB)|
|Flush captured packets and prevent truncated pcap errors|
|Filtering by protocol and port|
|Filtering by byte: example hidding traffic with 0 data|
|Complex filters (binary and hexadecimal)|
|Filter by IP odd and even|
|Get all the IPs of pcap file|
|tcpdump cheat sheet||Check Packetlife|
|Wireshark cheat sheet||Check Packetlife|