Skip to content

Commit 152f010

Browse files
feat: address maintainer feedback for Windows support
1 parent 09b9a7c commit 152f010

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,36 @@ This firewall uses a **threshold-based detection approach**:
6868
python3 test_attacks.py 127.0.0.1
6969
```
7070

71+
## 🏃 Running on Windows
72+
73+
This program uses `netsh` to manage firewall rules, which requires administrative privileges.
74+
75+
1. **Open as Administrator:** Right-click on **Command Prompt** or **Windows PowerShell** and select **"Run as administrator"**.
76+
77+
2. **Navigate to Folder:** Change to the project directory:
78+
```sh
79+
cd path\to\simple_firewall
80+
```
81+
82+
3. **(Optional) Activate Virtual Environment:** If you use a virtual environment:
83+
```sh
84+
.\venv\Scripts\activate
85+
```
86+
87+
4. **Install Requirements:** Install the main requirements and the Windows-specific ones:
88+
```sh
89+
pip install -r requirements.txt
90+
pip install -r requirements-windows.txt
91+
```
92+
93+
5. **Run the Program:**
94+
```sh
95+
python main.py -i "Your Interface Name"
96+
97+
# Example:
98+
python main.py -i "Ethernet"
99+
```
100+
71101
## Usage
72102

73103
### Basic Commands

requirements-windows.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file lists Python packages required *only* for running
2+
# this project on Windows, which are not in the main requirements.txt.
3+
4+
# psutil (used for Windows-specific interface detection) is
5+
# already listed in the main requirements.txt as a core
6+
# dependency for all platforms.
7+
8+
# Future Windows-only dependencies can be added here.

src/network/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _get_default_interface(self) -> str:
3434
for n in names:
3535
if 'wi' in n.lower() or 'wifi' in n.lower() or 'wi-fi' in n.lower():
3636
return n
37-
return names[0] if names else ''
37+
return names[0] if names else 'Ethernet'
3838
else:
3939
interfaces = netifaces.interfaces()
4040

0 commit comments

Comments
 (0)