- Un archivo de texto cualquiera
- Una pagina
- Usando un dork en google para scanear todas las paginas encontradas con el dork
- Lo mismo que el anterior pero en bing
El codigo.
Código
#!usr/bin/perl #Email Extractor 0.2 #(C) Doddy Hackman 2013 #Credits : Regex based on #http://stackoverflow.com/questions/15710275/print-email-addresses-to-a-file-in-perl #Thanks to motherconfessor & amon use LWP::UserAgent; use URI::Escape; my $nave = LWP::UserAgent->new; $nave->agent( "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12" ); $nave->timeout(10); my $buscador = qr/[A-Z0-9._%+-]+\@[A-Z0-9.-]+\.[A-Z]{2,4}/i ; # Thanks to motherconfessor & amon my @emails; head(); if ( $ARGV[0] eq "-file" ) { if ( -f $ARGV[1] ) { my $code = openfile( $ARGV[1] ); while ( $code =~ /($buscador)/g ) { my $email = $1; } my @emails = repes(@emails); for (@emails) { savefile( $ARGV[2], $_ ); } } else { } } elsif ( $ARGV[0] eq "-google" ) { my @links = google( $ARGV[1], $ARGV[2] ); for my $ink (@links) { my $code = toma($ink); while ( $code =~ /($buscador)/g ) { my $email = $1; } } my @emails = repes(@emails); for (@emails) { savefile( $ARGV[2], $_ ); } } elsif ( $ARGV[0] eq "-bing" ) { my @links = bing( $ARGV[1], $ARGV[2] ); for my $ink (@links) { my $code = toma($ink); while ( $code =~ /($buscador)/g ) { my $email = $1; } } my @emails = repes(@emails); for (@emails) { savefile( $ARGV[3], $_ ); } } elsif ( $ARGV[0] eq "-page" ) { my $code = toma( $ARGV[1] ); while ( $code =~ /($buscador)/g ) { my $email = $1; } my @emails = repes(@emails); for (@emails) { savefile( $ARGV[2], $_ ); } } else { sintax(); } copyright(); # Functions sub bing { my ( $a, $b ) = @_; for ( $pages = 10 ; $pages <= $b ; $pages = $pages + 10 ) { my $code = toma( "http://www.bing.com/search?q=" . $a . "&first=" . $pages ); while ( $code =~ /<h3><a href="(.*?)"/mig ) { } } my @founds = repes( cortar(@founds) ); } sub google { my ( $a, $b ) = @_; my @founds; for ( $pages = 10 ; $pages <= $b ; $pages = $pages + 10 ) { $code = toma( "http://www.google.com.ar/search?hl=&q=" . $a . "&start=$pages" ); while ( $code =~ /(?<="r"><. href=")(.+?)"/mig ) { my $url = $1; if ( $url =~ /\/url\?q\=(.*?)\&\;/ ) { } } } my @founds = repes( cortar(@founds) ); } sub cortar { my @nuevo; for (@_) { if ( $_ =~ /=/ ) { } else { } } } sub toma { } sub savefile { if ( $_[0] eq "" ) { } else { } close SAVE; } sub openfile { } sub repes { my @limpio; foreach $test (@_) { } } sub sintax { } sub head { } sub copyright { } #The End ?
Mostraria un ejemplo de uso pero puedo tener problemas cuando el script devuelve como 500 mails ajenos claramente para spam xD.