elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado:


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  [Perl] Proxy Tester 0.5
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Perl] Proxy Tester 0.5  (Leído 1,780 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl] Proxy Tester 0.5
« en: 12 Mayo 2012, 20:51 pm »

Version mejorada de un programa para buscar proxies de forma online para despues verificar el estado de cada uno.

El codigo

Código
  1. #!usr/bin/perl
  2. #Proxy Tester 0.5
  3. #Coded By Doddy H
  4.  
  5. use LWP::UserAgent;
  6.  
  7. my $nave = LWP::UserAgent->new();
  8. $nave->timeout(5);
  9. $nave->agent(
  10. "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
  11. );
  12.  
  13. while (1) {
  14.    head();
  15.    print "\n[+] Option : ";
  16.    chomp( my $op = <stdin> );
  17.  
  18.    if ( $op eq "1" ) {
  19.        print "\n\n[+] File : ";
  20.        chomp( my $file = <stdin> );
  21.        if ( -f $file ) {
  22.            print "\n[+] Opening file ...\n\n";
  23.            open( FILE, $file );
  24.            my @words = <FILE>;
  25.            close FILE;
  26.            my @proxies = repes(@words);
  27.            print "[+] Proxies Found : " . int(@proxies) . "\n";
  28.            print "\n[+] Testing ....\n\n";
  29.            my $cont = "0";
  30.  
  31.            for (@proxies) {
  32.                if ( testnow($_) ) {
  33.                    $cont++;
  34.                    print "\a";    #BEEP
  35.                }
  36.            }
  37.            print "\n[+] Proxies Found : " . $cont . "\n";
  38.            print "\n\n[+] Finished\n\n";
  39.            <stdin>;
  40.        }
  41.        else {
  42.            print "\n\n[-] File not found\n";
  43.            copyright();
  44.        }
  45.    }
  46.  
  47.    if ( $op eq "2" ) {
  48.        print "\n\n[+] Getting proxies ...\n\n";
  49.  
  50.        my @uno    = getproxys();
  51.        my @dos    = getxroxy();
  52.        my @tres   = proxyip();
  53.        my @cuatro = proxylist();
  54.        my @cinco  = proxies();     #big list
  55.  
  56.        my @total = ( @uno, @dos, @tres, @cuatro, @cinco );
  57.  
  58.        print "[+] Proxies Found : " . int(@total) . "\n";
  59.        print "\n[+] Testing .....\n\n";
  60.  
  61.        my $cont = "0";
  62.        for (@total) {
  63.            if ( testnow($_) ) {
  64.                $cont++;
  65.                print "\a";         #BEEP
  66.            }
  67.        }
  68.  
  69.        print "\n[+] Proxies Found : " . $cont . "\n";
  70.        print "\n\n[+] Finished\n\n";
  71.        <stdin>;
  72.    }
  73.  
  74.    if ( $op eq "3" ) {
  75.        copyright();
  76.    }
  77.  
  78. }
  79. copyright();
  80.  
  81. sub testnow {
  82.  
  83.    my $ver = shift;
  84.  
  85.    my $pro;
  86.    my $host;
  87.    my $port;
  88.    my $country;
  89.    my $save;
  90.  
  91.    my $test_proxy = LWP::UserAgent->new();
  92.    $test_proxy->timeout(5);
  93.    $test_proxy->agent(
  94. "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
  95.    );
  96.  
  97.    if ( $ver =~ /(.*):(.*)/ ) {
  98.        ( $host, $port, $country ) = ( $1, $2, "Unknown" );
  99.        $save = $host . ":" . $port;
  100.    }
  101.  
  102.    if ( $ver =~ /(.*):(.*):(.*)/ ) {
  103.        ( $host, $port, $country ) = ( $1, $2, $3 );
  104.        $save = $host . ":" . $port . ":" . $country;
  105.    }
  106.  
  107.    my $pro = $host . ":" . $port;
  108.  
  109.    $test_proxy->proxy( "http", "http://" . $pro );
  110.    my $code = $test_proxy->get("http://www.whatismyip.com/")->content;
  111.  
  112.    if ( $code =~ /Your IP Address Is/ ) {
  113.        print "[+] IP : $host\n";
  114.        print "[+] Port : $port\n";
  115.        print "[+] Country : $country\n\n";
  116.        savefile( "proxy-founds.txt", $save );
  117.        return true;
  118.    }
  119. }
  120.  
  121. sub getproxys {
  122.  
  123.    my @founds;
  124.    my @volver;
  125.  
  126.    for my $num ( 1 .. 5 ) {
  127.        my $code = toma(
  128. "http://www.proxys.com.ar/index.php?act=list&port=&type=&country=&page=$num"
  129.        );
  130.  
  131.        while ( $code =~
  132. /<tr class="cells" onmouseover="this.className='cells2'" onmouseout="this.className='cells'">(.*?)<\/tr>/sig
  133.          )
  134.        {
  135.            my $porcion = $1;
  136.            chomp $porcion;
  137.  
  138.            if ( my @total = $porcion =~ m{<\s*td\s*>\s*(.*?)\s*</\s*td}mig ) {
  139.                push( @founds, $total[1] . ":" . $total[2] . ":" . $total[4] );
  140.            }
  141.        }
  142.    }
  143.  
  144.    my @volver = repes(@founds);
  145.    return @volver;
  146.  
  147. }
  148.  
  149. sub getxroxy {
  150.  
  151.    my @founds_final;
  152.    my @founds;
  153.  
  154.    for my $num ( 0 .. 26 ) {
  155.  
  156.        open( FILE, ">>proxy.txt" );
  157.  
  158.        my $code = toma(
  159. "http://www.xroxy.com/proxylist.php?port=&type=&ssl=&country=&latency=1000&reliability=&sort=reliability&desc=true&pnum=$num"
  160.        );
  161.  
  162.        while ( $code =~
  163.            /proxy:name=XROXY proxy&host=(.*?)&port=(.*?)&notes=(.*?)&/sig )
  164.        {
  165.            my ( $ip, $port, $pais ) = ( $1, $2, $3 );
  166.            $port =~ s/&isSocks=true//sig;
  167.            $port =~ s/&socksversion=4a//sig;
  168.            push( @founds, "$ip:$port:$pais" );
  169.            print FILE "$ip:$port\n";
  170.        }
  171.    }
  172.  
  173.    my @founds_final = repes(@founds);
  174.    return @founds_final;
  175.  
  176. }
  177.  
  178. sub proxies {
  179.  
  180.    my @founds_final;
  181.    my @founds;
  182.  
  183.    for my $i ( 1 .. 10 ) {
  184.  
  185.        my $code =
  186.          toma( "http://proxies.my-proxy.com/proxy-list-" . $i . ".html" );
  187.  
  188.        my @found = $code =~ m/(\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3}:\d+)/g;
  189.  
  190.        for (@found) {
  191.            push( @founds, "$_:Unknown" );
  192.        }
  193.  
  194.    }
  195.  
  196.    my @founds_final = repes(@founds);
  197.    return @founds_final;
  198.  
  199. }
  200.  
  201. sub proxyip {
  202.  
  203.    my @founds_final;
  204.    my @founds;
  205.  
  206.    my $code = toma("http://proxy-ip-list.com/free-usa-proxy-ip.html");
  207.  
  208.    if ( $code =~ /<tbody class="table_body">(.*?)<\/table>/sig ) {
  209.        my $codedos = $1;
  210.  
  211.        while ( $codedos =~
  212. /<tr><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><\/tr>/mig
  213.          )
  214.        {
  215.            my ( $ip, $pais ) = ( $1, $5 );
  216.            push( @founds, "$ip:$pais" );
  217.        }
  218.    }
  219.  
  220.    my @founds_final = repes(@founds);
  221.    return @founds_final;
  222.  
  223. }
  224.  
  225. sub proxylist {
  226.  
  227.    my @founds_final;
  228.    my @founds;
  229.  
  230.    my $code = toma("http://www.proxylist.net/");
  231.  
  232.    while ( $code =~
  233. /<tr><td><a href="(.*?)">(.*?)<\/a><\/td><td><a href="(.*?)">(.*?)<\/a><\/td>/mig
  234.      )
  235.    {
  236.        my ( $ip, $pais ) = ( $2, $4 );
  237.        push( @founds, "$ip:$pais" );
  238.    }
  239.  
  240.    my @founds_final = repes(@founds);
  241.    return @founds_final;
  242.  
  243. }
  244.  
  245. sub head {
  246.    print qq(
  247.  
  248.  
  249. @@@@@                        @@@@@                        
  250. @    @                         @               @          
  251. @    @                         @               @          
  252. @    @ @@  @@@  @  @ @  @      @     @@@   @@  @@  @@@  @@
  253. @@@@@  @  @   @ @  @ @  @      @    @   @ @  @ @  @   @ @
  254. @      @  @   @  @@  @  @      @    @@@@@  @   @  @@@@@ @
  255. @      @  @   @  @@  @  @      @    @       @  @  @     @
  256. @      @  @   @ @  @  @@       @    @   @ @  @ @  @   @ @
  257. @      @   @@@  @  @  @        @     @@@   @@   @  @@@  @
  258.                       @                                  
  259.                     @@                                    
  260.  
  261.  
  262. [++] Options
  263.  
  264. [+] 1 : Load wordlist
  265. [+] 2 : Check Online
  266. [+] 3 : Exit
  267.  
  268. );
  269.  
  270. }
  271.  
  272. sub copyright {
  273.    print "\n\n(C) Doddy Hackman 2012\n\n";
  274.    <stdin>;
  275.    exit(1);
  276. }
  277.  
  278. sub savefile {
  279.    open( SAVE, ">>" . $_[0] );
  280.    print SAVE $_[1] . "\n";
  281.    close SAVE;
  282. }
  283.  
  284. sub repes {
  285.    my @limpio;
  286.    foreach $test (@_) {
  287.        push @limpio, $test unless $repe{$test}++;
  288.    }
  289.    return @limpio;
  290. }
  291.  
  292. sub toma {
  293.    return $nave->get( $_[0] )->content;
  294. }
  295.  
  296. #The End ?
  297.  


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Tester
Electrónica
Yasmesita 2 3,536 Último mensaje 24 Abril 2010, 18:19 pm
por Yasmesita
[Ruby] Proxy Tester
Scripting
BigBear 0 1,783 Último mensaje 16 Octubre 2011, 02:49 am
por BigBear
[Python] Proxy Tester
Scripting
BigBear 0 1,769 Último mensaje 16 Octubre 2011, 02:52 am
por BigBear
[Perl Tk] Proxy Tester 0.5
Scripting
BigBear 0 2,055 Último mensaje 12 Mayo 2012, 20:52 pm
por BigBear
[AYUDA] Tester de password.
Programación Visual Basic
Sink 1 1,576 Último mensaje 19 Junio 2013, 01:03 am
por XresH
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines