Created
March 14, 2022 18:21
-
-
Save imesut/bc6db0448a81122e9e6687cd6dae6f6b to your computer and use it in GitHub Desktop.
This script blocks the incoming and outcoming network traffic for the exe files in the runned script or subfolders. Should be runned as administrator.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Thanks to https://security.stackexchange.com/a/87516/275653 | |
@ setlocal enableextensions | |
@ cd /d "%~dp0" | |
for /R %%a in (*.exe) do ( | |
netsh advfirewall firewall add rule name="Blocked with Batchfile %%a" dir=out program="%%a" action=block enable=yes profile=any | |
netsh advfirewall firewall add rule name="Blocked with Batchfile %%a" dir=in program="%%a" action=block enable=yes profile=any | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment