1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #!usr/bin/perl #Scan Port #(C) Doddy Hackman 2011 #Creditos use IO::Socket; head(); unless($ARGV[0]) { print "\n\n[sintax] : ".$0." <ip> \n\n"; } else { scan($ARGV[0]); } copyright(); sub scan { my %ports = ("21"=>"ftp", "22"=>"ssh", "25"=>"smtp", "80"=>"http", "110"=>"pop3", "3306"=>"mysql" ); print "\n<ul class="bbc_list"><li type="square"> Scanning $_[0]\n\n\n";[/li][/list] 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"; } } } sub head { print "\n\n-- == Scan Port == --\n\n"; } sub copyright { print "\n\n(C) Doddy Hackman 2011\n\n"; exit(1); } |
Ejemplo de uso
1 | perl scan.pl localhost
|
0 comentarios: sobre [Perl] Scan Port
Publicar un comentario para [Perl] Scan Port