The Network Traffic Analyzer is a Python-based cybersecurity project that captures and analyzes live network traffic using Scapy. The tool monitors packet activity, identifies network protocols, tracks active hosts, measures bandwidth usage, exports traffic statistics, and generates visual reports.
This project was developed on Kali Linux as part of a hands-on cybersecurity learning path focused on network analysis and packet inspection.
- Live packet capture using Scapy
- Protocol detection (TCP, UDP, ICMP)
- Top-talker identification
- Bandwidth utilization measurement
- CSV report generation
- Protocol distribution visualization
- Traffic statistics collection
- Linux command-line execution
- Python 3
- Scapy
- Pandas
- Matplotlib
- Kali Linux
network-traffic-analyzer/
│
├── analyzer.py
├── requirements.txt
├── README.md
├── LICENSE
│
├── screenshots/
│ ├── analyzer-running.png
│ ├── protocol-chart.png
│ └── csv-report.png
│
├── output/
├── protocol_chart.png
└── sample_traffic_report.csv
- Scapy captures live packets from the network interface.
- Packets are inspected and categorized by protocol.
- Source IP addresses are tracked to identify the most active hosts.
- Packet sizes are measured to calculate bandwidth usage.
- Results are exported to a CSV file.
- Matplotlib generates protocol distribution charts.
Clone the repository:
git clone https://github.com/YOUR_USERNAME/network-traffic-analyzer.git
cd network-traffic-analyzerCreate a virtual environment:
python3 -m venv venv
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtRun the analyzer with administrator privileges:
sudo python analyzer.pyThe analyzer will:
- Capture network traffic
- Analyze protocols
- Track active hosts
- Measure traffic volume
- Generate reports
- Create visualizations
Monitoring for 60 seconds...
Protocols
Counter({'TCP': 248, 'UDP': 41, 'ICMP': 8})
Top Talkers
192.168.1.100 512
8.8.8.8 133
Total MB: 3.41
- Network Traffic Analysis
- Packet Inspection
- Network Protocols
- Python Programming
- Linux Administration
- Data Analysis
- Data Visualization
- Cybersecurity Fundamentals
- DNS Query Monitoring
- Port Analysis
- Real-Time Dashboard
- PCAP Export Support
- Threat Detection Alerts
- Packet Filtering
- GUI Interface
This project was inspired by the Network Traffic Analyzer project idea from:
https://github.com/CarterPerez-dev/Cybersecurity-Projects
The implementation, testing, documentation, and enhancements in this repository were completed independently as a learning project.
Aisha Banu
Cybersecurity Student | Python | Network Security | Linux