Skip to content

Instantly share code, notes, and snippets.

@yrousse
Created January 30, 2016 15:21
Show Gist options
  • Save yrousse/95a72b4dbbebf12fbf63 to your computer and use it in GitHub Desktop.
Save yrousse/95a72b4dbbebf12fbf63 to your computer and use it in GitHub Desktop.
spamhaus and dshield drop lists to shorewall blrules simple script
#!/bin/sh
echo "#From dshield.org" > /tmp/blacklist
wget -q -O - http://feeds.dshield.org/block.txt | awk '/^[0-9]/ { print "DROP", "net:"$1"/24", "all"}' >> /tmp/blacklist
echo "#From spamhaus.org" >> /tmp/blacklist
wget -q -O - http://www.spamhaus.org/drop/drop.lasso | awk '/^[0-9]/ { print "DROP", "net:"$1, "all"}' >> /tmp/blacklist
mv /tmp/blacklist /etc/shorewall/blrules
shorewall refresh &>/dev/null
@yrousse
Copy link
Author

yrousse commented Jan 30, 2016

Make it executable with chmod +x update_blrules.sh
And have it in a cron job for scheduled updates. For a SoHo firewall, once a day seems enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment