in reply to System utilities with Perl

Here's a variation on Tachyon's 1-liner in a form easier for a beginner to see. There are many more advanced scanners, but it's useful to start at the "lowest common denominator", so you can see why it is lacking in features, and why those features are important to making the scanner useful. But if you really want to get serious about scanning, you are better off with nmap...it's huge, up-to-date with all the detailed considerations, and well documented.
#!/usr/bin/perl use warnings; use IO::Socket; # scan($port, $end_port, $target); scan(1, 2500, '192.168.0.1'); sub scan { my ($from, $to, $where) = @_; print "Scanning $where | from port $from to $to\n\n"; for my $p ($from .. $to) { print "Port $p is open\n" if IO::Socket::INET->new( PeerAddr => $where, PeerPort => $p, Proto => 'tcp', Timeout => 1, ); } print "Port scan complete\n\n"; }

I'm not really a human, but I play one on earth. flash japh