Unblock Myspace - Loans - Loans - McDonalds - Loans

PDA

View Full Version : I Want to add thread to this Script!


polaris
Jun 6th 2007, 11:05 pm
hello


I have a script like this and I want to add threads to this to do the scanning object faster

Can anyone help me?
#!/usr/bin/perl
use IO::Socket;

$timeout = 5;
$from = $ARGV[1];
$to = $ARGV[2];
$host = $ARGV[0];
if (@ARGV < 3)
{
usage();
exit()
}
while($from != $to + 1)
{
$socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>$host, PeerPort=>$from,Timeout=>$timeout);
if($socket)
{
print $from ." is open.\n";
}

$from++;
}

sub usage()
{
print 'Iron\'s PortScanner - Visit IronWarez.info for more scripts
Usage:
perl portscan.pl host FROM TO
Example:
perl portscan.pl 127.0.0.1 1 2000
';
}