Today - for the first time in probably 15+ years - I wanted to capture the actual packets
dropped within netfilter in a pcap file. The method I developed during my netfilter days
20 year ago for this is the PCAP output plugin of ulogd.
To my knowledge it's the only method which allows you to capture the actual binary packet
violating your iptables or nftables policy for later analysis in wireshark or other pcap
related tools.
However, I was surprised to see that the ulogd2 package both in Debian stable as well
as unstable doesn't contain the PCAP output plugin. Is that a conscious decision? I would
think it's a rather useful feature to have.
Also, the example config file contains PCAP related sections, making this even more confusing. So you
uncomment parts of the example config that gets installed (stack=log2:NFLOG,base1:BASE,pcap1:PCAP) and then it
fails due to not finding the PCAP plugin with either with
Apr 03 19:02:11 lakshmi1 ulogd[3579]: can't find requested plugin PCAP
(in the plugin auto-load case , or with
Apr 03 19:02:38 lakshmi1 ulogd[3607]: load_plugin: '/usr/lib/x86_64-linux-gnu/ulogd/ulogd_output_PCAP.so': /usr/lib/x86_64-linux-gnu/ulogd/ulogd_output_PCAP.so: cannot open shared object file: No such file or directory
(in the case one explicitly wants to load the plugin via the commented-out line from the sample config file.
Given that building the pcap plugin is enabled by default, I guess it must be explicitly disabled with
--disable-pcap in the debian package, so I guess it's a conscious decision and not an accident?
Thanks for looking into this.