adulau/ssldump

Write to pcap don't rotate and it was impossible to write into a pipe

michele-deluca opened this issue · 7 comments

Hi,
I am trying to write the outout pcap into a named pipe:

$ ssldump -v
ssldump 1.4b
Maintained by a bunch of volunteers, see https://github.com/adulau/ssldump/blob/master/CREDITS
Copyright (C) 2015-2021 the aforementioned volunteers
Copyright (C) 1998-2001 RTFM, Inc.
All rights reserved.
Compiled with OpenSSL: decryption enabled
$ mkfifo pcap_test.pcap
$ ls -ltr pcap_test.pcap
prw-r--r-- 1 root root 0 Jun 17 14:13 pcap_test.pcap
$ ssldump -w pcap_test.pcap
Can not open/create out pcap pcap_test.pcap

it possible to write the output packet into a pipe?

In alternative it was possible to rolling the pcap output file on size/time?

We would like to run a "continuos" packet capture/decode and read it only when we have some trouble.

thanks.

Hi,

Here is a quick fix that adds FIFO support for PCAP output:
wllm-rbnt@4a6fcb5

Can you give it a try ?

Hi, I can't reproduce the error you reported.
Here is how I test my patch (on Debian Buster):

$ git clone -b dev https://github.com/wllm-rbnt/ssldump.git
$ cd ssldump
$ ./autogen.sh
$ ./configure
$ make
$ mkfifo test.pcap; sudo ./ssldump -n -i any -w test.pcap

In a second terminal, I run:

$ sudo tcpdump -n -r test.pcap

I have the session decoding on the first terminal, and the flow of packets on the second one.

Here is a recipe to build it on RHEL/Centos 7.9. You will need a recent version of openssl.
I've never tested it (ssldump) on this version of the distro, you might encounter bugs at runtime.

$ sudo yum install git autoconf automake gcc make libpcap-devel libnet-devel json-c-devel tmux wget

$ wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz
$ tar xvfz openssl-1.1.1k.tar.gz
$ cd openssl-1.1.1k
$ ./config
$ make
$ make install
$ cd ..

$ echo "/usr/local/lib64" | sudo tee /etc/ld.so.conf.d/openssl.conf
$ sudo ldconfig

$ git clone -b dev https://github.com/wllm-rbnt/ssldump.git
$ cd ssldump
$ ./autogen.sh
$ ./configure CPPFLAGS="-D_BSD_SOURCE=1"
$ make
$ sudo ./ssldump -n -i eth0

I compile the latest ssldump from source into a rhel 7.

thanks.