2010-09-27 22:36:02 -04:00
|
|
|
#!/usr/bin/perl
|
|
|
|
#
|
|
|
|
# Add this to acl.conf.xml
|
|
|
|
#
|
|
|
|
# <X-PRE-PROCESS cmd="exec" data="$${base_dir}/bin/blacklist.pl"/>
|
|
|
|
#
|
|
|
|
|
|
|
|
use Data::Dumper;
|
|
|
|
use LWP::Simple;
|
|
|
|
|
|
|
|
# http://www.infiltrated.net/voipabuse/addresses.txt
|
|
|
|
# http://www.infiltrated.net/voipabuse/netblocks.txt
|
|
|
|
|
|
|
|
|
|
|
|
my @addresses = split(/\n/, get("http://www.infiltrated.net/voipabuse/addresses.txt"));
|
|
|
|
my @netblocks = split(/\n/, get("http://www.infiltrated.net/voipabuse/netblocks.txt"));
|
|
|
|
|
2010-09-27 22:43:02 -04:00
|
|
|
print "<list name=\"voip-abuse-addresses\" default=\"deny\">\n";
|
2010-09-27 22:36:02 -04:00
|
|
|
foreach $addr (@addresses) {
|
2010-11-19 14:42:15 -05:00
|
|
|
$addr =~ s/\s//g; # strip whitespace
|
|
|
|
next unless $addr =~ m/\d+\.\d+\.\d+\.\d+/; # imperfect but useful IP addr check
|
2010-11-19 13:54:39 -05:00
|
|
|
print " <node type=\"allow\" cidr=\"$addr/32\"/>\n";
|
2010-09-27 22:36:02 -04:00
|
|
|
}
|
|
|
|
print "</list>\n";
|
|
|
|
|
|
|
|
|
2010-09-27 22:43:02 -04:00
|
|
|
print "<list name=\"voip-abuse-netblocks\" default=\"deny\">\n";
|
2010-09-27 22:36:02 -04:00
|
|
|
foreach $netb (@netblocks) {
|
2010-11-19 14:42:15 -05:00
|
|
|
$netb =~ s/\s//g; # strip whitespace
|
|
|
|
next unless $netb =~ m/\d+\.\d+\.\d+\.\d+/; # imperfect but useful IP addr check
|
2010-11-19 13:54:39 -05:00
|
|
|
print " <node type=\"allow\" cidr=\"$netb\"/>\n";
|
2010-09-27 22:36:02 -04:00
|
|
|
}
|
|
|
|
print "</list>\n";
|