Cyber Services / All lessons / CEH — Ethical Hacking / Installing and Configuring Ntopng on Kali Linux

Installing and Configuring Ntopng on Kali Linux

Module 127 of 130 · 4 min read · Free to read

MODULES ↓ Command blocks have a COPY button

A Step-by-Step Guide for Debian 11 and Ubuntu 20.04

Ntopng Overview

Ntopng ("ntop next generation") is a popular open-source, web-based network traffic monitoring application. It provides a high-level overview of network usage, identifies active hosts, displays traffic flows, and offers various reports and historical data visualizations. It supports Linux, macOS, Windows, and BSD.

Prerequisites

  • A server running Debian 11 (Bullseye) or Ubuntu 20.04 (Focal Fossa).
  • Network interface connected to the network segment you wish to monitor.
  • User privileges: root or a non-root user with sudo permissions.
  • Basic familiarity with the Linux command line.

Installation on Debian 11 (Bullseye)

Step 1: Update System Packages

Ensure your system's package list and installed packages are up-to-date.

sudo apt update -y && sudo apt upgrade -y

Updates the package list and upgrades existing packages.

Step 2: Add Ntop Repository

Ntop maintains its own repository for the latest versions. Download and install the repository package.

cd /tmp
wget http://apt.ntop.org/buster/all/apt-ntop.deb
sudo apt install ./apt-ntop.deb -y

Note: We use the 'buster' repository package, which is generally compatible with Bullseye for ntopng. Change directory to /tmp for temporary download, fetch the repo package, and install it using apt to handle dependencies.

Step 3: Install Ntopng and Dependencies

Update the package list again to include the new repository, then install Ntopng and its dependencies.

sudo apt update -y
sudo apt install ntopng ntopng-data nprobe -y

Installs the main Ntopng package, required data files, and optionally nprobe (a NetFlow/sFlow probe, not strictly required for basic Ntopng operation but often used together).

Step 4: Configure Ntopng

Edit the primary configuration file to specify essential options like the network interface to monitor and the web interface port.

sudo nano /etc/ntopng/ntopng.conf

Find the line starting with -G (pid path) and add/modify the following lines below it (adjust as needed):

# -G=/var/run/ntopng.pid # Example existing line

-i=eth0      # Replace eth0 with your actual network interface name (e.g., ens18)
-w=3000      # Set the HTTP web interface port (default is 3000)
--local-networks="192.168.1.0/24" # Define your local network(s), comma-separated
--user=ntopng   # Run ntopng as this user
--daemon     # Run as a daemon process

Use ip a or ifconfig to find your network interface name. Defining --local-networks helps Ntopng distinguish between local and remote traffic. Save the file (Ctrl+X, then Y, then Enter in nano).

Step 5: Start and Enable Ntopng Service

Start the Ntopng service and enable it to launch automatically on system boot.

sudo systemctl restart ntopng
sudo systemctl enable ntopng

Check the service status to ensure it started without errors:

sudo systemctl status ntopng

Look for "active (running)". Press Q to exit the status view.

Step 6: Access Ntopng Web Interface

Open your web browser and navigate to your server's IP address followed by the port specified in the configuration file (e.g., http://YourServerIP:3000).

The default login credentials are:

  • Username: admin
  • Password: admin

You will be prompted to change the password upon first login.

Installation on Ubuntu 20.04 (Focal Fossa)

The process for Ubuntu 20.04 is very similar to Debian 11.

Step 1: Update System Packages

sudo apt update -y && sudo apt upgrade -y

Step 2: Add Ntop Repository

cd /tmp
wget https://packages.ntop.org/apt/20.04/all/apt-ntop.deb
sudo apt install ./apt-ntop.deb -y

Uses the repository package specifically built for Ubuntu 20.04.

Step 3: Install Ntopng and Dependencies

sudo apt update -y
sudo apt install ntopng ntopng-data nprobe -y

Step 4: Configure Ntopng

Edit the configuration file as described in Debian Step 4.

sudo nano /etc/ntopng/ntopng.conf

Ensure you set the correct interface (-i=), web port (-w=), and local networks (--local-networks=).

# Example configuration lines:
-i=ens18     # Replace ens18 with your interface
-w=3000      # Web port
--local-networks="192.168.50.0/24,10.0.0.0/8" # Example local networks
--user=ntopng
--daemon

Step 5: Start and Enable Ntopng Service

sudo systemctl restart ntopng
sudo systemctl enable ntopng
sudo systemctl status ntopng

Step 6: Access Ntopng Web Interface

Access the web interface via http://YourServerIP:3000 (or the port you configured) and log in with the default credentials (admin / admin), changing the password when prompted.

Further Steps & Official Documentation

After the initial setup, explore the Ntopng interface to understand its features. Consider configuring alerts, historical data retention, and user accounts according to your needs. For more advanced configurations and features, refer to the official documentation.

View Ntopng Official Guides
Modules (130) ← CEH — Ethical Hacking