It looks like you're new here. If you want to get involved, click one of these buttons!
#!/usr/bin/perl
# Perl Port Scanner
# Semtex-Primed
use IO::Socket;
if(@ARGV != 3){
print \"Semtex-Primed\n\";
print \"Learn how to use this!!!\n\";
print \"$0 [start port] [end port] [host]\n\";
print \"Example: $0 1 65535 127.0.0.1\n\";
exit 1;
}
if($ARGV[0] > $ARGV[1]){
print \"The Start port is higher then End port: Sort it out!\n\";
exit 1;
}
for($i = $ARGV[0]; $i <= $ARGV[1]; ++$i){
$host = new IO::Socket::INET(
PeerAddr => $ARGV[2],
PeerPort => $i,
Proto => 'tcp',
Timeout => 1
);
if($host){
print \"Port $i is OPEN\n\";
} else {
print \"Port $i is CLOSED\n\";
}
}
exit;