How To Install netsniff-ng on Ubuntu 18.04

In this tutorial we learn how to install netsniff-ng on Ubuntu 18.04. netsniff-ng is Linux network packet sniffer toolkit

Introduction

In this tutorial we learn how to install netsniff-ng on Ubuntu 18.04.

What is netsniff-ng

netsniff-ng is:

netsniff-ng is a high performance Linux network sniffer for packet inspection. It can be used for protocol analysis, reverse engineering or network debugging. The gain of performance is reached by ‘zero-copy’ mechanisms, so that the kernel does not need to copy packets from kernelspace to userspace.

netsniff-ng toolkit currently consists of the following utilities:

  • netsniff-ng: a zero-copy packet analyzer, pcap capturing/replaying tool
  • trafgen: a multithreaded low-level zero-copy network packet generator
  • mausezahn: high-level packet generator for appliances with Cisco-CLI
  • ifpps: a top-like kernel networking and system statistics tool
  • curvetun: a lightweight curve25519-based multiuser IP tunnel
  • astraceroute: an autonomous system trace route and DPI testing utility
  • flowtop: a top-like netfilter connection tracking tool
  • bpfc: a [seccomp-]BPF (Berkeley packet filter) compiler, JIT disassembler

There are three methods to install netsniff-ng on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install netsniff-ng Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install netsniff-ng using apt-get by running the following command:

sudo apt-get -y install netsniff-ng

Install netsniff-ng Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install netsniff-ng using apt by running the following command:

sudo apt -y install netsniff-ng

Install netsniff-ng Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install netsniff-ng using aptitude by running the following command:

sudo aptitude -y install netsniff-ng

How To Uninstall netsniff-ng on Ubuntu 18.04

To uninstall only the netsniff-ng package we can use the following command:

sudo apt-get remove netsniff-ng

Uninstall netsniff-ng And Its Dependencies

To uninstall netsniff-ng and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove netsniff-ng

Remove netsniff-ng Configurations and Data

To remove netsniff-ng configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge netsniff-ng

Remove netsniff-ng configuration, data, and all of its dependencies

We can use the following command to remove netsniff-ng configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge netsniff-ng

References

Summary

In this tutorial we learn how to install netsniff-ng package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.