Personal Firewall & Network Monitor for Windows
PyFirewall is a Windows desktop application for monitoring / filtering network connections by creating Windows Defender Firewall rules. It monitors and configures both incoming and outgoing connections using process and IP/domain specific rules. It uses Tkinter for the interface, Scapy for packet capture, psutil for process and network information, and supports application and global IP/domain rules.
- Live network connection monitoring
- Auto-Block Protection
- Per-application allow/block rules
- Global IP/domain & local/remote port specific rules
- IPv4 and IPv6 address, CIDR, and inclusive IP range support
- Connection-rate and upload-threshold alerts
- CSV export for connection data
- JSON export/import for managed firewall rules
- System-tray support and automatic start at Windows login
- Dark/light theme support
- Startup update checks and a manual Check for Updates button
- Windows 10 or Windows 11
- Administrator privileges
- Python 3.8+ w/ Tkinter / psutil / scapy
- Npcap
- Download and unpack the latest PyFirewall.zip from here.
- Keep the project files in the same directory.
- Right-click
Install-PyFirewall.cmdand select Run as administrator. - Follow the prompts for any required components and startup options.
- Complete the Npcap installer manually if it appears.
- PyFirewall will launch after installation.
Manually find / download / install Python 3.8+ with Tcl/Tk and pip, Npcap. Manually download the PyFirewall.zip, unpack it. Then run the following 2 commands (cmd/ps as admin) while in the unpacked directory:
python -m pip install -r requirements.txtpython firewall_monitor.py
The main window can be closed but will remain in the system tray. Use Close from the tray menu to fully exit the application. The Settings tab controls alert thresholds, Auto-Block Protection, the connection/alert history limit, the UI theme, (auto) update checking, export / import rules, reset to defaults and uninstall option. When a threshold is exceeded, the connection is recorded in Alerts, triggering Auto-Block prompting, used for applications that pass the threshold (assuming they do not already have an application rule allowing or blocking it). Enabling Filter All Connections will set the threshold to 1, allowing you to live filter any new requests. Double-click a connection in Live Monitor or Alerts to edit its highest-priority applied rule. Double-click a rule in Managed Rules to edit that rule. Global rules accept comma-separated domains, IP addresses, CIDRs, and ranges such as example.com, 192.168.1.1, 192.168.0.6-192.168.0.110. Targets submitted together become one Managed Rules entry; existing independent rules stay separate. Right-click selected connections to use Copy IP Domain or Copy Details for every selected row. Managed Rules offers the same copy actions; application-only rules have no remote IP/domain to copy. Windows Firewall opens the Advanced Security console (wf.msc); select Outbound Rules in its left pane.
| Setting | Default |
|---|---|
| Filter All Connections | Enabled |
| Connection threshold | 50 |
| Time window | 5 seconds |
| Upload threshold | 50 MB |
| Max Connections / Alerts | 250 |
| Alerts | Enabled |
| Auto-Block Protection | Enabled |
| Keep Notification in Foreground | Enabled |
| Dark theme | Enabled |
| Check for updates on startup | Enabled |
Install-PyFirewall.cmd- administrator installer launcherUninstall-PyFirewall.cmd- interactive uninstallerfirewall_monitor.py- launch entry point, administrator elevation, and single-instance guardapp.py- main window, shared state, startup, and UI event loopwidgets.py- themes, button feedback, tooltips, custom menus, and table interactionstray.py- native Windows system-tray icon and menufirewall.py- firewall commands, rule transactions, verification, and profile recoverysettings.py- settings persistence/UI, defaults, and support dialogsmonitoring.py- packet capture, process attribution, DNS, and traffic accountingauto_block.py- temporary holds, cancellation, and Auto-Block decisionsviews.py- connection/rule/alert views, context actions, and import/exportupdates.py- release checking and update promptsconstants.py- shared defaults, version, and resource pathshelpers.py- normalization, formatting, and error diagnosticsrequirements.txt- Python dependenciesrequirements.ps1- automated prerequisite/setup scriptPyFirewall.ico- application and system-tray icon
PyFirewall stores its configuration in firewall_config.json beside the application.
If double clicking the shortcut on the desktop does not open PyFirewall, right click the shortcut and select "Run as Administrator". For missing live traffic, verify that Npcap is installed and running and that PyFirewall is running with Administrator privileges. For unexpected errors, check firewall_monitor_errors.log beside the application for diagnostic details.
Run Uninstall-PyFirewall.cmd as administrator and answer each prompt with Y or N.
The uninstaller will prompt you to remove:
- PyFirewall-managed firewall rules
- Saved Windows Firewall profile settings
- The scheduled task
- Desktop shortcuts
- Python and packages
- Npcap
The installer records which Python components were installed by PyFirewall, preventing any 3rd party dependency issues.
Venmo | Bitcoin: 31uHLpioo1TbxAmo9kM7rrKcLz3wvcoZaL