Installation

installation Linux macOS

Getting the latest version of Tranalyzer2

  • Download the latest version of Tranalyzer2 here or run the following command:

    wget https://tranalyzer.com/download/tranalyzer/tranalyzer2-0.9.2lmw2.tar.gz

  • Extract the content of the archive of Tranalyzer2:

    tar xzf tranalyzer2-0.9.2lmw2.tar.gz

Installation - The easy way

Go into the tranalyzer2 folder and run the setup.sh script:

cd tranalyzer2-0.9.2lmw2

./setup.sh

source ~/.bashrc

This will install everything including dependencies you might need also for plugin development or to generate documentation. The last command is there to ensure you have access to all t2 commands in the current terminal. Note that the setup.sh script should tell you the name of the file to source, e.g., .zshrc instead of .bashrc.

If you do not have LaTex it also downloads all the necessary dependencies. If you do not want the LaTex dependencies (required for t2fm and to rebuild the doc), then invoke the setup.sh script with the -T option (Note that setup.sh and t2build are using now meson which compiles much faster than autotools. If meson is not available, e.g., on older systems, it falls back to slower autotools.

./setup.sh -T

And if you already have all the necessary updates and just want to reinstall T2:

./setup.sh -N

To see all options invoke the following command:

./setup.sh -h

Usage:
    setup.sh [OPTION...]

Optional arguments:
    -C, --update          Check for a new version of Tranalyzer
                          (and proceed with the update if requested)

    -D, --no-deps         Do not install dependencies
    -G, --no-gui          Do not install gui-dependencies
    -T, --no-latex        Do not install LaTeX dependencies
    -U, --no-db           Do not update databases
    -N, --no-network      Do not install dependencies or update databases
    -E, --no-empty        Do not empty the plugin folder
    -B, --no-build        Do not build tranalyzer and the plugins
    -M, --no-man          Do not install man pages
    -L, --no-aliases      Do not install t2_aliases

    -d, --deps            Only install the dependencies
    -u, --db              Only update the databases
    -e, --empty           Only empty the plugin folder
    -b, --build           Only build tranalyzer and the plugins
    -m, --man             Only install the man pages
    -l, --aliases         Only install the aliases

    -a, --all             Build all the plugins instead of only the default ones

    -i, --ask             Ask for confirmation before executing an action

    -h, --help            Show this help, then exit

If your setup.sh bails out with a message like ... unexpected ( ..., you may have old or conflicting aliases in your .bashrc (or .zshrc, …) file. This may cause some problems, as in version 0.8.9 some aliases have been replaced with functions for added flexibility. The error message should tell you which function/alias is causing a problem. Just remove those aliases from your .bashrc file and try running ./setup.sh again. As a rule of thumb, the only T2 related alias or code in your .bashrc should be the lines where t2_aliases is sourced.

Note that you need to open a new bash window or source your .bashrc file in order for the new aliases and functions to be available:

t2

-bash: t2: command not found

source ~/.bashrc

t2

Tranalyzer 0.9.1 - High performance flow based network traffic analyzer

Usage
    tranalyzer [OPTION...] <INPUT>

...

You are now ready to use Tranalyzer!

Start learning how here

Installation - The detailed way

If you are a more advanced user, you can run the commands performed by the setup.sh script manually as follows:

1. Dependencies

  • Ubuntu/Kali:

    sudo apt-get install autoconf autoconf-archive automake libbsd-dev libpcap-dev libreadline-dev libtool make meson zlib1g-dev

  • Arch/Manjaro:

    sudo pacman -S autoconf autoconf-archive automake bash-completion gcc libpcap libtool make meson pkgconf zlib

  • Gentoo:

    sudo emerge autoconf autoconf-archive automake bash-completion libpcap libtool meson zlib

  • openSUSE:

    sudo zypper install autoconf autoconf-archive automake gcc libbsd-devel libpcap-devel libtool meson readline-devel zlib-devel

  • CentOS/Fedora/Red Hat: (If the dnf command could not be found, try with yum instead)

    sudo dnf install autoconf autoconf-archive automake bzip2 libbsd-devel libpcap-devel libtool meson readline-devel zlib-devel

  • macOS: (using Homebrew package manager)

    brew install autoconf autoconf-archive automake libpcap libtool meson readline zlib

Note that meson is optional, but recommended as it is much faster than the autotools (autoconf, automake, …).

2. Aliases

This step will give you access to all aliases (t2, t2build, …) used in the tutorials.

  • Go to the root folder of Tranalyzer, i.e., where the autogen.sh and README.md files are located:

    cd tranalyzer2-0.9.2/

  • Save this location in the variable $T2HOME:

    T2HOME="$PWD"

    echo $T2HOME

    /home/user/tranalyzer2-0.9.2/
  • The file $T2HOME/scripts/t2_aliases provides a set of aliases and functions which facilitate working with Tranalyzer. To access them, copy the code below. This will identify your terminal configuration file and then modify it.

    TOADD="$(cat << EOF
    if [ -f "$T2HOME/scripts/t2_aliases" ]; then
        . "$T2HOME/scripts/t2_aliases" # Note the leading '.'
    fi
    EOF
    )"
    
    if [ -f "$HOME/.bashrc" ]; then
        echo "$TOADD" >> "$HOME/.bashrc"
        source "$HOME/.bashrc"
        echo "Aliases installed in $HOME/.bashrc"
    elif [ -f "$HOME/.zshrc" ]; then
        echo "$TOADD" >> "$HOME/.zshrc"
        source "$HOME/.zshrc"
        echo "Aliases installed in $HOME/.zshrc"
    elif [ -f "$HOME/.bash_profile" ]; then
        echo "$TOADD" >> "$HOME/.bash_profile"
        source "$HOME/.bash_profile"
        echo "Aliases installed in $HOME/.bash_profile"
    else
        echo "No standard terminal configuration file found."
    fi

3a. Compilation (using aliases installed in step 2)

To build Tranalyzer2 and the plugins, run one of the following command:

  • Tranalyzer2 and a default set of plugins:

    t2build

  • Tranalyzer2 and all the plugins in $T2HOME:

    t2build -a

  • Tranalyzer2 and a custom set of plugins (listed in plugins.build):

    t2build -b

  • Tranalyzer2 and a custom set of plugins (listed in myplugins.txt):

    t2build -b myplugins.txt

  • To build a specific plugin, use t2build pluginName (note that completion is available, so if you type t2build <tab>, you will see a list of all the plugins and if you type t2build http<tab> it will automatically complete the command to t2build httpSniffer). Note that you can specify more than one plugin name, e.g., t2build httpSniffer txtSink

Run t2build --help for the full list of options accepted by the scripts.

t2build -i can be used to install Tranalyzer2 in the plugin folder (-p option). To install tranalyzer in /usr/local/bin and the man page in /usr/local/man/man1, then use $T2HOME/tranalyzer2/install.sh. Note that root rights may be required for the installation.

3b. Compilation with autotools (without using aliases installed in step 2)

First, make sure to set T2HOME:

  • Go to the root folder of Tranalyzer, i.e., where the autogen.sh and README.md files are located:

    cd tranalyzer2-0.9.2/

  • Save this location in the variable $T2HOME:

    T2HOME="$PWD"

    echo $T2HOME

    /home/user/tranalyzer2-0.9.2/

Now, to build Tranalyzer2 and the plugins, run one of the following command:

  • Tranalyzer2 and a default set of plugins:

    cd "$T2HOME"

    ./autogen.sh

  • Tranalyzer2 and all the plugins in $T2HOME:

    cd "$T2HOME"

    ./autogen.sh -a

  • Tranalyzer2 and a custom set of plugins (listed in plugins.build):

    cd "$T2HOME"

    ./autogen.sh -b

  • Tranalyzer2 and a custom set of plugins (listed in myplugins.txt):

    cd "$T2HOME"

    ./autogen.sh -b myplugins.txt

For finer control of which plugins to build, either run ./autogen.sh from every folder you want to build, e.g., cd "$T2PLHOME/httpSniffer" && ./autogen.sh or run ./autogen.sh pluginName from the root folder of Tranalyzer2. Note that you can specify more than one plugin name, e.g., ./autogen.sh httpSniffer txtSink

Run ./autogen.sh --help for the full list of options accepted by the scripts.

./autogen.sh -i can be used to install Tranalyzer2 in /usr/local/bin and the man page in /usr/local/man/man1. Note that root rights are required for the installation.

Documentation

Tranalyzer2 core and every plugin come with their own documentation found in their respective doc/ subfolder. For more convenient access to the documentation, t2_aliases defines the function t2doc which can be used as follows: t2doc pluginName. The full documentation of Tranalyzer2 and all the locally available plugins can be accessed by invoking t2doc.

Note that the aliases are only available if the installation was performed with the setup.sh script or if t2_aliases was installed as described here.