quarta-feira, 19 de dezembro de 2012

Yes, I'm really impressed with how it is easy

To program with Perl... i might even check their most known framework, catalyst.
#!/usr/bin/perl -w
#lamescan.pl
use strict;
use warnings;
use IO::Socket;

my $target;
if ( @ARGV == 0 ) {
    print "Usage $0 [ip]\n";
    exit;
}
else {
    $target = $ARGV[0];
}

my @ports=(80,443,22,21);
foreach (@ports)
{
  
  print "\nTrying port ".$_;
  my $connect = IO::Socket::INET->new(
                    Proto    => "tcp",
                    PeerAddr => $target,
                    PeerPort => $_,
     Timeout  => .60,
                );
                 
 if(defined($connect))
 {
  print ">>>>>>>>port ".$_." is open";
 }
 else
 {
  print "... nope";
 }
  
}

Sem comentários: