How to Install Wireshark on Ubuntu 22.04

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
Search for a command to run...

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
Vagrant is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity, and makes the "works ...
The git log command is used to view the commit history of a Git repository. You can customize the output format to show specific details in a more readable or structured way. Below are some useful variations and formatting options for git log: To sh...

Overview This article will teach us how to: Install Ubuntu Server 24.04 on a laptop from scratch Install Ubuntu server by using Vagrant tool with ISO image Prerequisites: A laptop without any OS installed; A virtualization software Virtualbox t...

The /etc/passwd and /etc/shadow files are the backbone of Linux user management. Together, they store user account information and handle authentication securely. This article provides a hands-on guide to understanding these files, their structure, a...

In Linux, links are powerful tools that allow you to create references to files and directories. There are two main types of links: hard links and soft links (also known as symbolic links or symlinks). Understanding the differences between these two ...

A hostname is a human-friendly name given to a computer. It is a unique identifier that allows us to identify the machine in various network communications, making it easier to locate and manage devices. Type: hostname To see where it is stored, typ...

Wireshark is a network packet analyzer. A network packet analyzer presents captured packet data in as much detail as possible.
You could think of a network packet analyzer as a measuring device for examining what’s happening inside a network cable, just like an electrician uses a voltmeter for examining what’s happening inside an electric cable (but at a higher level, of course).
Wireshark isn’t an intrusion detection system. It will not warn you when someone does strange things on your network that he/she isn’t allowed to do. However, if strange things happen, Wireshark might help you figure out what is going on.
Wireshark will not manipulate things on the network, it will only “measure” things from it. Wireshark doesn’t send packets on the network or do other active things (except domain name resolution, but that can be disabled).
Ensure that the following dependencies are installed on the system.
GLib development package which includes the headers, libraries, and other files necessary for development.
sudo apt-get install libglib2.0-devThe libpcap library for capturing live network data.
Update the APT package index by running the following command:
sudo apt update
Once the APT package index is updated, install Wireshark on your system:
sudo apt install wireshark
Click yes button during the installation for non-superusers to able to capture the packets
Verify the Wireshark version:
wireshark --version
If you are logged as a normal user then add the user to the Wireshark group:
sudo usermod -aG wireshark $USER
This command adds the currently logged-in user to the wireshark group, giving them permissions associated with that group (like capturing network packets without needing to be the root user).
sudo groupadd wireshark Only then, add the currently logged-in user to the wireshark group.Modify the “dumcap” file permission:
sudo chgrp wireshark /usr/bin/dumpcap
This command changes the group ownership of the dumpcap executable to the wireshark group.
sudo chmod +x /usr/bin/dumpcap
The command above grants execute permissions to the dumpcap file.
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
The tool setcap assigns capabilities to executables.
cap_net_raw: Allows the program to use RAW and PACKET sockets, which can be necessary for sniffing tools that need to capture raw packets directly from network interfaces.
cap_net_admin: Provides various network-related privileges like interface configuration, administration, binding to privileged ports, setting packet filtering rules, etc.
=eip indicates which set of capabilities to modify:
e stands for Effective. It means the capability is "activated".
i stands for Inherited. It means the capability can be inherited by child processes.
p stands for Permitted. It ensures the capability can be used by the process
By setting these capabilities, you're giving the dumpcap binary the ability to capture raw packets and conduct other network-related operations without needing to run as the root user.