diff options
author | Florian Pritz <bluewind@xssn.at> | 2010-08-08 22:46:49 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xssn.at> | 2010-08-08 22:46:49 +0200 |
commit | d2754512c34a19dad7e489b97fd80bf0bd634089 (patch) | |
tree | 263e282b4c012a09ca95c51d5513eaa5982bb355 /abuse.pl | |
parent | 0170ef29ce9748022bc3437e3b981dcdc60cfd9e (diff) | |
download | bin-d2754512c34a19dad7e489b97fd80bf0bd634089.tar.gz bin-d2754512c34a19dad7e489b97fd80bf0bd634089.tar.xz |
add some crap
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'abuse.pl')
-rwxr-xr-x | abuse.pl | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/abuse.pl b/abuse.pl new file mode 100755 index 0000000..a6ac077 --- /dev/null +++ b/abuse.pl @@ -0,0 +1,29 @@ +#!/usr/bin/perl +use warnings; +use strict; +use File::Basename; +use Net::IP; +use Net::DNS; + +my $abusednsbl = "abuse-contacts.abusix.org"; + +if (@ARGV == 0) { + print "usage: ", basename($0), " IP ...\n"; + exit 1; +} + +my $res = Net::DNS::Resolver->new; + +for my $host (@ARGV) { + my $IP = $host; + + my $ip = new Net::IP ($IP); + my $querystring = $ip->reverse_ip().$abusednsbl; + $querystring =~ s/\.in-addr\.arpa//; + my $query = $res->query($querystring, "txt"); + if ($query) { + print (($query->answer)[0]->rdata, "\n"); + } else { + print "no abuse address for $IP\n"; + } +} |