#!/usr/bin/perl -w
# a simple script to sort out the
# websites passed back to you
# when using their reverse ip
# tool to make it so it gives you
# direct links to the websites to
# make your life a little easier
#
use strict;
use LWP::UserAgent;
use HTTP::Headers;
use Getopt::Long;
my ( $ip, $data, $output, $http, $i );
my $options = { i => \$ip, o => \$output };
GetOptions( $options, "i=s", "o:s" );
my $nextPage = 1;
my $currPage = 1;
&usage unless $ip;
do{
if ( $ip =~ /[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}.*/ ) {
$http = LWP::UserAgent->new() or die;
$http->agent(
"Mozilla/5.0 (Windows; U; Windows NT 5.1; us-EN; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.1"
);
$data = $http->get("http://whois.webhosting.info/$ip?pi=$currPage&ob=SLD&oo=ASC");
if ( $data->is_success ) {
my $html = $data->content;
my @matches = $html =~ /whois.webhosting.info\/(.*)\."/g;
if( !@matches ){
print "PAGE NOT FOUND STUPID FUCK INVALID I.P OR SITE NOW REQUIRES KEY\n";
$nextPage = 0;
}
else{
foreach my $parse (@matches) {
if( @matches ){
print "$parse\n";
}
}
}
}
}
$currPage++;
}while ($nextPage == 1);
sub usage {
print "whois.webhosting.info reverse ip parser\n";
print "usage: perl $0 -io\n\n";
print " -i\t\tip to run a reverse ip lookup on\n";
print " -o\t\tfile to output the results to (default: reverse.html\n";
exit;
}