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

 

 


Tema destacado: Curso de javascript por TickTack


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


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Perl Tk] Scan Port 0.6
« en: 19 Mayo 2012, 17:30 pm »

Nueva version Tk de un scanner de puertos que hice.

Una imagen



El codigo

Código
  1. #!usr/bin/perl
  2. #ScanPort 0.6
  3. #Version Tk
  4. #Coded By Doddy H
  5.  
  6. use Tk;
  7. use IO::Socket;
  8.  
  9. my $color_fondo = "black";
  10. my $color_texto = "green";
  11.  
  12. if ( $^O eq 'MSWin32' ) {
  13.    use Win32::Console;
  14.    Win32::Console::Free();
  15. }
  16.  
  17. my $kax =
  18.  MainWindow->new( -background => $color_fondo, -foreground => $color_texto );
  19. $kax->geometry("422x130+20+20");
  20. $kax->resizable( 0, 0 );
  21. $kax->title("Scan Port 0.6 || Coded By Doddy H");
  22.  
  23. $kax->Label(
  24.    -text       => "Host : ",
  25.    -font       => "Impact",
  26.    -background => $color_fondo,
  27.    -foreground => $color_texto
  28. )->place( -x => 20, -y => 20 );
  29. my $hostx = $kax->Entry(
  30.    -width      => 30,
  31.    -background => $color_fondo,
  32.    -foreground => $color_texto
  33. )->place( -x => 68, -y => 26 );
  34. $kax->Label(
  35.    -text       => "From port : ",
  36.    -font       => "Impact",
  37.    -background => $color_fondo,
  38.    -foreground => $color_texto
  39. )->place( -x => 20, -y => 50 );
  40. my $startx = $kax->Entry(
  41.    -width      => 8,
  42.    -background => $color_fondo,
  43.    -foreground => $color_texto
  44. )->place( -x => 100, -y => 55 );
  45. $kax->Label(
  46.    -text       => "To : ",
  47.    -font       => "Impact",
  48.    -background => $color_fondo,
  49.    -foreground => $color_texto
  50. )->place( -x => 170, -y => 50 );
  51. my $endx = $kax->Entry(
  52.    -width      => 8,
  53.    -background => $color_fondo,
  54.    -foreground => $color_texto
  55. )->place( -x => 200, -y => 55 );
  56.  
  57. $kax->Label(
  58.    -text       => "Progress : ",
  59.    -font       => "Impact",
  60.    -background => $color_fondo,
  61.    -foreground => $color_texto
  62. )->place( -x => 20, -y => 84 );
  63. my $tatus = $kax->Entry(
  64.    -width      => 8,
  65.    -background => $color_fondo,
  66.    -foreground => $color_texto
  67. )->place( -x => 100, -y => 90 );
  68. $kax->Button(
  69.    -text             => "Fast",
  70.    -width            => 6,
  71.    -background       => $color_fondo,
  72.    -foreground       => $color_texto,
  73.    -activebackground => $color_texto,
  74.    -command          => \&scanuno
  75. )->place( -x => 158, -y => 88 );
  76. $kax->Button(
  77.    -text             => "Full",
  78.    -width            => 6,
  79.    -background       => $color_fondo,
  80.    -foreground       => $color_texto,
  81.    -activebackground => $color_texto,
  82.    -command          => \&scandos
  83. )->place( -x => 208, -y => 88 );
  84.  
  85. $kax->Label(
  86.    -text       => "Port Found",
  87.    -font       => "Impact",
  88.    -background => $color_fondo,
  89.    -foreground => $color_texto
  90. )->place( -x => 305, -y => 20 );
  91. my $porters = $kax->Listbox(
  92.    -width      => 20,
  93.    -height     => 4,
  94.    -background => $color_fondo,
  95.    -foreground => $color_texto
  96. )->place( -x => 280, -y => 50 );
  97.  
  98. MainLoop;
  99.  
  100. sub scanuno {
  101.  
  102.    my %ports = (
  103.        "21"   => "ftp",
  104.        "22"   => "ssh",
  105.        "25"   => "smtp",
  106.        "80"   => "http",
  107.        "110"  => "pop3",
  108.        "3306" => "mysql"
  109.    );
  110.  
  111.    $porters->delete( "0.0", "end" );
  112.    $tatus->configure( -text => " " );
  113.  
  114.    for my $port ( keys %ports ) {
  115.        $kax->update;
  116.        $tatus->configure( -text => $port );
  117.        if (
  118.            new IO::Socket::INET(
  119.                PeerAddr => $hostx->get,
  120.                PeerPort => $port,
  121.                Proto    => "tcp",
  122.                Timeout  => 0.5
  123.            )
  124.          )
  125.        {
  126.            $porters->insert( "end", $port );
  127.        }
  128.    }
  129.    $tatus->configure( -text => " " );
  130. }
  131.  
  132. sub scandos {
  133.  
  134.    $porters->delete( "0.0", "end" );
  135.    $tatus->configure( -text => " " );
  136.  
  137.    for my $port ( $startx->get .. $endx->get ) {
  138.        $kax->update;
  139.        $tatus->configure( -text => $port );
  140.        if (
  141.            new IO::Socket::INET(
  142.                PeerAddr => $hostx->get,
  143.                PeerPort => $port,
  144.                Proto    => "tcp",
  145.                Timeout  => 0.5
  146.            )
  147.          )
  148.        {
  149.            $porters->insert( "end", $port );
  150.        }
  151.    }
  152.    $tatus->configure( -text => " " );
  153. }
  154.  
  155. # The End ?
  156.  
  157.  



En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Perl] Paranoic Scan 0.9
Scripting
BigBear 0 1,503 Último mensaje 7 Octubre 2011, 01:15 am
por BigBear
[Perl] Scan Port By Doddy H
Scripting
BigBear 0 1,826 Último mensaje 7 Octubre 2011, 15:56 pm
por BigBear
[Perl] Paranoic Scan By Doddy H
Scripting
BigBear 0 1,634 Último mensaje 8 Octubre 2011, 16:56 pm
por BigBear
[Perl] Scan Port 0.6
Scripting
BigBear 0 1,437 Último mensaje 19 Mayo 2012, 17:30 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines