Brian West 2010-09-27 21:36:02 -05:00
parent fa711796a8
commit b6a81ba7fd
2 changed files with 55 additions and 0 deletions

29
scripts/perl/blacklist.pl Executable file
View File

@ -0,0 +1,29 @@
#!/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"));
print "<list name=\"voip-abuse-addresses\" default=\"allow\">\n";
foreach $addr (@addresses) {
print " <node type=\"deny\" cidr=\"$addr/32\"/>\n";
}
print "</list>\n";
print "<list name=\"voip-abuse-netblocks\" default=\"allow\">\n";
foreach $netb (@netblocks) {
print " <node type=\"deny\" cidr=\"$netb\"/>\n";
}
print "</list>\n";

26
scripts/perl/honeypot.pl Executable file
View File

@ -0,0 +1,26 @@
#!/usr/bin/perl
#
# Add this to conf/dialplan/public but only if you wish to setup a honeypot.
#
# <X-PRE-PROCESS cmd="exec" data="$${base_dir}/bin/honeypot.pl"/>
#
use Data::Dumper;
use LWP::Simple;
# http://www.infiltrated.net/voipabuse/numberscalled.txt
my @numberscalled = split(/\n/, get("http://www.infiltrated.net/voipabuse/numberscalled.txt"));
foreach $number (@numberscalled) {
my ($num,$ts) = split(/\t/, $number);
print "<extension name=\"$num\">\n";
print " <condition field=\"destination_number\" expression=\"^$num\$\">\n";
print " <action application=\"answer\"/>\n";
print " <action application=\"sleep\" data=\"30000\"/>\n";
print " </condition>\n";
print "</extension>\n";
}