Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Suggestions & Improvements on a portscanner using IO::Socket

by ChOas (Curate)
on May 08, 2002 at 12:40 UTC ( #165000=note: print w/replies, xml ) Need Help??

in reply to Suggestions & Improvements on a portscanner using IO::Socket


This is OLD code, but it should do the trick aswell:
#!/usr/local/bin/perl -w use strict; use IO::Socket; my $Usage="$0 -start [Start port] -end [End port] -address [IP address +]"; die "Usage: $Usage \n" if ((@ARGV==0)||((scalar @ARGV)%2!=0)); my %CommandLine=@ARGV; my $Start=$CommandLine{-start} || 1; my $End=$CommandLine{-end} || 1024; my $Address=$CommandLine{-address} || ""; print "Scanning $Address: ports $Start\-$End\n"; local $^W=0; for (my $Port=$Start;$Port<=$End;$Port++) { print "Port $Port (",getservbyport($1,"tcp")||"Unknown",") is open\n" + if IO::Socket::INET->new("$Address:$Port"); }; $^W++;


print "profeth still\n" if /bird|devil/;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://165000]
virtualsue uses arcane git commands to resurrect a file, gets it back into shape and quits for the day
[GotToBTru]: a few years ago, when we had 3 dogs, the largest of them caught a chipmunk, but did not know what to do with it other than hold it in his mouth
[GotToBTru]: my wife told him to spit it out, so he did
[erix]: yeah, modern dogs are cute tjhat way :)
[erix]: except of course, the RHODESIAN LION HOUND ! :)
[Discipulus]: in roma cars are good mouser.. fortunnately no mouse at 7th floor..
[GotToBTru]: that's a name that should always be accompanied by a trumper fanfare
[GotToBTru]: trumpet, not trumper
[GotToBTru]: good thing too, Discipulus, no roads on the 7th floor either
[GotToBTru]: okay, fess up, who installed CB::Typo?

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2017-11-17 20:07 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (272 votes). Check out past polls.