Skip to content

Instantly share code, notes, and snippets.

@allolex
Created March 21, 2012 17:32
Show Gist options
  • Save allolex/2149930 to your computer and use it in GitHub Desktop.
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
#!/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