| 1 |
About the SaunaFS Wireshark plugin |
| 2 |
=================================== |
| 3 |
|
| 4 |
This directory contains a Python and Bash scripts which generate a plugin |
| 5 |
(dissector) for Wireshark (http://www.wireshark.org/) which adds support for |
| 6 |
the SaunaFS protocol. This plugin is compiled into a saunafs.so shared |
| 7 |
library to make it easily redistributable. |
| 8 |
|
| 9 |
To learn more about Wireshark dissectors see: |
| 10 |
https://www.wireshark.org/docs/wsdg_html_chunked/ChapterDissection.html |
| 11 |
|
| 12 |
---- |
| 13 |
|
| 14 |
Follow below steps to install SaunaFS Wireshark plugin: |
| 15 |
|
| 16 |
1) Ensure you have the following packages installed (for Debian and Ubuntu): |
| 17 |
|
| 18 |
# apt install wireshark cmake libcap-dev libglib2.0-dev bison flex libcrypto++-dev libc-ares-dev libgcrypt20 libgcrypt20-dev libspeexdsp1 libspeexdsp-dev |
| 19 |
|
| 20 |
2) If you want to be able to sniff interfaces without root privileges follow |
| 21 |
instructions from /usr/share/doc/wireshark-common/README.Debian (same steps |
| 22 |
for Ubuntu): |
| 23 |
|
| 24 |
# apt install wireshark |
| 25 |
# dpkg-reconfigure wireshark-common |
| 26 |
# usermod -a -G wireshark $USER |
| 27 |
# reboot |
| 28 |
# chmod +s /usr/bin/dumpcap |
| 29 |
|
| 30 |
If you haven't installed Wireshark yet, you can find instructions here: |
| 31 |
https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob_plain;f=debian/README.Debian;hb=HEAD |
| 32 |
|
| 33 |
3) Set some variables: |
| 34 |
|
| 35 |
$ export SAUNAFS_SRCDIR=$(cd ../../; pwd) |
| 36 |
$ export WIRESHARK_SRCDIR=/tmp/wireshark/ |
| 37 |
$ WIRESHARK_VERSION=$(wireshark --version | head -1 | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') # get version by invoking wireshark --version |
| 38 |
|
| 39 |
4) Clone the Wireshark sources, e.g.: |
| 40 |
|
| 41 |
$ git clone https://gitlab.com/wireshark/wireshark.git "$WIRESHARK_SRCDIR" |
| 42 |
|
| 43 |
5) Checkout your version of Wireshark: |
| 44 |
|
| 45 |
$ cd "$WIRESHARK_SRCDIR" && git checkout wireshark-$WIRESHARK_VERSION |
| 46 |
|
| 47 |
6) Copy contents of this directory to the Wireshark source directory: |
| 48 |
|
| 49 |
$ tar -C "$SAUNAFS_SRCDIR"/utils/wireshark -c . | tar -C "$WIRESHARK_SRCDIR" -vx |
| 50 |
|
| 51 |
7) Run the generate.sh script (provide path to the SFSCommunication file as an |
| 52 |
argument): |
| 53 |
|
| 54 |
$ "$WIRESHARK_SRCDIR"/plugins/epan/saunafs/generate.sh "$SAUNAFS_SRCDIR"/src/protocol/SFSCommunication.h |
| 55 |
|
| 56 |
8) Edit the main CMakeLists.txt file in the Wireshark source tree to add the |
| 57 |
new plugin: |
| 58 |
|
| 59 |
$ vim "$WIRESHARK_SRCDIR"/CMakeLists.txt |
| 60 |
``` |
| 61 |
--- a/CMakeLists.txt |
| 62 |
+++ b/CMakeLists.txt |
| 63 |
@@ -1804,6 +1804,7 @@ if(ENABLE_PLUGINS) |
| 64 |
plugins/epan/mate |
| 65 |
plugins/epan/opcua |
| 66 |
plugins/epan/profinet |
| 67 |
+ plugins/epan/saunafs |
| 68 |
plugins/epan/stats_tree |
| 69 |
plugins/epan/transum |
| 70 |
plugins/epan/unistim |
| 71 |
``` |
| 72 |
|
| 73 |
|
| 74 |
9) Build the Wireshark using cmake (you don't have to build the GUI): |
| 75 |
|
| 76 |
$ mkdir "$WIRESHARK_SRCDIR"/build |
| 77 |
$ cd "$WIRESHARK_SRCDIR"/build |
| 78 |
$ cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_wireshark=NO |
| 79 |
$ nice nice make -j$(nproc) |
| 80 |
|
| 81 |
10) To install the plugin copy saunafs.so library to the personal plugin |
| 82 |
folder: |
| 83 |
|
| 84 |
$ mkdir -p ${PERSONAL_CONFIG_DIR}/epan |
| 85 |
$ cp "$WIRESHARK_SRCDIR"/build/run/saunafs.so ${PERSONAL_CONFIG_DIR}/epan |
| 86 |
|
| 87 |
or global plugin folder: |
| 88 |
|
| 89 |
# cp "$WIRESHARK_SRCDIR"/build/run/saunafs.so ${GLOBAL_CONFIG_DIR}/epan |
| 90 |
|
| 91 |
${PERSONAL_CONFIG_DIR} and ${GLOBAL_CONFIG_DIR} are dependent on your |
| 92 |
system and Wireshark version. You can determine them by running Wireshark |
| 93 |
and navigating to: |
| 94 |
|
| 95 |
Help > About Wireshark > Folders |
| 96 |
|
| 97 |
E.g. for Wireshark 2.6.7: |
| 98 |
|
| 99 |
PERSONAL_CONFIG_DIR=~/.local/lib/wireshark/plugins/2.6 |
| 100 |
GLOBAL_CONFIG_DIR=/usr/lib/x86_64-linux-gnu/wireshark/plugins/2.6/ |
| 101 |
or for 4.4.3 =/usr/lib/x86_64-linux-gnu/wireshark/plugins/4.4/epan/ |
| 102 |
|
| 103 |
12) Enjoy! |
| 104 |
|
| 105 |
This plugin recognizes the SaunaFS protocol using TCP port numbers. If you |
| 106 |
use non-standard ports (9419-9422) you need to change them in: |
| 107 |
|
| 108 |
Edit -> Preferences -> Protocols -> SaunaFS |
| 109 |
|
| 110 |
E.g. to parse the communication in our test suite set SaunaFS TCP ports to: |
| 111 |
|
| 112 |
9419-9422,25000-25015 |