This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
networking:router:mikrotik_blocklist [2017/11/30 09:35] gcooper |
networking:router:mikrotik_blocklist [2024/02/24 14:44] (current) gcooper |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Mikrotik Block Lists ====== | ====== Mikrotik Block Lists ====== | ||
+ | |||
+ | FIXME **New Method**: https:// | ||
+ | |||
+ | **Another way to block ads**: https:// | ||
+ | |||
+ | **Block by Country**: https:// | ||
===== Sources ===== | ===== Sources ===== | ||
Line 23: | Line 29: | ||
* The **DShield list** is small, but up to date. | * The **DShield list** is small, but up to date. | ||
* The **Spamhaus list** is also fairly small and up to date. | * The **Spamhaus list** is also fairly small and up to date. | ||
- | * The **OpenBL default | + | * The **BDE All list** is quite long and will cause the router' |
+ | * The **BDE list** is made up of the most recent attackers and the size of the list can be adjusted by changing the number for ' | ||
+ | * https:// | ||
* The **VoIPBL list** is also quite long (over 12,000 entries) and will cause the router' | * The **VoIPBL list** is also quite long (over 12,000 entries) and will cause the router' | ||
* The **Combined list** is the longest list because it contains unique entries from all the four previous lists. | * The **Combined list** is the longest list because it contains unique entries from all the four previous lists. | ||
Line 33: | Line 41: | ||
=== blocklists4mt.sh === | === blocklists4mt.sh === | ||
- | :!: We use a **7-day timeout** in an attempt at minimizing flash (NAND) writes. | + | :!: We use a **dynamic address-list with a 7-day timeout** in an attempt at eliminating cruft and minimizing flash (NAND) writes. |
- | :!: We use a very crude mechanism to **limit the size of the combined list**. | + | :!: We use a very crude mechanism to **limit the size of the combined list**. |
< | < | ||
#!/bin/sh | #!/bin/sh | ||
- | saveTo=/ | + | saveTo=/ |
now=$(date); | now=$(date); | ||
echo "# Generated by blocklists4mt.sh on $now" > $saveTo/ | echo "# Generated by blocklists4mt.sh on $now" > $saveTo/ | ||
echo "/ip firewall address-list" | echo "/ip firewall address-list" | ||
- | wget -q -O - http:// | + | wget -q -O - https:// |
echo "# Generated by blocklists4mt.sh on $now" > $saveTo/ | echo "# Generated by blocklists4mt.sh on $now" > $saveTo/ | ||
echo "/ip firewall address-list" | echo "/ip firewall address-list" | ||
- | wget -q -O - http:// | + | wget -q -O - https:// |
- | wget -q -O - http:// | + | wget -q -O - http:// |
- | echo "# Generated by blocklists4mt.sh on $now" > $saveTo/openbl.rsc | + | echo "# Generated by blocklists4mt.sh on $now" > $saveTo/bde.rsc |
- | echo "/ip firewall address-list" | + | echo "/ip firewall address-list" |
- | wget -q -O - http://www.openbl.org/lists/ | + | wget -q -O - https://api.blocklist.de/getlast.php? |
echo "# Generated by blocklists4mt.sh on $now" > $saveTo/ | echo "# Generated by blocklists4mt.sh on $now" > $saveTo/ | ||
echo "/ip firewall address-list" | echo "/ip firewall address-list" | ||
- | wget -q -O - http://www.voipbl.org/ | + | wget -q -O - https:// |
+ | |||
+ | # dshield, bde, spamhaus and voipbl lists | ||
+ | |||
+ | #echo "# Generated by blocklists4mt.sh on $now" > $saveTo/ | ||
+ | #echo "# This is a combined blocklist created from unique entries in the" >> $saveTo/ | ||
+ | #echo "# DShield, SpamHaus, BDE and VoIPBL blocklists." | ||
+ | #echo "/ip firewall address-list" | ||
+ | #cat $saveTo/ | ||
+ | |||
+ | # dshield, bde and spamhaus lists | ||
+ | |||
+ | #echo "# Generated by blocklists4mt.sh on $now" > $saveTo/ | ||
+ | #echo "# This is a combined blocklist created from unique entries in the" >> $saveTo/ | ||
+ | #echo "# DShield, SpamHaus and BDE blocklists." | ||
+ | #echo "/ip firewall address-list" | ||
+ | #cat $saveTo/ | ||
+ | |||
+ | # dshield, voipbl and spamhaus lists | ||
echo "# Generated by blocklists4mt.sh on $now" > $saveTo/ | echo "# Generated by blocklists4mt.sh on $now" > $saveTo/ | ||
echo "# This is a combined blocklist created from unique entries in the" >> $saveTo/ | echo "# This is a combined blocklist created from unique entries in the" >> $saveTo/ | ||
- | echo "# DShield, SpamHaus, OpenBL | + | echo "# DShield, SpamHaus and VoIPBL blocklists." |
echo "/ip firewall address-list" | echo "/ip firewall address-list" | ||
- | cat $saveTo/ | + | cat $saveTo/ |
- | </ | + | |
- | ==== Run the Script Daily ==== | + | # dshield and spamhaus lists |
- | Here is one way to configure '' | + | #echo "# Generated by blocklists4mt.sh on $now" > $saveTo/ |
- | + | #echo "# This is a combined blocklist created from unique entries in the" >> $saveTo/ | |
- | <file> | + | #echo "# DShield and SpamHaus blocklists." |
- | chown root.root blocklists4mt.sh | + | #echo "/ip firewall address-list" |
- | chmod +x blocklists4mt.sh | + | #cat $saveTo/ |
- | cp -a blocklists4mt.sh /etc/cron.daily/ | + | |
</ | </ | ||
Line 82: | Line 106: | ||
FIXME Bogons? | FIXME Bogons? | ||
- | :!: At the time of this writing, the first three lists combined added **6,181 items** to the '' | + | :!: At the time of this writing, the combined |
=== DShield === | === DShield === | ||
Line 89: | Line 113: | ||
# Script which will download the DShield drop list as a text file | # Script which will download the DShield drop list as a text file | ||
/system script add name=" | /system script add name=" | ||
- | /tool fetch url=" | + | /tool fetch url=" |
- | :log info " | + | :log info " |
} | } | ||
Line 100: | Line 124: | ||
} | } | ||
} | } | ||
- | /import file-name=dshield.rsc; | ||
:log info " | :log info " | ||
+ | /import file-name=dshield.rsc; | ||
} | } | ||
Line 118: | Line 142: | ||
# Script which will download the Spamhaus drop list as a text file | # Script which will download the Spamhaus drop list as a text file | ||
/system script add name=" | /system script add name=" | ||
- | /tool fetch url=" | + | /tool fetch url=" |
- | :log info " | + | :log info " |
} | } | ||
Line 129: | Line 153: | ||
} | } | ||
} | } | ||
- | /import file-name=spamhaus.rsc; | ||
:log info " | :log info " | ||
+ | /import file-name=spamhaus.rsc; | ||
} | } | ||
Line 142: | Line 166: | ||
</ | </ | ||
- | === OpenBL | + | === BDE === |
< | < | ||
- | # Script which will download the OpenBl | + | # Script which will download the BDE drop list as a text file |
- | /system script add name="Download_openbl" source={ | + | /system script add name="Download_bde" source={ |
- | /tool fetch url=" | + | /tool fetch url=" |
- | :log info " | + | :log info " |
} | } | ||
- | # Script which will Remove old OpenBL | + | # Script which will Remove old BDE list and add new one |
- | /system script add name="Replace_openbl" source={ | + | /system script add name="Replace_bde" source={ |
:foreach i in=[/ip firewall address-list find ] do={ | :foreach i in=[/ip firewall address-list find ] do={ | ||
- | :if ( [/ip firewall address-list get $i comment] = "OpenBL" ) do={ | + | :if ( [/ip firewall address-list get $i comment] = "BDE" ) do={ |
/ip firewall address-list remove $i | /ip firewall address-list remove $i | ||
} | } | ||
} | } | ||
- | /import file-name=openbl.rsc; | + | :log info " |
- | :log info " | + | /import file-name=bde.rsc; |
} | } | ||
- | # Schedule the download and application of the openbl | + | # Schedule the download and application of the BDE list |
- | /system scheduler add comment=" | + | /system scheduler add comment=" |
- | on-event=Download_openbl | + | on-event=Download_bde |
- | /system scheduler add comment=" | + | /system scheduler add comment=" |
- | on-event=Replace_openbl | + | on-event=Replace_bde |
- | /system scheduler add comment=" | + | /system scheduler add comment=" |
- | on-event=Replace_openbl | + | on-event=Replace_bde |
</ | </ | ||
Line 176: | Line 200: | ||
# Script which will download the VoIPBL drop list as a text file | # Script which will download the VoIPBL drop list as a text file | ||
/system script add name=" | /system script add name=" | ||
- | /tool fetch url=" | + | /tool fetch url=" |
- | :log info " | + | :log info " |
} | } | ||
Line 187: | Line 211: | ||
} | } | ||
} | } | ||
- | /import file-name=voipbl.rsc; | ||
:log info " | :log info " | ||
+ | /import file-name=voipbl.rsc; | ||
} | } | ||
Line 207: | Line 231: | ||
# Script which will download the combined drop list as a .rsc script file | # Script which will download the combined drop list as a .rsc script file | ||
/system script add name=" | /system script add name=" | ||
- | /tool fetch url=" | + | /tool fetch url=" |
- | :log info " | + | :log info " |
} | } | ||
Line 220: | Line 244: | ||
/ip firewall address-list remove $i | /ip firewall address-list remove $i | ||
} | } | ||
- | :if ( [/ip firewall address-list get $i comment] = "OpenBL" ) do={ | + | :if ( [/ip firewall address-list get $i comment] = "BDE" ) do={ |
/ip firewall address-list remove $i | /ip firewall address-list remove $i | ||
} | } |