I would like to write a protocol analyzer and need some direction. I would like to write something simple which works on TCP, similar to the ConnSize analyzer. I would like my analyzer to be distributed as a plugin, similar to MITRE’s HTTP2 analyzer, so I am following the docs here: https://docs.zeek.org/en/stable/devel/plugins.html
error in /usr/local/bro/share/bro/base/init-bare.bro, line 1: plugin
Demo::ConnTaste is not available
fatal error in /usr/local/bro/share/bro/base/init-bare.bro, line 1:
Failed to activate requested dynamic plugin(s).
After executing these commands:
git clone --recursive [https://github.com/zeek/zeek.git](https://github.com/zeek/zeek.git)
cd zeek
./configure
make
DIST=`pwd`
cd aux/bro-aux/plugin-support
./init-plugin -u ./conn-taste Demo ConnTaste
BRO_PLUGIN_PATH=`pwd`
cd ${DIST}
cd ../
git clone [https://github.com/esnet/binpac_quickstart.git](https://github.com/esnet/binpac_quickstart.git)
cd binpac_quickstart
pip install docopt jinja2
./start.py ConnTaste "Connection Byte Offset Tasting"
${BRO_PLUGIN_PATH}/conn-taste/ --tcp --buffered --plugin
cd ${BRO_PLUGIN_PATH}/conn-taste
./configure --bro-dist=${DIST}
make
cd ${DIST}
./configure
make
make install
bro -NN Demo::ConnTaste
I’m guessing there is some environment variable I am missing as I tried zeek/testing/btest/plugins/protocol.bro as Robin suggested and the @TEST-EXEC statements worked as expected.
I tried changing the name provided to the setup script as suggested. Doing so gives me many errors when I try to ./configure the plugin from within the conn-taste/ directory. CMake states that DEMO::CONNTASTE-events.bif is “reserved or not valid for for certain CMake features”. It complains about many of the file names.
Additionally, all the files in conn-taste/src/ look like DEMO::CONNTASTE.cc
Okay, with your original line for quickstart, this works rather than Demo::ConnTaste.
bash-3.2# /usr/local/bro/bin/bro -NN Bro::CONNTASTE
Bro::CONNTASTE - This thing analyzer (dynamic, no version information)
[Analyzer] CONNTASTE (ANALYZER_CONNTASTE, enabled)
[Event] conntaste_event
So we’ve got some plugin naming issues to deal with, which I hope to work out tomorrow. It shouldn’t be about reinventing the universe, binpac is hard enough.