sábado, 1 de marzo de 2014

Exploit-DB download Tool

Saludos a todos, después de algún tiempo de descanso hemos vuelto con esta tool la cual nos descarga todos los Papers  de la pagina http://www.exploit-db.com/ que se encuentren en pdf, espero que sea de ayuda y de aprendizaje para algunos.

a continuación la tool:

Download :http://www.linkbucks.com/ac78fa6f

o copien y peguen ;)


#!/usr/bin/perl


use LWP::UserAgent;
use Term::ANSIColor;


my $ua = LWP::UserAgent->new;

$ua->timeout(1);
$ua->agent('Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20140205 Firefox/24.0 Iceweasel/24.3.0');

sub timeac{
     ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime(time);
     $time = "[ $hour:$min:$sec ] : ";
     print  (color(" bold green"),$time,color("reset"));
}

sub eliminar_repetidos{
    foreach my $parte ( @_ ) {
        next if $ya_visto{ $parte }++;
            push @revisado, $parte." ";
     }
    return @revisado;
}

sub extractLink{
    my($html) = @_;
    $html =~s/\n/::/g;
    my @info = split("::",$html);
    my @nlink=();

    foreach $line(@info){
        $line =~m/(<a href=")(.*)(">)(.*)<\/a>/g;
        $lpdf = $2;
        $title= $4;
        $pos  = index($lpdf,".pdf")    ;
        if($pos>0){
            push(@nlink,$lpdf."::$title");
          

        }
    }
    my @ninfo = eliminar_repetidos(@nlink);
    return @ninfo;
  
}

sub header{
    $header .="
____ _  _ ___  _    ____ _ ___    ___  ___     ___  ____ _ _ _ _  _ _    ____ ____ ___  ____ ____
|___  \/  |__] |    |  | |  |  __ |  \ |__]    |  \ |  | | | | |\ | |    |  | |__| |  \ |___ |__/
|___ _/\_ |    |___ |__| |  |     |__/ |__]    |__/ |__| |_|_| | \| |___ |__| |  | |__/ |___ |  \
                                                                                                
TrackMaze -2014
http://trackmaze.blogspot.com

    \n\n";
}

my @linksa;
my @nlinks;
system("clear");
print header();
for (my $i = 1; $i <= 42 ; $i++) {
  

    $url = "http://www.exploit-db.com/papers/?pg=$i";
    timeac(); print "Inicio Recoleccion Info \n";
    timeac(); print "Realizando peticion Get $url\n";
  
    $response = $ua->get($url);
    $html  = $response->decoded_content();
  
    timeac(); print "Guardando Links \n";
    @linksa = extractLink($html);
    $html ="";
    binmode STDOUT, ":utf8";

  
}

print "-Total Files :".$#linksa;
timeac(); print "Empezando Download de Archivos\n";
foreach $linef (@linksa){
        $postit     = index($linef,"::");
        $long       = length($linef);
        $file       = substr($linef,0,$postit);
        $titulo     = substr($linef,$postit+2,$long);
        $post       = index($titulo,"\]");
        $ntitulo     = substr($titulo,$post+1,$long);
      
        if($post>0){$tit = $ntitulo;}else{$tit = $titulo;}

        $tit=~s/ //g;
        $tit=~s/-//g;
        $tit=~s/,//g;
        $tit=~s/;//g;
        $tit=~s/&amp//g;
        $tit=~s/\(//g;
        $tit=~s/\)//g;
      
        timeac(); print "Descargando $tit.pdf \n";
        $wget = qx(wget -O ./pdf/$tit.pdf $file --no-verbose);
        print "\n";
}
print "\n";
timeac(); print "Done \n";





saludos


No hay comentarios:

Publicar un comentario