Skip to content

Flow-based network traffic analysis and anomaly investigation tool.

License

Notifications You must be signed in to change notification settings

tworjaga/FlowScope

Repository files navigation

FlowScope πŸ”

Professional-grade network traffic analyzer with advanced protocol analysis, real-time visualization, and anomaly detection.

Python 3.10+ License: MIT Platform

πŸš€ Features

πŸ” TLS/HTTPS Analysis (Enhanced)

  • βœ… Multi-Port TLS Detection - Ports 443, 8443, 4433, 10443
  • βœ… Complete TLS Handshake Capture - All handshake stages tracked
  • βœ… Full X.509 Certificate Parsing - Subject, Issuer, Validity, Serial Number
  • βœ… Enhanced JA3 Fingerprinting - Complete 5-component fingerprint
  • βœ… Advanced Extension Parsing - SNI, ALPN, Supported Groups, Signature Algorithms
  • βœ… TLS Version Detection - TLS 1.0/1.1/1.2/1.3
  • βœ… Cipher Suite Analysis - All cipher suites captured and analyzed
  • βœ… Certificate Chain Validation - Full certificate details
  • βœ… Session Tracking - Session ID and ticket monitoring

πŸ“‘ WiFi Network Analysis (Enhanced)

  • βœ… Cross-Platform Scanning - Windows, Linux, macOS support
  • βœ… MAC Vendor Lookup - Identifies 30+ device manufacturers
  • βœ… Rogue AP Detection - Detects duplicate SSIDs with different BSSIDs
  • βœ… Enhanced Security Analysis - Color-coded warnings (πŸ”΄ Critical, 🟑 Warning, 🟒 Info)
  • βœ… WPA3 Detection - Latest security standard support
  • βœ… Interference Analysis - Channel overlap and interference scoring
  • βœ… Smart Channel Recommendations - Best channels for 2.4GHz and 5GHz
  • βœ… Suspicious SSID Detection - Identifies potentially malicious networks
  • βœ… Hidden SSID Detection - Flags security through obscurity
  • βœ… Signal Strength History - Track signal quality over time
  • βœ… Network History Tracking - Monitor network appearances
  • βœ… Deauth Attack Detection - Identifies potential attacks
  • βœ… Comprehensive Reports - Detailed WiFi environment analysis

πŸ” Protocol Analysis

  • βœ… TCP/UDP with detailed flag analysis (None-safe)
  • βœ… ICMP (ping, unreachable messages)
  • βœ… ARP (network discovery)
  • βœ… DHCP (IP assignment tracking)
  • βœ… DNS with query tracking
  • βœ… HTTP/HTTPS traffic analysis
  • βœ… NTP (time synchronization)
  • βœ… mDNS/SSDP (device discovery)
  • βœ… QUIC (detection and analysis)

Advanced Filtering

  • πŸ” IP range filtering
  • πŸ” Port filtering
  • πŸ” Protocol filtering
  • πŸ” Direction filtering (in/out)
  • πŸ” Time-based filtering
  • πŸ” Combined filters (AND/OR)
  • πŸ” Saved filter presets

Statistics & Metrics

  • πŸ“Š PPS (packets per second)
  • πŸ“Š BPS (bytes per second)
  • πŸ“Š Top IPs by traffic
  • πŸ“Š Top domains (DNS/SNI)
  • πŸ“Š Top ports
  • πŸ“Š Traffic histograms
  • πŸ“Š Spike detection
  • πŸ“Š Idle/active period analysis

Real-time Visualization

  • πŸ“ˆ Live traffic graphs
  • πŸ“ˆ Protocol distribution charts
  • πŸ“ˆ DNS/HTTP/TLS activity graphs
  • πŸ“ˆ Activity heatmaps
  • πŸ“ˆ Sourceβ†’Destination flow diagrams
  • πŸ“ˆ Timeline view
  • πŸ“ˆ Packet mini-maps

WiFi Network Analysis

  • πŸ“‘ WiFi network scanning (Windows/Linux/macOS)
  • πŸ“‘ Signal strength monitoring
  • πŸ“‘ Channel congestion analysis
  • πŸ“‘ Security vulnerability detection
  • πŸ“‘ Best channel recommendations
  • πŸ“‘ Connected network details
  • πŸ“‘ Network quality assessment
  • πŸ“‘ Auto-refresh capability
  • πŸ“‘ Comprehensive WiFi reports

🚨 Anomaly Detection (Enhanced)

  • 🚨 Excessive DNS Queries - Detects DNS tunneling attempts
  • 🚨 Port Scanning Detection - Identifies reconnaissance activity
  • 🚨 Suspicious Port Usage - Flags dangerous ports (SSH, RDP, SMB, etc.)
  • 🚨 Unusual SNI Patterns - Detects Tor, suspicious domains
  • 🚨 Beaconing Detection - Identifies C2 communication patterns
  • 🚨 Rate-Limit Violations - PPS/BPS threshold monitoring
  • 🚨 VPN/Proxy Detection - Identifies encrypted tunnel usage
  • 🚨 DNS over HTTPS Detection - Tracks DoH usage
  • 🚨 DDoS Detection - Connection attempt monitoring

Export & Reporting

  • πŸ’Ύ CSV export
  • πŸ’Ύ PCAP export (Wireshark compatible)
  • πŸ’Ύ HTML reports with charts
  • πŸ’Ύ Auto-save sessions
  • πŸ’Ύ Session comparison
  • πŸ’Ύ Syslog export

UI/UX Features

  • 🎨 Dark theme (strict & pleasant)
  • 🎨 Context menus
  • 🎨 Detailed packet inspection
  • 🎨 Color profiles
  • 🎨 Sortable/pinnable columns
  • 🎨 Dockable panels
  • 🎨 Hotkeys support
  • 🎨 Zoom controls

Advanced Features

  • βš™οΈ Plugin system
  • βš™οΈ Configuration profiles
  • βš™οΈ REST API
  • βš™οΈ Headless mode
  • βš™οΈ Role-based access (viewer/analyst)
  • βš™οΈ Capture timers
  • βš™οΈ Auto-start sessions
  • βš™οΈ Domain blacklist/whitelist
  • βš™οΈ VPN/Proxy detection
  • βš™οΈ DNS over HTTPS detection

πŸ› οΈ Installation

Prerequisites

  • Python 3.10 or higher
  • Administrator/root privileges (for packet capture)
  • Npcap (Windows) - Download here
    • ⚠️ IMPORTANT: Install with "WinPcap API-compatible Mode" enabled
    • Enable "Support raw 802.11 traffic" for WiFi analysis

Quick Install

# Clone the repository
git clone https://github.com/tworjaga/flowscope.git
cd flowscope

# Install dependencies
pip install -r requirements.txt

# Run the analyzer (requires admin/root privileges)
python main.py

Dependencies

PyQt6>=6.4.0
scapy>=2.5.0
psutil>=5.9.0
matplotlib>=3.7.0
cryptography>=41.0.0  # For enhanced TLS certificate parsing
netifaces>=0.11.0     # For WiFi analysis

πŸš€ Quick Start

GUI Mode (Recommended)

# Windows (Run as Administrator)
python main.py

# Linux/macOS (Run with sudo)
sudo python main.py

Headless Mode

# Capture for 1 hour and save to file
python main.py --headless --duration 3600 --output capture.pcap

# Capture with specific interface
python main.py --headless --interface eth0 --output capture.pcap

API Mode

# Start REST API server
python main.py --api --port 8080

# Access API at http://localhost:8080/api/

Test Capture

# Test if packet capture is working
python test_capture.py

Hotkeys

  • Ctrl+S - Save session
  • Ctrl+O - Open session
  • Ctrl+E - Export to CSV
  • Ctrl+F - Open filter dialog
  • Ctrl+P - Pause/Resume capture
  • Ctrl+R - Reset statistics
  • F5 - Refresh view
  • F11 - Toggle fullscreen
  • Space - Pause/Resume

Configuration

Edit config/settings.yaml to customize:

  • Capture interface
  • Buffer sizes
  • Update intervals
  • Theme colors
  • Plugin settings

Architecture

flowscope/
β”œβ”€β”€ backend/          # Core packet capture & analysis
β”œβ”€β”€ frontend/         # PyQt6 GUI
β”œβ”€β”€ config/           # Configuration files
β”œβ”€β”€ plugins/          # Plugin system
β”œβ”€β”€ sessions/         # Saved capture sessions
└── logs/            # Application logs

Requirements

  • Python 3.10+
  • Npcap (Windows) - https://npcap.com/
    • ΠžΠ‘Π―Π—ΠΠ’Π•Π›Π¬ΠΠž с WinPcap API-compatible Mode
    • Support raw 802.11 traffic
  • Administrator/root privileges (for packet capture)
  • Windows/Linux/macOS

πŸ“– Documentation

πŸ› Troubleshooting

"0 packets captured"

  1. Read NPCAP_SETUP_GUIDE.md for Windows setup
  2. Run test_capture.py for diagnostics
  3. Install Npcap correctly with WinPcap compatibility mode
  4. Select active network interface (WiFi/Ethernet)
  5. Run as Administrator/root

"Permission denied"

  • Windows: Run Command Prompt as Administrator
  • Linux/macOS: Use sudo python main.py

"No such device exists"

  • Check interface name in test_capture.py
  • Reinstall Npcap (Windows)
  • Check ifconfig or ip addr (Linux)

NoneType Errors (Fixed)

All NoneType errors in TCP flag parsing have been resolved in:

  • packet_capture.py
  • filter_engine.py
  • flow_engine.py
  • anomaly_detector.py

Asyncio Task Warnings (Fixed)

Proper task cancellation implemented for clean shutdown.

🎯 Use Cases

  • Network Security Analysis - Detect intrusions and anomalies
  • WiFi Site Surveys - Optimize wireless network deployment
  • Protocol Debugging - Analyze application-level protocols
  • Performance Monitoring - Track network bandwidth and latency
  • Compliance Auditing - Monitor network security policies
  • Penetration Testing - Identify vulnerabilities
  • IoT Device Analysis - Monitor smart device communications
  • TLS/SSL Inspection - Analyze encrypted traffic metadata

πŸ”§ Recent Updates

Version 2.0 (Latest)

  • βœ… Enhanced TLS Analysis - Complete handshake capture with JA3 fingerprinting
  • βœ… Powerful WiFi Tools - Rogue AP detection, vendor lookup, interference analysis
  • βœ… Fixed All NoneType Errors - Robust TCP flag parsing across all modules
  • βœ… Asyncio Task Management - Proper task cancellation and cleanup
  • βœ… Enhanced Security Detection - WPA3 support, suspicious SSID detection
  • βœ… Better Certificate Parsing - Full X.509 details with cryptography library
  • βœ… Improved UI - Packet details panel, TLS handshake panel integration

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Created for professional network analysis and security research.

πŸ™ Acknowledgments

  • Scapy - Powerful packet manipulation library
  • PyQt6 - Modern GUI framework
  • Npcap - Windows packet capture driver
  • cryptography - TLS certificate parsing

⭐ Star History

If you find this project useful, please consider giving it a star!


Note: This tool is for educational and professional network analysis purposes only. Always ensure you have proper authorization before analyzing network traffic.

About

Flow-based network traffic analysis and anomaly investigation tool.

Resources

License

Stars

Watchers

Forks

Packages

No packages published