Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -w
- ## Perl script interfaces with robtex.com to gather reverse IP data
- ##Will accept domain/IP as input
- ## usage
- ## ./robtex.pl google.com
- ## Updated on 10/14/2010
- use LWP::Simple;
- use LWP::UserAgent;
- use Data::Dumper;
- my $input = $ARGV[0];
- my $url ='http://www.robtex.com/ip/';
- my $ua = new LWP::UserAgent;
- $ua->agent("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1");
- my $ns = "/usr/bin/nslookup";
- if ($input =~ m/([\d\.]{7,})/){
- my $req = new HTTP::Request GET => ($url.$input.'.rss');
- my $res = $ua->request($req);
- my $robtex = $res->content;
- print "\n\n"."Fetching Domains for"."\n".$input."\n\n";
- if (defined $robtex){
- if ($robtex =~ m/\<span\sid\=\"sharedha\"\>Host\snames\ssharing\sIP\swith\sA\srecords\s(\(.*?\))\<\/span\>/g){
- print "Host names sharing IP with A records $1\n\n";
- }
- if ($robtex =~ m/<span\s+id\=\"sharedha\">(.*?)\<\/div\>/ism ) {
- $sharedDomains = $1;
- while($sharedDomains =~ m/<a\s+href\=\"\/dns\/.*?\.html\#shared\"\s+>(.*?)<\/a>/ig ){
- print $1."\n";
- }
- }
- }
- }
- elsif ($input !~ m/([\d\.]{7,})/){
- $ns .= " " . $input;
- $rs = `$ns`;
- if ($rs =~ m/Address\:\s+([\d\.]{7,})\s/){
- print "\n$input resolves to $1\n\n";
- my $req = new HTTP::Request GET => ($url.$1.'.rss');
- my $res = $ua->request($req);
- my $robtex = $res->content;
- if (defined $robtex){
- if ($robtex =~ m/\<span\sid\=\"sharedha\"\>Host\snames\ssharing\sIP\swith\sA\srecords\s(\(.*?\))\<\/span\>/g){
- print "Host names sharing IP with A records $1\n\n";
- }
- if ($robtex =~ m/\<span\s+id\=\"sharedha\"\>(.*?)\<\/div\>/ism ) {
- $sharedDomains = $1;
- while($sharedDomains =~ m/<a\s+href\=\"\/dns\/.*?\.html\#shared\"\s+>(.*?)<\/a>/ig ){
- print $1."\n";
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement