Created
March 21, 2012 17:32
-
-
Save allolex/2149930 to your computer and use it in GitHub Desktop.
A Perl script to find out who to send abuse reports to for a given domain
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Net::DNS; | |
use Net::Abuse::Utils qw( :all ); | |
my $input = shift or die "Domain must be specified at the command line!"; | |
my $res = Net::DNS::Resolver->new; | |
my $query = $res->search("$input"); | |
if ($query) { | |
foreach my $rr ($query->answer) { | |
next unless $rr->type eq "A"; | |
my @contacts = get_ipwi_contacts($rr->address); | |
print join ', ', @contacts; | |
print "\n"; | |
} | |
} | |
else { | |
warn "query failed: ", $res->errorstring, "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment