The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Blacklist Filters on MikroTik RouterOS

Posted by jpluimers on 2017/09/08

Some blacklist filters you can use on Mikrotik RouterOS devices:

You might consider to use these instead of action=drop:

–jeroen


# Script which will download the SquidBlacklistMalicious list as a text file
/system script add name="Download_SquidBlacklistMalicious" source={
/tool fetch url="http://www.squidblacklist.org/downloads/drop.malicious.rsc" mode=http;
:log info "Downloaded drop.malicious.rsc from squidblacklist.org";
}
# Script which will Remove old SquidBlacklistMalicious list and add new one
/system script add name="Replace_SquidBlacklistMalicious" source={
/system logging disable 0
/ip firewall address-list remove [find where comment="SquidBlacklistMalicious"]
/import file-name=drop.malicious.rsc;
/system logging enable 0
:log info "Removed old SquidBlacklistMalicious records and imported new list";
}
# Schedule the download and application of the SquidBlacklistMalicious list
/system scheduler add comment="Download SquidBlacklistMalicious list" interval=3d \
name="DownloadSquidBlacklistMaliciousList" on-event=Download_SquidBlacklistMalicious \
start-date=jan/01/1970 start-time=04:26:52
/system scheduler add comment="Apply SquidBlacklistMalicious List" interval=3d \
name="InstallSquidBlacklistMaliciousList" on-event=Replace_SquidBlacklistMalicious \
start-date=jan/01/1970 start-time=04:31:52
# Install the firewall rules of the SquidBlacklistMalicious list
/ip firewall filter add chain=input src-address-list=drop.dshield action=drop log=yes log-prefix=drop.dshield
/ip firewall filter add chain=input src-address-list=drop.spamhaus1 action=drop log=yes log-prefix=drop.spamhaus1
/ip firewall filter add chain=input src-address-list=drop.spamhaus2 action=drop log=yes log-prefix=drop.spamhaus2
/ip firewall filter add chain=input dst-address-list=drop.dshield action=drop log=yes log-prefix=drop.dshield
/ip firewall filter add chain=input dst-address-list=drop.spamhaus1 action=drop log=yes log-prefix=drop.spamhaus1
/ip firewall filter add chain=input dst-address-list=drop.spamhaus2 action=drop log=yes log-prefix=drop.spamhaus2

2 Responses to “Blacklist Filters on MikroTik RouterOS”

  1. jpluimers's avatar

    jpluimers said

    Note that Malcode seems to have been less good than it used to be:

    [WayBack] Squidblacklist org:

    That’s really great advice, with the exception that Malc0de is very bad data, poorly maintained and filled will aweful false entries.

    We have taken care of the work and have a free malicious blacklist for RouterOS. http://www.squidblacklist.org/downloads/drop.malicious.rsc

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.