I wanted to share a bash script I use to generate a daily blacklist file. The script is written in bash and should be fairly fault-tolerant. Just give the file executable permissions, and call it from a cron job. In my case, I like to use the DShield.org blocklist (may not be safe for all cases), and the Spamhaus DROP list (should always be safe to use), but other blocklists could easily be added. The script itself uses wget to grab the appropriate lists, then performs some simple parsing with grep and awk. Lines 21 and 22 are the actual calls to the getFile function to grab each list. GetFile requires two parameters passed to it -- the address where wget can download the file from, and an awk statement (escaping any " and $ symbols) to output the listed addresses in the format "0.0.0.0/0". If there are any errors downloading the files, blacklist will not be updated. The final file will contain a timestamp, and comments denoting the start of the addresses for each file. On a successful update of the blacklist file, shorewall will be refreshed to get the updated information. I would be interested to hear of any other suitable blocklists that could be included for this purpose. ------------------------------------------------------------------------------ Get your Android app more play: Bring it to the BlackBerry PlayBook in minutes. BlackBerry App World™ now supports Android™ Apps for the BlackBerry® PlayBook™. Discover just how easy and simple it is! http://p.sf.net/sfu/android-dev2dev
On Sat, 29 Oct 2011 22:24:29 -0600 Jeff Taylor <shdwdrgn@sourpuss.net> wrote:> I wanted to share a bash script I use to generate a daily blacklist > <snip> > I would be interested to hear of any other suitable blocklists that > could be included for this purpose. >You might find this interesting: http://forums.gentoo.org/viewtopic-t-899276-start-3.html ------------------------------------------------------------------------------ RSA® Conference 2012 Save $700 by Nov 18 Register now! http://p.sf.net/sfu/rsa-sfdev2dev1
Yep, good stuff. I didn''t assume I would have been the first to write such a script, but I hadn''t seen mention of it on the list and thought I would throw it out there. On 11/01/2011 09:30 PM, John Brendler wrote:> On Sat, 29 Oct 2011 22:24:29 -0600 > Jeff Taylor<shdwdrgn@sourpuss.net> wrote: > >> I wanted to share a bash script I use to generate a daily blacklist >> <snip> >> I would be interested to hear of any other suitable blocklists that >> could be included for this purpose. >> > You might find this interesting: > http://forums.gentoo.org/viewtopic-t-899276-start-3.html > > > > ------------------------------------------------------------------------------ > RSA® Conference 2012 > Save $700 by Nov 18 > Register now! > http://p.sf.net/sfu/rsa-sfdev2dev1 > > > _______________________________________________ > Shorewall-users mailing list > Shorewall-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/shorewall-users------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1