Skip to content

PapaPeskwo/block-malicious-IP-addresses

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Botnet Blocklist

This script adds an outbound block rule to your windows firewall. It uses the feodo tracker list that gets updated every 5 minutes.

How-to

Powershell needs to be run as admin:

py ip_blocker.py

Use-case

This can be added as a Schedueled task on your Windows PC to periodically update your firewall settings.

Blocking inbound traffic

You can also add this rule to the code to block inbound traffic:

...
if ip != "dst_ip":
        print("Added Outbound Rule to block:", ip)
        outbound_rule = "netsh advfirewall firewall add rule name='BadIP' Dir=Out Action=Block RemoteIP=" + ip
        subprocess.run(["Powershell", "-Command", outbound_rule])
        
        print("Added Inbound Rule to block:", ip)
        inbound_rule = "netsh advfirewall firewall add rule name='BadIP' Dir=In Action=Block RemoteIP=" + ip
        subprocess.run(["Powershell", "-Command", inbound_rule])

Credits

About

Malicious IP blocker for Windows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages