Created
April 13, 2012 13:20
-
-
Save cobra-tn/2376802 to your computer and use it in GitHub Desktop.
Port Scanner [Perl Script]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use IO::Socket; | |
if(@ARGV != 3){ | |
print "ρσят ѕ¢αηηєя ¢σ∂є∂ ву вℓα¢к ¢σвяα | |
υѕαgє : [min port] [max port] [host] | |
"; | |
exit 1; | |
} | |
if($ARGV[0] > $ARGV[1]){ | |
print "Error: min port is higher then max port\n"; | |
exit 1; | |
} | |
for($i = $ARGV[0]; $i <= $ARGV[1]; ++$i){ | |
$host = IO::Socket::INET->new(PeerAddr=>$ARGV[2],PeerPort=>$i,proto=>'tcp',Timeout=>1) and print "Port $i is open\n"; | |
} | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment