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

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


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


Desconectado Desconectado

Mensajes: 545



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

Un simple scanner port hecho en Perl.

Código
  1. #!usr/bin/perl
  2. #ScanPort 0.6
  3. #Coded By Doddy H
  4. #Examples
  5. #perl scan.pl -target localhost -option fast
  6. #perl scan.pl -target localhost -option full -parameters 1-100
  7.  
  8. use IO::Socket;
  9. use Getopt::Long;
  10.  
  11. GetOptions(
  12.    "-target=s"     => \$target,
  13.    "-option=s"     => \$opcion,
  14.    "-parameters=s" => \$parameters
  15. );
  16.  
  17. head();
  18. unless ($target) {
  19.    sintax();
  20. }
  21. else {
  22.    if ( $opcion eq "fast" ) {
  23.        scanuno($target);
  24.    }
  25.    if ( $opcion eq "full" and $parameters ) {
  26.        if ( $parameters =~ /(.*)-(.*)/ ) {
  27.            my $start = $1;
  28.            my $end   = $2;
  29.            scandos( $target, $start, $end );
  30.        }
  31.    }
  32. }
  33.  
  34. copyright();
  35.  
  36. sub scanuno {
  37.  
  38.    my %ports = (
  39.        "21"   => "ftp",
  40.        "22"   => "ssh",
  41.        "25"   => "smtp",
  42.        "80"   => "http",
  43.        "110"  => "pop3",
  44.        "3306" => "mysql"
  45.    );
  46.  
  47.    print "\n[+] Scanning $_[0]\n\n\n";
  48.  
  49.    for my $port ( keys %ports ) {
  50.  
  51.        if (
  52.            new IO::Socket::INET(
  53.                PeerAddr => $_[0],
  54.                PeerPort => $port,
  55.                Proto    => "tcp",
  56.                Timeout  => 0.5
  57.            )
  58.          )
  59.        {
  60.            print "[+] Port Found : "
  61.              . $port
  62.              . " [Service] : "
  63.              . $ports{$port} . "\n";
  64.        }
  65.    }
  66.    print "\n\n[+] Scan Finished\n";
  67. }
  68.  
  69. sub scandos {
  70.  
  71.    print "\n[+] Scanning $_[0]\n\n\n";
  72.  
  73.    for my $port ( $_[1] .. $_[2] ) {
  74.  
  75.        if (
  76.            new IO::Socket::INET(
  77.                PeerAddr => $_[0],
  78.                PeerPort => $port,
  79.                Proto    => "tcp",
  80.                Timeout  => 0.5
  81.            )
  82.          )
  83.        {
  84.            print "[+] Port Found : $port\n";
  85.        }
  86.    }
  87.    print "\n\n[+] Scan Finished\n";
  88. }
  89.  
  90. sub head {
  91.    print "\n-- == ScanPort 0.6 == --\n\n";
  92. }
  93.  
  94. sub copyright {
  95.    print "\n\n-- == (C) Doddy Hackman 2012 == --\n\n";
  96. }
  97.  
  98. sub sintax {
  99.    print
  100. "\n[+] sintax : $0 -target <target> -option fast/full -parameters <1-9999>\n";
  101. }
  102.  
  103. # The End ?
  104.  
  105.  


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] Search in google for scan SQLI
Scripting
BigBear 1 2,446 Último mensaje 4 Noviembre 2011, 17:48 pm
por BiteAciD
[Perl] Paranoic Scan By Doddy H
Scripting
BigBear 0 1,634 Último mensaje 8 Octubre 2011, 16:56 pm
por BigBear
[Perl Tk] Scan Port 0.6
Scripting
BigBear 0 1,476 Último mensaje 19 Mayo 2012, 17:30 pm
por BigBear
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines