#!/usr/bin/perl
use IO::Socket;
$remote_host=$ARGV[0];
$start_port=$ARGV[1];
$end_port=$ARGV[2];
if ($remote_host eq "" || $start_port eq "" || $end_port eq ""
{
print("\nUsag:perl scaner.pl ip start_port end_port\n\n";
}
else
{
for($i=$start_port;$i<=$end_port;$i++)
{
$sock=IO::Socket::INET->;new(PeerAddr=>;$remote_host,
PeerPort=>;$i);
if(defined $sock)
{
print("HOSTremote_host PORTi is OPEN!!!!!!!!!\n";
$sock->;close;
}
else
{
#print("HOST: $remote_host PORTi is closed!\n";
}
}
}
exit 1;
#end
阅读(344) | 评论(0) | 转发(0) |