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

 

 


Tema destacado: Rompecabezas de Bitcoin, Medio millón USD en premios


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


Desconectado Desconectado

Mensajes: 545



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

Version Tk de un programa para buscar proxies de forma online.

Una imagen



El codigo

Código
  1. #!usr/bin/perl
  2. #Proxy Tester 0.5
  3. #Version Tk
  4. #Coded By Doddy H
  5.  
  6. use Cwd;
  7. use Tk;
  8. use Tk::FileSelect;
  9. use Tk::Dialog;
  10. use LWP::UserAgent;
  11.  
  12. my $nave = LWP::UserAgent->new();
  13. $nave->timeout(5);
  14. $nave->agent(
  15. "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
  16. );
  17.  
  18. #if ($^O eq 'MSWin32') {
  19. #use Win32::Console;
  20. #Win32::Console::Free();
  21. #}
  22.  
  23. my $color_texto = "green";
  24. my $color_fondo = "black";
  25.  
  26. my $newd =
  27.  MainWindow->new( -background => $color_fondo, -foreground => $color_texto );
  28.  
  29. $newd->title("Proxy Tester 0.5");
  30. $newd->geometry("370x250+50+50");
  31. $newd->resizable( 0, 0 );
  32.  
  33. $menula = $newd->Frame(
  34.    -relief     => "sunken",
  35.    -bd         => 1,
  36.    -background => $color_fondo,
  37.    -foreground => $color_texto
  38. );
  39. my $menulnowax = $menula->Menubutton(
  40.    -text             => "Options",
  41.    -underline        => 1,
  42.    -background       => $color_fondo,
  43.    -foreground       => $color_texto,
  44.    -activebackground => $color_texto
  45. )->pack( -side => "left" );
  46. my $aboutnowax = $menula->Menubutton(
  47.    -text             => "About",
  48.    -underline        => 1,
  49.    -background       => $color_fondo,
  50.    -foreground       => $color_texto,
  51.    -activebackground => $color_texto
  52. )->pack( -side => "left" );
  53. my $exitnowax = $menula->Menubutton(
  54.    -text             => "Exit",
  55.    -underline        => 1,
  56.    -background       => $color_fondo,
  57.    -foreground       => $color_texto,
  58.    -activebackground => $color_texto
  59. )->pack( -side => "left" );
  60. $menula->pack( -side => "top", -fill => "x" );
  61.  
  62. $menulnowax->command(
  63.    -label      => "Load Wordlist",
  64.    -background => $color_fondo,
  65.    -foreground => $color_texto,
  66.    -command    => \&loadword
  67. );
  68. $menulnowax->command(
  69.    -label      => "Check Online",
  70.    -background => $color_fondo,
  71.    -foreground => $color_texto,
  72.    -command    => \&scan
  73. );
  74. $menulnowax->command(
  75.    -label      => "Open Logs",
  76.    -background => $color_fondo,
  77.    -foreground => $color_texto,
  78.    -command    => \&openlogs
  79. );
  80.  
  81. $aboutnowax->command(
  82.    -label      => "About",
  83.    -background => $color_fondo,
  84.    -foreground => $color_texto,
  85.    -command    => \&aboutxa
  86. );
  87.  
  88. $exitnowax->command(
  89.    -label      => "Exit",
  90.    -background => $color_fondo,
  91.    -foreground => $color_texto,
  92.    -command    => \&exitnow
  93. );
  94.  
  95. $newd->Label(
  96.    -text       => "Proxy OK",
  97.    -font       => "Impact",
  98.    -background => $color_fondo,
  99.    -foreground => $color_texto
  100. )->place( -y => 40, -x => 75 );
  101. my $proxy_buenos =
  102.  $newd->Listbox( -background => $color_fondo, -foreground => $color_texto )
  103.  ->place( -y => "80", -x => "40" );
  104.  
  105. $newd->Label(
  106.    -text       => "Proxy Failed",
  107.    -font       => "Impact",
  108.    -background => $color_fondo,
  109.    -foreground => $color_texto
  110. )->place( -y => 40, -x => 220 );
  111. my $proxy_malos =
  112.  $newd->Listbox( -background => $color_fondo, -foreground => $color_texto )
  113.  ->place( -y => "80", -x => "200" );
  114.  
  115. MainLoop;
  116.  
  117. sub openlogs {
  118.    my $f = "proxy-founds.txt";
  119.    if ( -f $f ) {
  120.        system($f);
  121.    }
  122.    else {
  123.        $newd->Dialog(
  124.            -title            => "Error",
  125.            -buttons          => ["OK"],
  126.            -text             => "File Not Found",
  127.            -background       => $color_fondo,
  128.            -foreground       => $color_texto,
  129.            -activebackground => $color_texto
  130.        )->Show();
  131.    }
  132. }
  133.  
  134. sub loadword {
  135.  
  136.    my $newdax = MainWindow->new(
  137.        -background => $color_fondo,
  138.        -foreground => $color_texto
  139.    );
  140.  
  141.    $newdax->title("Load Wordlist");
  142.    $newdax->geometry("460x50+50+50");
  143.    $newdax->resizable( 0, 0 );
  144.  
  145.    $newdax->Label(
  146.        -text       => "File : ",
  147.        -font       => "Impact1",
  148.        -background => $color_fondo,
  149.        -foreground => $color_texto
  150.    )->place( -y => 10, -x => 10 );
  151.    my $filex = $newdax->Entry(
  152.        -width      => 40,
  153.        -background => $color_fondo,
  154.        -foreground => $color_texto
  155.    )->place( -y => 13, -x => 50 );
  156.    $newdax->Button(
  157.        -text             => "Browse",
  158.        -width            => 10,
  159.        -command          => \&bro,
  160.        -background       => $color_fondo,
  161.        -foreground       => $color_texto,
  162.        -activebackground => $color_texto
  163.    )->place( -y => 13, -x => 300 );
  164.    $newdax->Button(
  165.        -text             => "Load",
  166.        -width            => 10,
  167.        -command          => \&pasouno,
  168.        -background       => $color_fondo,
  169.        -foreground       => $color_texto,
  170.        -activebackground => $color_texto
  171.    )->place( -y => 13, -x => 375 );
  172.  
  173.    sub bro {
  174.        $newd->update;
  175.        $browse = $newd->FileSelect( -directory => getcwd() );
  176.        my $file = $browse->Show;
  177.        $filex->configure( -text => $file );
  178.    }
  179.  
  180.    sub pasouno {
  181.  
  182.        my $file = $filex->get;
  183.        $newdax->destroy();
  184.  
  185.        if ( -f $file ) {
  186.  
  187.            open( FILE, $file );
  188.            my @words = <FILE>;
  189.            close FILE;
  190.  
  191.            chomp @words;
  192.  
  193.            my @proxies = repes(@words);
  194.  
  195.            $proxy_buenos->delete( 0.0, "end" );
  196.            $proxy_malos->delete( 0.0, "end" );
  197.  
  198.            $newd->title("Proxy Tester 0.5 [+] Status : Testing ...");
  199.  
  200.            for my $pro (@proxies) {
  201.                chomp $pro;
  202.                $newd->update;
  203.                if ( testnow($pro) ) {
  204.                    $proxy_buenos->insert( "end", $pro );
  205.                }
  206.                else {
  207.                    $proxy_malos->insert( "end", $pro );
  208.                }
  209.  
  210.            }
  211.  
  212.        }
  213.        else {
  214.            $newd->Dialog(
  215.                -title            => "Error",
  216.                -buttons          => ["OK"],
  217.                -text             => "File Not Found",
  218.                -background       => $color_fondo,
  219.                -foreground       => $color_texto,
  220.                -activebackground => $color_texto
  221.            )->Show();
  222.        }
  223.    }
  224.    $newd->title("Proxy Tester 0.5");
  225. }
  226.  
  227. sub scan {
  228.  
  229.    $proxy_buenos->delete( 0.0, "end" );
  230.    $proxy_malos->delete( 0.0, "end" );
  231.  
  232.    $newd->title("Proxy Tester 0.5 [+] Status : Searching ...");
  233.  
  234.    my @uno = getproxys();
  235.    my @dos = getxroxy();
  236.  
  237.    #my @tres = proxyip();
  238.    #my @cuatro = proxylist();
  239.    #my @cinco = proxies(); #big list
  240.  
  241.    my @total = ( @uno, @dos, @tres, @cuatro, @cinco );
  242.  
  243.    $newd->update;
  244.    $newd->title("Proxy Tester 0.5 [+] Status : Testing ...");
  245.  
  246.    my $cont = "0";
  247.    for (@total) {
  248.        $newd->update;
  249.        if ( testnow($_) ) {
  250.            $cont++;
  251.            print "\a";    #BEEP
  252.        }
  253.    }
  254.    $newd->title("Proxy Tester 0.5");
  255. }
  256.  
  257. sub testnow {
  258.  
  259.    my $ver = shift;
  260.  
  261.    my $pro;
  262.    my $host;
  263.    my $port;
  264.    my $country;
  265.    my $save;
  266.  
  267.    my $test_proxy = LWP::UserAgent->new();
  268.    $test_proxy->timeout(5);
  269.    $test_proxy->agent(
  270. "Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
  271.    );
  272.  
  273.    if ( $ver =~ /(.*):(.*)/ ) {
  274.        ( $host, $port, $country ) = ( $1, $2, "Unknown" );
  275.        $save = $host . ":" . $port;
  276.    }
  277.  
  278.    if ( $ver =~ /(.*):(.*):(.*)/ ) {
  279.        ( $host, $port, $country ) = ( $1, $2, $3 );
  280.        $save = $host . ":" . $port . ":" . $country;
  281.    }
  282.  
  283.    my $pro = $host . ":" . $port;
  284.  
  285.    $test_proxy->proxy( "http", "http://" . $pro );
  286.    my $code = $test_proxy->get("http://www.whatismyip.com/")->content;
  287.  
  288.    if ( $code =~ /Your IP Address Is/ ) {
  289.        savefile( "proxy-founds.txt", $save );
  290.        return true;
  291.    }
  292. }
  293.  
  294. sub getproxys {
  295.  
  296.    my @founds;
  297.    my @volver;
  298.  
  299.    for my $num ( 1 .. 5 ) {
  300.        $newd->update;
  301.        my $code = toma(
  302. "http://www.proxys.com.ar/index.php?act=list&port=&type=&country=&page=$num"
  303.        );
  304.  
  305.        while ( $code =~
  306. /<tr class="cells" onmouseover="this.className='cells2'" onmouseout="this.className='cells'">(.*?)<\/tr>/sig
  307.          )
  308.        {
  309.            my $porcion = $1;
  310.            chomp $porcion;
  311.  
  312.            if ( my @total = $porcion =~ m{<\s*td\s*>\s*(.*?)\s*</\s*td}mig ) {
  313.                push( @founds, $total[1] . ":" . $total[2] . ":" . $total[4] );
  314.            }
  315.        }
  316.    }
  317.  
  318.    my @volver = repes(@founds);
  319.    return @volver;
  320.  
  321. }
  322.  
  323. sub getxroxy {
  324.  
  325.    my @founds_final;
  326.    my @founds;
  327.  
  328.    for my $num ( 0 .. 26 ) {
  329.        $newd->update;
  330.        open( FILE, ">>proxy.txt" );
  331.  
  332.        my $code = toma(
  333. "http://www.xroxy.com/proxylist.php?port=&type=&ssl=&country=&latency=1000&reliability=&sort=reliability&desc=true&pnum=$num"
  334.        );
  335.  
  336.        while ( $code =~
  337.            /proxy:name=XROXY proxy&host=(.*?)&port=(.*?)&notes=(.*?)&/sig )
  338.        {
  339.            my ( $ip, $port, $pais ) = ( $1, $2, $3 );
  340.            $port =~ s/&isSocks=true//sig;
  341.            $port =~ s/&socksversion=4a//sig;
  342.            push( @founds, "$ip:$port:$pais" );
  343.            print FILE "$ip:$port\n";
  344.        }
  345.    }
  346.  
  347.    my @founds_final = repes(@founds);
  348.    return @founds_final;
  349.  
  350. }
  351.  
  352. sub proxies {
  353.  
  354.    my @founds_final;
  355.    my @founds;
  356.  
  357.    for my $i ( 1 .. 10 ) {
  358.        $newd->update;
  359.        my $code =
  360.          toma( "http://proxies.my-proxy.com/proxy-list-" . $i . ".html" );
  361.  
  362.        my @found = $code =~ m/(\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3}:\d+)/g;
  363.  
  364.        for (@found) {
  365.            push( @founds, "$_:Unknown" );
  366.        }
  367.  
  368.    }
  369.  
  370.    my @founds_final = repes(@founds);
  371.    return @founds_final;
  372.  
  373. }
  374.  
  375. sub proxyip {
  376.  
  377.    my @founds_final;
  378.    my @founds;
  379.  
  380.    my $code = toma("http://proxy-ip-list.com/free-usa-proxy-ip.html");
  381.  
  382.    if ( $code =~ /<tbody class="table_body">(.*?)<\/table>/sig ) {
  383.        my $codedos = $1;
  384.  
  385.        while ( $codedos =~
  386. /<tr><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><td>(.*?)<\/td><\/tr>/mig
  387.          )
  388.        {
  389.            my ( $ip, $pais ) = ( $1, $5 );
  390.            push( @founds, "$ip:$pais" );
  391.        }
  392.    }
  393.  
  394.    my @founds_final = repes(@founds);
  395.    return @founds_final;
  396.  
  397. }
  398.  
  399. sub proxylist {
  400.  
  401.    my @founds_final;
  402.    my @founds;
  403.  
  404.    my $code = toma("http://www.proxylist.net/");
  405.  
  406.    while ( $code =~
  407. /<tr><td><a href="(.*?)">(.*?)<\/a><\/td><td><a href="(.*?)">(.*?)<\/a><\/td>/mig
  408.      )
  409.    {
  410.        my ( $ip, $pais ) = ( $2, $4 );
  411.        push( @founds, "$ip:$pais" );
  412.    }
  413.  
  414.    my @founds_final = repes(@founds);
  415.    return @founds_final;
  416.  
  417. }
  418.  
  419. sub aboutxa {
  420.  
  421.    $newd->Dialog(
  422.        -title            => "About",
  423.        -buttons          => ["OK"],
  424.        -text             => "Coded By Doddy H",
  425.        -background       => $color_fondo,
  426.        -foreground       => $color_texto,
  427.        -activebackground => $color_texto
  428.    )->Show();
  429.  
  430. }
  431.  
  432. sub exitnow { exit 1; }
  433.  
  434. sub savefile {
  435.    open( SAVE, ">>" . $_[0] );
  436.    print SAVE $_[1] . "\n";
  437.    close SAVE;
  438. }
  439.  
  440. sub toma {
  441.    return $nave->get( $_[0] )->content;
  442. }
  443.  
  444. sub repes {
  445.    my @limpio;
  446.    foreach $test (@_) {
  447.        push @limpio, $test unless $repe{$test}++;
  448.    }
  449.    return @limpio;
  450. }
  451.  
  452. #The End ?
  453.  


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,563 Último mensaje 24 Abril 2010, 18:19 pm
por Yasmesita
[Python] RFI Tester
Scripting
BigBear 0 1,526 Último mensaje 7 Octubre 2011, 01:39 am
por BigBear
[Ruby] Proxy Tester
Scripting
BigBear 0 1,797 Último mensaje 16 Octubre 2011, 02:49 am
por BigBear
[Python] Proxy Tester
Scripting
BigBear 0 1,783 Último mensaje 16 Octubre 2011, 02:52 am
por BigBear
[Perl] Proxy Tester 0.5
Scripting
BigBear 0 1,792 Último mensaje 12 Mayo 2012, 20:51 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines