[EMAIL PROTECTED] ha scritto:
Great where do I get this IO::Socket module?
thank you
Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
*Goffredo Saffioti <[EMAIL PROTECTED]>*
01/09/2004 12:52 PM
To: [EMAIL PROTECTED]
cc: [EMAIL PROTECTED]
Subject: Re: Perl sockets on an HPUX
[EMAIL PROTECTED] ha scritto:
>People of the Perl,
>
>does anyone have a perl program that will create a socket ( srwxr-xr-x )
>for a HPUX 11.0 system? I am in need of this! I have looked into
system
>calls such as mknod and mkfifo and these are not capable of creating
these
>special files.
>
>Thanks!
>
>Derek B. Smith
>OhioHealth IT
>UNIX / TSM / EDM Teams
>
>
>
>
This is a socket in perl u can declare a socket in the form: $sock =
Yuo need the module
use IO::Socket;
$sock = IO::Socket::INET->new(PeerAddr => $server,
PeerPort => $port,
Proto => 'tcp');
Not so distant by C socket :-) .
You can try this sochet with this simple script underneath
it's a simple tcp port scanner .
Hope this can help u.
Cya.
Go.
#!/usr/bin/perl -w
use IO::Socket;
use strict;
my ($line, $port, $sock, $range, $splitted, @servers, @splitted);
my $VERSION='1.0';
my $pid = 0;
my($server, $begin, $end, $processes) = @ARGV;
&usage if (!$server);
$begin = 0 if (!$begin);
$end = 65000 if (!$end);
$processes = 2 if ((!$processes) || ($processes<2));
print "Scanning from $begin to $end\n";
for ($port=$begin;$port<=$end;$port++) {
&scan;
if ($sock){
print "Connected on port $port\n";
}
else{
print "$port not connected\n";
}
}
sub usage{
print "Usage: portscan hostname [start at port number]\n";
exit(0);
}
sub scan{
$sock = IO::Socket::INET->new(PeerAddr => $server,
PeerPort => $port,
Proto => 'tcp');
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Look in your perl path in the IO directory maybe u can find it there for
default .
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>