#Google Email Harvester 0.3 #Todo:salida con formato, filter=0 #by laramies@gmail.com Edge-security #Christian Martorella #!/usr/bin/perl -w #use strict; use LWP::Simple qw/$ua get/; $domain=$ARGV[0]; $proxy=$ARGV[1]; if (@ARGV <1){ print "Usage: googleharvester.pl domain or googlefinger --help\n"; } else { if($ARGV[0] eq '--help'){ print "\nGoogleHarvester:\n"; print "-----------------\n"; print "\nUsage: googleharvester domain [proxyhost:port]\n"; print "\nwhere:\n"; print "- domain, is the domain where you want to look for accounts (without @)\n"; print "- proxyhost, is the proxy between you and google,\n"; print "- port, where the proxy is listening for connections (eg.8080,8000,4001)\n\n"; print "Example: googleharvester mycompany.com 192.168.1.66:8080\n\n"; } else { $ua = LWP::UserAgent->new(agent => 'Mozilla 5.2'); if ($proxy ne ''){ $ua->proxy(['http'], "http://$proxy"); } my $content = get "http://www.google.com/search?hl=en&ie=UTF-7&oe=UTF-8&sa=N&q=%40$domain"; @links= ($content=~/about [01234567890\,]*<\/b> for/g); #print $links[0]; $num=$links[0]; $num=~ s///g; $num=~ s/<\/b>//g; $num=~ s/about //g; $num=~ s/ for//g; $num=~ s/,//g; $tot=0; for ($i=0;$i < $num;$i=$i +10){ my $content = get "http://www.google.com/search?hl=en&ie=UTF-7&oe=UTF-8&start=$i&sa=N&q=%40$domain"; print "Searching Results $i\n"; if ($content=~/.+repeat the search.+/g) {print "encontre";$i=$num;} else{ $content=~ s/<.*?>//gim; @res= ($content=~/([a-zA-Z0-9_.-]+@($domain))/g); for ($e=0;$e < $#res;$e++){ @total[$tot]=$res[$e]; $tot++; } } } $r=0; @uniq {@total} = (); print "Googleharvester results:\n\n"; foreach $key (keys %uniq) { $r++; print "$key\n"; } print "\nTotal accounts: $r\n"; } }