https://github.com/waymondrang/fwg
Windows command line tool to block outbound connections for files within a directory.
https://github.com/waymondrang/fwg
cli firewall powershell
Last synced: 28 days ago
JSON representation
Windows command line tool to block outbound connections for files within a directory.
- Host: GitHub
- URL: https://github.com/waymondrang/fwg
- Owner: waymondrang
- Created: 2022-07-09T07:40:14.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-27T03:57:45.000Z (almost 4 years ago)
- Last Synced: 2025-10-26T00:47:21.532Z (7 months ago)
- Topics: cli, firewall, powershell
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/fwg
- Size: 9.77 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Code of conduct: code_of_conduct.md
- Security: security.md
Awesome Lists containing this project
README
# fwg
A Windows command line tool to block outbound connections for files within a directory.
fwg utilizes the power of PowerShell and Windows Network Shell to bulk create firewall rules for a specified folder and targeted files.
## Features
- Bulk generate firewall rules for executables
- Target specific files with wildcard support
- Remove generated firewall rules
## Installation
To use fwg in the terminal, install with the `-g` option
```console
npm install -g fwg
```
#### Unauthorized Access Error
If Powershell scripts are disabled on the system, running fwg may invoke an UnauthorizedAccess error. To modify the execution policy, run in PowerShell
```console
Set-ExecutionPolicy -ExecutionPolicy Bypass
```
To reset the execution policy, run in PowerShell
```console
Set-ExecutionPolicy -ExecutionPolicy Default
```
## Usage
_Command must be run with administrator privileges!_
```console
fwg TARGET-DIRECTORY [-l -r] FILE-TARGETS...
```
`*.exe` executables are selected by default. User-provided file targets will override this selector.
**Options**
_Options must be typed separately_
`-r`
Remove generated firewall rules (if exists)
`-l`
Saves output to a new log file in `%INSTALLATION_DIRECTORY%/logs/`
## Examples
This command would block all outbound connections from executables and installers within the user's downloads folder and generate a log file.
```console
fwg ~/Downloads -l *.exe *.msi *.msp
```
fwg also works with relative paths. This command will run fwg in the current directory of the console and block executables (set by default).
```console
fwg ./
```
This command will remove generated firewall rules for any executable matching the pattern `*Launcher.exe` in the user's Documents folder.
```console
fwg ~/Documents -r *Launcher.exe
```