in reply to portscanner
Hope this helps.use strict; use IO::Socket; my $host = "localhost"; my $sock; print "Open ports:\n"; for(my $port=1; $port < 1024; $port++) { $sock = new IO::Socket::INET(PeerAddr => $host, PeerPort => $port, + Proto => 'tcp'); if ($sock) { print "$port\n"; close $sock; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: portscanner
by nostromo (Sexton) on Jun 12, 2000 at 16:38 UTC |