Zeek Installation in Ubuntu

What is Zeek?

An open-source protocol analyzer and network security monitoring tool, Zeek was once known as Bro. It is intended to assist enterprises with real-time network traffic monitoring and analysis, offering information on network activity, potential security risks, and performance concerns. Due to its effectiveness in swiftly capturing and processing network data, Zeek is especially well-liked among cybersecurity experts and network managers.

How to install Zeek in Ubuntu?

Update and upgrade the Ubuntu using apt.

sudo apt-get update
sudo apt-get upgrade

Download the Zeek source code from the official website (https://zeek.org/get-zeek/).

Zeek offical download page

Install dependencies using the below command.

sudo apt-get install cmake make gcc g++ flex bison libpcap-dev libssl-dev python3-dev swig zlib1g-dev

Dependencies installation

Once all the dependencies are installed change the directory to the path where the Zeek source code file is downloaded and unzip the file.

cd Downloads
tar -xzf zeek-<verison>.tar.gz

Extracting zeek file

Change the directory to the extracted file

cd zeek-<version>

Configure Zeek using the below command

./configure

Configure command

Once the above command is done run the below commands. Note that this command takes time to execute.

make
make install

make
make install

To use zeek as a service we need to add the zeek home directory to the bashrc file.

nano ~/.bashrc

Add the line below or the home directory file zeek at the end of the file.

export PATH=/usr/local/zeek/bin:$PATH

Save and exit the file and to apply changes made run source command and check zeek version and directory.

source ~/.bashrc
which zeek
zeek — version

exporting zeek path

Now change the directory to /usr/local/zeek/etc check the what files are there in the directory.

cd /usr/local/zeek/etc
ls

Open new terminal window and check the ip using the below command check the network interface of the machine.

ip a

interfaces

We can see there are 2 interfaces, one is for loopback and other is for broadcast and more which is enp0s1. Note that this may vary from user to user. Note the interface name. Now in the previous window edit node.cfg file using nano and replace the interface name as shown below.

nano node.cfg

Once the file is saved check if the script is correct, using the below command.

zeekctl check

zeekctl check

Once you get “zeek scripts are ok.” at the end you can deploy zeek, using below command.

zeekctl deploy

zeekctl deploy

Once zeek is started we can check the status using.

zeekctl status

zeekctl status

Now to view logs we can change the directory to /usr/local/zeek/logs/current

cd /usr/local/zeek/logs/current

When we use the list command we can see the logs been generated.

logs

We can use tail command to view the logs,

tail -f conn.log

conn.log

Watch the tutorial in YouTube.

Youtube video tutorial

You can also read about zeek from Github.

Subscribe to our YouTube channel. https://www.youtube.com/@CyberToolGuardian/featured

Follow us on Instagram.
https://instagram.com/cybertoolguardian

Comments

Popular posts from this blog

What is ELK and Installing ELK stack (elasticsearch, logstash, kibana) in Ubuntu

Sending Zeek logs to ELK using Filebeats