This works for me: 

#!/usr/bin/perl
# file: /home/dr00/scripts/network/portscan.pl

use IO::Socket;

my $host = shift || 'localhost:';
for ($port=1 ; $port < 1024 ; $port++) {
        my $server = $host . ":" . $port;       
        if (my $fh = IO::Socket::INET->new($server)) {
                print "$host is listening on port $port\n";
        }
}

naturally you'd want to change the port number ranges, and perhaps give it a
loop to work over.

(this is my first post to the (or any) group. If anyone can tell me what I
need to do from Outlook to connect a reply to the original query, I'd be
grateful)

Dave Ramlakhan
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to