Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Network Traffic Dashboard

A real-time network visibility tool built with Scapy for packet capture and Dash/Plotly for interactive visualization.
It provides live charts of bandwidth usage, protocol distribution, and top talkers, along with alerts for suspicious activity.
Captured traffic can be exported to CSV for offline analysis or PCAP for inspection in Wireshark.


Features

  • Real-time capture using Scapy (supports Ethernet, Wi-Fi, and loopback adapters via Npcap).
  • Interactive dashboard powered by Dash/Plotly.
  • Visualizations:
    • Bandwidth over time
    • Protocol distribution (TCP/UDP/ICMP/etc.)
    • Top talkers by traffic volume
  • Alerts:
    • Traffic bursts (packets/sec threshold)
    • Suspicious ports (22, 23, 3389, 4444, 8080, 5353 by default)
    • Blacklist hits (configurable in blacklist.txt)
  • Exports:
    • CSV: structured flows for quick offline analysis
    • PCAP: raw packets for deep dives in Wireshark
  • Configurable via config.yaml

Project Structure

├── dashboard.py # Dash + Flask web app

├── capture.py # Packet sniffer thread & blacklist utilities

├── config.yaml # Main configuration

├── blacklist.txt # Blacklisted IPs/CIDRs

├── requirements.txt # Python dependencies

└── captures/ # Generated CSV + PCAP files


Setup & Usage

1. Requirements

  • Python 3.10+
  • Npcap (Windows) or libpcap (Linux/macOS)
  • Admin/root privileges for raw packet capture

2. Installation

Clone and install dependencies:

git clone https://github.com/<your-username>/network-traffic-dashboard.git
cd network-traffic-dashboard

python -m venv .venv
source .venv/bin/activate   # (Linux/macOS)
.venv\Scripts\Activate.ps1  # (Windows PowerShell)

pip install -r requirements.txt

3. Configuration

Edit config.yaml:

iface: "Wi-Fi"                 # network adapter name (see below)
bpf_filter: "tcp or udp or icmp"
burst_pps_threshold: 800
blacklist_file: "./blacklist.txt"
host: "127.0.0.1"
port: 8050

Find available interfaces:

python -c "from scapy.all import get_if_list; print(get_if_list())"

4. Run Dashboard.py

Start the dashboard:

python dashboard.py

Open in browser: https://127.0.0.1:8050

Testing Alerts:

  • Suspicious Port:
Test-NetConnection 192.168.1.50 -Port 3389   # replace with your LAN IP
  • Blacklist Hit:
    • Add your IP (e.g., 192.168.1.50) to blacklist.txt, restart app, then ping/curl it.
  • Burst PPS:
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
for _ in range(5000):
    s.sendto(b'x'*200, ('192.168.1.50', 9999))

Tech Stack:

Scapy – packet capture & parsing

Dash – interactive web dashboard

Plotly – charts & visualizations

Flask – web server

Pandas – structured data handling

YAML – configuration

Disclaimer

This project is for educational and monitoring purposes only. Do not run packet sniffers on networks you don’t own or have permission to monitor.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages