siliconite
asked on
socket problemo
i have decided to make a socket probe to test myyyyyy security and i am trying to make it quiker
this is my code so-far:
#!c:\program files\active perl\bin\perl\
use IO::Socket;
#this is the connection bit and if it cannot connect to the port or the port is #closed then it makes fail equal to could not whatever.
# build TCP socket connection attempt
$host = "80.4.249.49";
$first = 1;
$second = 30;
open(DAT,">ports.dat") || die("Cannot Open File:$!");
print "hello this is a port scanner made by me myself and i\n";
try();
sub try
{
$porter=$first;
while ($porter<=$second)
{
$fail="connected to host on";
$socket= IO::Socket::INET->new(Peer Addr => $host,
PeerPort => $porter,
Proto => "tcp",
Timeout => 5)
or $fail="could not connect to the host on port";
if ($fail eq "connected to host on")
{
print DAT "$fail $porter\n";
}
print "$fail $porter\n";
$porter++
}
}
how can i multi thread it so that it does ...say...20 port scans at once all on different ports.
thanks in advance
cheers
this is my code so-far:
#!c:\program files\active perl\bin\perl\
use IO::Socket;
#this is the connection bit and if it cannot connect to the port or the port is #closed then it makes fail equal to could not whatever.
# build TCP socket connection attempt
$host = "80.4.249.49";
$first = 1;
$second = 30;
open(DAT,">ports.dat") || die("Cannot Open File:$!");
print "hello this is a port scanner made by me myself and i\n";
try();
sub try
{
$porter=$first;
while ($porter<=$second)
{
$fail="connected to host on";
$socket= IO::Socket::INET->new(Peer
PeerPort => $porter,
Proto => "tcp",
Timeout => 5)
or $fail="could not connect to the host on port";
if ($fail eq "connected to host on")
{
print DAT "$fail $porter\n";
}
print "$fail $porter\n";
$porter++
}
}
how can i multi thread it so that it does ...say...20 port scans at once all on different ports.
thanks in advance
cheers
ASKER
yea it is the full code could you tell me how to use fork
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i am sorry, the second part is the sending side, which i have termed as receiving side.
cheers mate thnaks so much for youre time.
here r the points
here r the points
Is this the full code?????