elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
29 Mayo 2012, 09:19  


Tema destacado: Nueva página de elhacker.net en Google+ Google+

+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting (Moderadores: Novlucker, Leo Gutiérrez., EleKtro H@cker)
| | |-+  [Perl] ScanPort 0.5
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Perl] ScanPort 0.5  (Leído 315 veces)
Doddy

Desconectado Desconectado

Mensajes: 220



Ver Perfil
[Perl] ScanPort 0.5
« en: 3 Diciembre 2011, 16:33 »

Simple scanner port en perl

Código
#!usr/bin/perl
#ScanPort 0.5
#Examples
#perl scan.pl -target localhost -option fast
#perl scan.pl -target localhost -option full -parameters 1-100
 
use IO::Socket;
use Getopt::Long;
 
GetOptions(
"-target=s" => \$target,
"-option=s" => \$opcion,
"-parameters=s"=>\$parameters
);
 
head();
unless($target) {
sintax();
} else {
if ($opcion eq "fast") {
scanuno($target);
}
if ($opcion eq "full" and $parameters) {
if($parameters=~/(.*)-(.*)/) {
my $start = $1;
my $end = $2;
scandos($target,$start,$end);
}
}
}
 
copyright();
 
sub scanuno {
 
my %ports = ("21"=>"ftp",
"22"=>"ssh",
"25"=>"smtp",
"80"=>"http",
"110"=>"pop3",
"3306"=>"mysql"
);
 
print "\n[+] Scanning $_[0]\n\n\n";
 
for my $port(keys %ports) {
 
if (new IO::Socket::INET(PeerAddr => $_[0],PeerPort => $port,Proto => "tcp",Timeout  => 0.5)) {
print "[Port] : ".$port." [Service] : ".$ports{$port}."\n";
}
}
print "\n\n[+] Scan Finish\n";
}
 
 
sub scandos {
 
print "\n[+] Scanning $_[0]\n\n\n";
 
for my $port($_[1]..$_[2]) {
 
if (new IO::Socket::INET(PeerAddr => $_[0],PeerPort => $port,Proto => "tcp",Timeout  => 0.5)) {
print "[Port] : $port\n";
}
}
print "\n\n[+] Scan Finish\n";
}
 
sub head {
print "-- == ScanPort 0.5 == --\n\n";
}
 
sub copyright {
print "\n\n(C) Doddy Hackman 2011\n\n";
}
 
sub sintax {
print "\n[+] sintax : $0 -target target -option fast/full -parameters 1-9999\n";
}
 
 
# The End ?
 


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
perl
Desarrollo Web
chita_GB2 1 316 Último mensaje 4 Abril 2004, 05:34
por Morris
Ayuda con el Active Perl + Perl
Hacking Básico
Aironjack 3 926 Último mensaje 8 Marzo 2005, 07:52
por Aironjack
Que significa #!/usr/bin/perl ?? como ejecutamos un exploit en perl...
Bugs y Exploits
mousehack 7 2,198 Último mensaje 4 Noviembre 2005, 23:16
por BenRu
Libros de Perl online [PERL]
Scripting
madpitbull_99 0 854 Último mensaje 18 Mayo 2011, 21:49
por madpitbull_99
[C] ScanPort
Programación C/C++
Doddy 0 404 Último mensaje 8 Enero 2012, 18:42
por Doddy
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines