Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
michele-deluca opened this issue Jun 17, 2021 · 7 comments
Closed

Comments

@michele-deluca
Copy link

michele-deluca commented Jun 17, 2021

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.

@wllm-rbnt
Copy link
Contributor

Hi,

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

Can you give it a try ?

@michele-deluca
Copy link
Author

michele-deluca commented Jun 19, 2021 via email

@wllm-rbnt
Copy link
Contributor

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.

@michele-deluca
Copy link
Author

michele-deluca commented Jun 25, 2021 via email

@wllm-rbnt
Copy link
Contributor

wllm-rbnt commented Jun 25, 2021

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

@michele-deluca
Copy link
Author

michele-deluca commented Jun 29, 2021 via email

@michele-deluca
Copy link
Author

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

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants