Chinaunix首页 | 论坛 | 博客
  • 博客访问: 466695
  • 博文数量: 279
  • 博客积分: 4467
  • 博客等级: 上校
  • 技术积分: 2830
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-03 14:43
文章分类

全部博文(279)

文章存档

2013年(1)

2012年(39)

2011年(35)

2009年(29)

2008年(131)

2007年(44)

分类:

2008-04-22 09:25:01

#!/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 
阅读(302) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~