Build a script that captures live network traffic and analyzes it in real-time for suspicious patterns. The goal is to act like a simplified IDS (Intrusion Detection System). The script should classify traffic into normal vs suspicious based on basic heuristics.
Expected Behavior
- Input: a network interface (e.g.,
eth0)
- Process:
- Capture packets live using a library like
scapy
- Parse packet headers (IP, TCP, UDP, HTTP if possible)
- Detect anomalies such as:
- Unusually high request rate from a single IP
- Access to uncommon ports
- Suspicious payload signatures (SQL error strings, XSS tags)
- Print alerts in real-time to the terminal
- Output: live dashboard in the console with detected anomalies
- Handle high traffic gracefully without crashing
Example Usage
python ravenwatch.py -i eth0