NetSentinel is a Python-based tool we built as a group project during the fourth semester of our college to explore Windows firewall management and network traffic monitoring. It’s a learning project to understand how firewalls work, not a production-ready solution. It lets you manage firewall rules and monitor network packets through a basic interactive dashboard.
- Manage Firewall Rules: Add, edit, remove, or search rules to block apps or specific IPs/ports using Windows firewall via PowerShell.
- Real-Time Packet Sniffing: Monitor network traffic (TCP, UDP, ICMP, ARP) and map packets to running applications.
- Interactive Dashboard: View logs and packets live, with simple key-based controls (e.g., '1' to list rules, '8' to toggle sniffing).
- Persistent Rules: Store rules in a JSON file for easy reuse.
- Simple CLI: Use command-line flags (e.g.,
--add,--list) for quick rule management.
-
Install Dependencies:
pip install scapy psutil rich
-
Run the Program:
- Launch the dashboard:
python main.py - Use CLI commands:
python main.py --add,python main.py --list, etc.
- Launch the dashboard:
-
Dashboard Controls:
1: List rules2: Add a rule3: Remove a rule4: Edit a rule5: Search rules6: Apply rules7: Clear all rules0: Exit
- Python 3.8+
- Windows OS (due to
msvcrtand PowerShell integration) - Libraries:
scapy,psutil,rich - Admin privileges required (open terminal in administrator mode)
main.py: Entry point for CLI and dashboard.dashboard.py: Interactive terminal dashboard.firewall.py: Handles Windows firewall rule application.rule_engine.py: Manages rule creation, editing, and searching.rules_database.py: Loads/saves rules torules.json.utils.py: Helper functions for packet processing.admin.py: Checks for admin privileges.config.py: Sets up logging and global variables.