#!/usr/bin/perl -w
use Net::Nslookup;
use strict;
my @rbl=qw/l2.apews.org b.barracudacentral.org bl.spamcop.net cblplus.anti-spam.org.cn dnsbl.njabl.org dnsbl.sorbs.net rbl.anti-spam.cn sbl-xbl.spamhaus.org zen.spamhaus.org /;
print "please input the IP:";
chomp(my $IP = <STDIN>);
my @IP = split /\W/,$IP;
@IP = reverse @IP;
my $PI = join ".",@IP;
#my $PI="$IP[3].$IP[2].$IP[1].$IP[0]";
foreach my $rbl (@rbl) {
my $host=($PI.".$rbl");
print "Looking up ",$rbl,"\n";
my $addr = nslookup(host=>$host,type=>"A");
if($addr){
print "*_*!*_*!*_*!In the blacklist $rbl*_*!*_*!*_*!\n";
$addr= "";
}
#else {print "$IP is not in the RBL.\n"}
}
原文出自:
http://blog.too2.net/?p=206
转载请注明转自:辛碌力成【http://blog.too2.net】
发表评论