Tengo el siguiente problema, agradeceré cualquier cooperación.
Descripción del entorno:
+ Windows 7 Pro 64
+ StrawberryPerl
Al Perl he agregado los siguientes módulos:
+ Net::DNS
+ PAR::Packer
Tengo un script que al ejecutarlo directamente con perl efectúa la labor sin inconvenientes.
Lamentablemente, después de compilarlo con pp, el ejecutable resultante no actúa tal como al ejecutarlo con Perl.
Este es el script:
Using perl Syntax Highlighting
- #!C:\Perl\bin\perl -w
- use Net::DNS;
- my $res = Net::DNS::Resolver->new;
- $res->udp_timeout(5);
- my $problems = "";
- my $incalol = 0;
- my $listaips = "";
- @blacklists = (
- "b.barracudacentral.org", "bl.spamcop.net",
- "ips.backscatterer.org", "rhsbl.ahbl.org",
- "backscatter.spameatingmonkey.net", "bl.spameatingmonkey.net",
- "uribl.spameatingmonkey.net", "urired.spameatingmonkey.net",
- "fresh.spameatingmonkey.net", "badconf.rhsbl.sorbs.net",
- "new.spam.dnsbl.sorbs.net", "cbl.abuseat.org",
- "pbl.spamhaus.org"
- );
- for $arg (@ARGV) {
- $arg =~ m/(\d+)\.(\d+)\.(\d+)\.(\d+)/;
- $arginv = $4 . "." . $3 . "." . $2 . "." . $1;
- $listaips .= " " . $arg;
- for $bl (@blacklists) {
- my $query = $res->search( $arginv . "." . $bl );
- if ($query) {
- $reason = $res->query( $arginv . "." . $bl, 'TXT' );
- $problems .= "FOUND $arg in " . $bl . "!! (reason: ";
- for $txt ( $reason->answer ) {
- $problems .= $txt->rdatastr if ( $txt->type eq "TXT" );
- }
- $problems .= ");; ";
- $incalol++;
- }
- }
- }
- if ( $incalol != 0 ) {
- print $problems. "\n";
- exit 2;
- }
- print "OK - $listaips checked, is not blacklisted\n";
- exit 0;
Coloreado en 0.005 segundos, usando GeSHi 1.0.8.4
Utilizo la siguiente instrucción para compilar:
pp -v -o c:\Temp\BL\check_bl.exe c:\Temp\BL\check_bl
Con Perl:
Esta instrucción para ejecutarlo con perl:
perl c:\temp\bl\check_bl 37.215.241.150
Y arroja el siguiente resultado:
FOUND 37.215.241.150 in ips.backscatterer.org!! (reason: "Sorry 37.215.241.150 is blacklisted at http://www.backscattere
r.org/?ip=37.215.241.150");; FOUND 37.215.241.150 in cbl.abuseat.org!! (reason: "Blocked - see http://cbl.abuseat.org/lo
okup.cgi?ip=37.215.241.150");; FOUND 88.165.118.202 in b.barracudacentral.org!! (reason: "http://www.barracudanetworks.c
om/reputation/?pr=1&ip=88.165.118.202");; FOUND 88.165.118.202 in bl.spamcop.net!! (reason: "Blocked - see http://www.sp
amcop.net/bl.shtml?88.165.118.202");; FOUND 88.165.118.202 in new.spam.dnsbl.sorbs.net!! (reason: "Currently Sending Spa
m See: http://www.sorbs.net/lookup.shtml?88.165.118.202");; FOUND 88.165.118.202 in cbl.abuseat.org!! (reason: "Blocked
- see http://cbl.abuseat.org/lookup.cgi?ip=88.165.118.202");;
Al ejecutar el .exe resultado de compilar:
OK - 37.215.241.150 checked, is not blacklisted
La idea es utilizar este ejecutable desde una máquina Windows 32 Bits sin la necesidad de utilizar perl directamente, de ahí la necesidad del ejecutable.
Agradeceré cualquier orientación.
Javier.