• Publicidad

Problema con script checkeador de proxies.

¿Apenas comienzas con Perl? En este foro podrás encontrar y hacer preguntas básicas de Perl con respuestas aptas a tu nivel.

Problema con script checkeador de proxies.

Notapor Zeokat » 2007-04-06 09:52 @452

Navegando por ahi, me encontre un script para checkear proxies, el problema es que me tira un error al tratar de ejecutarlo que no se solucionarlo....


Thread::Pool::new passed bad attribute name 'HASH(0x1b82874)' at C:\test.pl line 54


EL codigo del script es el siguiente...

Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
#!/usr/bin/perl
# [SA]proxycheck, multi cheker proksei
#
#  Usage :
# ./sa-proxycheck.pl --input=in.txt --output=out.txt [--url=http://your/proxytest.php] [--threads=100]
#
# Example : ./sa-proxycheck.pl -i rawlist.txt -o goodlist.txt
#
#
# -taking part spisokproxei and :
# -requests to the script currently
# -checks result (you type kodirovano base64)
# maintains output (results)
#
# uses Thread::Pool for fast results

# default URL used to request (there must be some)
our $testurl = "http://url.com/2test.php";

# modules that we use
use strict;
use Getopt::Long;
use Date::Format;
use Thread::Pool;
use LWP::UserAgent;
use HTTP::Request::Common qw(POST);
use MIME::Base64;

# Options commandna line
my $input = "";
my $output = "";
my $threads = 100;
GetOptions (
'input|i=s' => \$input
,'output|o=s' => \$output
,'threads|t=i' => \$threads
,'url|u=s' => \$testurl
);

die ("Use: ./sa-proxycheck.pl --input=in.txt --output=out.txt [--url=http://your/proxytest.php] [--threads=100]\n") if $input eq "" || $output eq "";

# Validating your incoming data
die ("Input file \"$input\" not found!\n") unless -e $input;

# Cleaning output file header installation
open(OUT, ">$output") or die ("Unable to open \"$output\" input file");
my $gentime = time2str("%c", time);
print OUT "# Generated at $gentime by [SA]proxycheck \n";
close OUT;

print "Using $testurl for proxy checking...\n";
print "Starting $input -> $output job with $threads workers:\n";
my %resolved : shared;
my $pool = Thread::Pool->new(
{
workers => $threads,
do => \&do,
monitor => \&monitor,
}
);

open(IN, $input);
while(my $line = <IN>)
{
chomp $line;
$pool->job($line);
}

# check proxy
# IN: 1 proxy to check (iport)
sub do {
my $testproxy = shift;

# build the LAWP request
my $ua = new LWP::UserAgent;
$ua->timeout(10);
$ua->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4");
$ua->proxy(['http'] => 'http://' . $testproxy);

my $verify = time;
my $req = POST $testurl, [ check => "$verify"];
my $res = $ua->request($req);

if ($res->is_success)
{

my $content = $res->content;
(my $security, my $type) = split("\t", decode_base64($content));

$security = decode_base64($security);
$type = decode_base64($type);

if($verify == $security && $type eq "strong")
{
print "$testproxy\tFOUND PROXY\n";
return $testproxy;
}
else {
print "$testproxy\tsecurity failed: $verify != $security or bad type $type\n";
return 0;
}
}
else
{
print "$testproxy\tquery failed\n";
return 0;
}
} #do

#--------------------------------------------------------------------
# IN: 1 working proxy (iport)

sub monitor {
if($_[0])
{
open(OUT, ">>$output");
print OUT $_[0] . "\n";
close OUT;
}
} #monitor
Coloreado en 0.003 segundos, usando GeSHi 1.0.8.4



Gracias de antemano. :)
Zeokat
Perlero nuevo
Perlero nuevo
 
Mensajes: 125
Registrado: 2006-08-22 08:08 @380

Publicidad

Notapor explorer » 2007-04-06 09:57 @456

Prueba a cambiar
Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
do => \&do,
Coloreado en 0.001 segundos, usando GeSHi 1.0.8.4

por
Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
'do' => \&do,
Coloreado en 0.001 segundos, usando GeSHi 1.0.8.4
JF^D Perl programming & Raku programming. Grupo en Telegram: https://t.me/Perl_ES
Avatar de Usuario
explorer
Administrador
Administrador
 
Mensajes: 14486
Registrado: 2005-07-24 18:12 @800
Ubicación: Valladolid, España

Notapor Zeokat » 2007-04-06 12:03 @544

Cambiado y sigue iwal... gracias de todos modos. Saludos.


Thread::Pool::new passed bad attribute name 'HASH(0x1b538ac)' at C:\test.pl line 54
Zeokat
Perlero nuevo
Perlero nuevo
 
Mensajes: 125
Registrado: 2006-08-22 08:08 @380


Volver a Básico

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados

cron