A real-time traffic monitoring tool that detects and displays network traffic volume per IP address to identify potential DDoS attacks. The tool is built with Python 2.7 using Flask as the backend and a web-based frontend for visualization.
- Real-time Monitoring: Captures network packets and displays the number of packets per IP address.
- Web-based Dashboard: A user-friendly interface accessible via a web browser.
- Interactive Table: Automatically updates every few seconds to reflect live traffic.
- Customizable: Can be extended to add alerts, logs, or more detailed traffic analysis.
- Lightweight: Uses raw sockets for packet capture and a minimal Flask server for serving data.
- Traffic Capture: The tool uses raw sockets to sniff incoming IP packets.
- Data Aggregation: It counts packets per source IP to identify potential spikes in traffic.
- Visualization: Data is served via a Flask API and displayed in an HTML table that auto-updates every 2 seconds using JavaScript.
- Python 2.7
- Flask web framework
- Root/Admin access to capture packets via raw sockets
-
Clone the Repository:
git clone https://github.com/Jenderal92/ddos-traffic-monitor.git cd ddos-traffic-monitor
-
Install Flask:
pip install flask
-
Run the Application (requires root privileges):
sudo python app.py
-
Open your browser and go to:
http://127.0.0.1:5000
DDoS_Traffic_Monitor/
│
├── app.py # Flask backend server
├── monitor.py # Core packet capture and counting logic
├── templates/
│ └── index.html # HTML dashboard
└── static/
├── style.css # Styling for the dashboard
└── script.js # JavaScript for real-time updates
-
Start the tool with:
sudo python app.py
-
Open the browser and access:
http://<server-ip>:<port>
- Replace
<server-ip>
with your server IP address. - Default port is
5000
.
- Replace
-
The dashboard will show:
- Source IP: The IP address sending traffic.
- Packet Count: Number of packets received from each IP.
To display the tool on another website (like Blogger), use an iframe:
<iframe src="http://<your-server-ip>:5000" width="100%" height="600px" frameborder="0"></iframe>
Replace <your-server-ip>
with your server's IP or domain.