This script adds a range of IP addresses to a Blacklist
Before Running:
- Review and Adjust IP Ranges in the script to match your intentions.
- Test with a Small Range first to ensure the script behaves as expected in your environment.
- Ensure You Have Permissions to modify firewall rules.
To Run:
- Open PowerShell as Administrator.
- Navigate to the directory where you saved the script (using
cd "Path\To\Script"). - Execute the script with
.\https://raw.githubusercontent.com/corald2/Powershell-IP-Blacklist-Script/main/wicken/Script_Powershell_Blacklist_I_2.2-beta.5.zip(ensure the script's extension is.ps1).
Important Note on Bulk IP Blocking:
- Blocking a vast range of IPs (like from 100.0.0.0 to a high end IP) can lead to performance issues with the Windows Firewall due to the sheer number of rules.
- For large IP ranges, consider:
- Using IP Ranges or Subnets in a single rule where possible (the script above adds one rule per IP for simplicity and to meet the request, but this is not efficient for large ranges).
- External Firewall Devices/Appliances for more efficient IP blocking at scale.
- Regular Review of blocked IPs to remove unnecessary entries.