plzz alguna ayuda o sugerencia, si alguien sabe algo del archivo execute.cgi le dejo aqui porseacaso el codigo :)
tengo este codigo, pero no logro hacerlo funcionar tengo problemas con los permisos me sale este error...
You don't have permission to access /cgi-bin/executer.cgi on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Cita:
#!/usr/bin/perl
################################################## ########
################
##
##
##
The Executer
##
##
------------
##
## by Jimmy
([email protected])
##
##
http://www.smartCGIs.com
##
##
##
## This is a free script, if anyone sold it to you please
contact me. ##
## Please DO NOT remove any of the copyrights or links to
our site, ##
## they keep this CGI free for everyone. Thanks!
##
##
##
## (c) copyright 2000
SmartCGIs.com ##
################################################## ########
################
##
# This CGI will use the LWP module to grab the html output
from any web file (CGI, HTML, etc.)
# on any server and insert it into your own site. If all
you want to do is grab the contents of
# a normal (non-executable) file that is on your server,
you only need The Includer. Get it free
# at http://www.smartcgis.com . It has less requirements
and is faster.
#
# Tag to use:
# ==========
# Execute CGIs (on your server or externally) with a code
like this:
# <script
src="http://yourdomain.com/executer.cgi?http://domain.com/
test.cgi"></script>
# With "http://domain.com/test.cgi" being the URL to the
file you want to grab.
##
################################
## Edit the following... ##
################################
# Store the html data for later use?
# 1 = Yes
# 0 = No
# If this CGI will be run often for the same url/file it
is best to have this on.
# Instead of connecting to the same url it will store the
html for the next time it is requested.
$backup = "1";
# If you said yes above, how often should the data be
updated (in seconds)?
# 1 minute = 60 seconds
# 1 hour = 3600 seconds
# 1 day = 86400 seconds
# etc...
$bseconds = "3600";
# Optional: To keep others from using your CGI to grab
content from any site they want,
# you can specify the URLs that are allowed to be grabbed
with this CGI:
# (You can only grab files on the following sites...)
@sites =
('efirocom.siteprotect.net','www.efiro.com','efiro .com');
# Example: @sites =
('www.smartcgis.com','fr.smartcgis.com','yahoo.com ');
################################
## DO NOT edit anything below ##
################################
use LWP::Simple;
print "Content-type: text/html\n\n";
$url = $ENV{'QUERY_STRING'};
if($url eq "") {
print "document.writeln('<font color=red>( <b>Executer
Error:</b> No URL provided. )</font>');\n";
print "document.writeln('<p><center><small>Powered by <a
href=\"http://www.smartcgis.com\" target=\"_blank\">Smart
CGIs</a></small></center>');\n";
exit;
}
if($sites[0] ne "") {
$found = "1";
foreach $site(@sites) {
if($url =~ /$site/i) { $found = "0"; }
}
if($found eq "1") {
print "document.writeln('<font color=red>( <b>Executer
Error:</b> $url Not Approved by Admin. )</font>');\n";
print "document.writeln('<p><center><small>Powered by <a
href=\"http://www.smartcgis.com\" target=\"_blank\">Smart
CGIs</a></small></center>');\n";
exit;
}
}
if($backup eq 1) {
if(! -e "backup") { mkdir("backup", 0777) || print
"document.writeln('<center><font color=red>( Excluder
Error: Could not create directory \"backup\" ($!).
)</font><br> <small>Powered by <a
href=\"http://www.smartcgis.com\"
target=\"_blank\">SmartCGIs.com</a></small></center>');";
}
$time = time;
open(DATA,"lastbackup.txt");
$btime = <DATA>;
close(DATA);
if(($time - $btime) > $bseconds) { &deleteold; }
$eurl = '/home/www/efiro/index.html';
if(-e "$eurl2") {
open(DATA,"$eurl");
@html = <DATA>;
close(DATA);
} else {
$html = get($url);
@html = split(/\n/,$html);
open(DATA,">$eurl");
print DATA $html;
close(DATA);
open(DATA,"$eurl");
@html = <DATA>;
close(DATA);
}
} else {
$html = get($url);
@html = split(/\n/,$html);
}
if($html =~ /<frame/i) {
print "document.writeln('<font color=red>( <b>Executer
Error:</b> Does not work with pages that have frames on
them, sorry. )</font>');\n";
print "document.writeln('<p><center><small>Powered by <a
href=\"http://www.smartcgis.com\" target=\"_blank\">Smart
CGIs</a></small></center>');\n";
exit;
}
$count = 0;
foreach $line(@html) {
$count++;
chomp($line);
$line =~ s/\'/\\\'/g;
print "$line\n";
}
if($count eq 0) {
print "document.writeln('<font color=red>( <b>Executer
Error:</b> Unable to grab data from $url )</font>');\n";
}
# I can't stop you from removing this link to us, but I'd
appreciate it if you didn't, this is a free script.
# If you do remove, it'd be nice if you put up some other
form of link to SmartCGIs.com on your site, thanks!
print "document.writeln('<br><center><small>Powered by <a
href=\"http://www.smartcgis.com\" target=\"_blank\">Smart
CGIs</a></small></center>');\n";
sub deleteold {
opendir (DIR, "backup");
@files = grep { // } readdir(DIR);
close (DIR);
foreach $file(@files) { unlink("backup/$file"); }
open(DATA,">lastbackup.txt");
print DATA "$time";
close(DATA);
}
sub Encrypt {
my ($source,$key,$pub_key) = @_;
my
($cr,$index,$char,$key_char,$enc_string,$encode,$f irst,
$second,$let1,$let2,$encrypted,$escapes) = '';
$source = &rot13($source);
$cr = '·¨*';
$source =~ s/[\n\f]//g;
$source =~ s/[\r]/$cr/g;
while ( length($key) < length($source) ) { $key .=
$key }
$key=substr($key,0,length($source));
while ($index < length($source)) {
$char = substr($source,$index,1);
$key_char = substr($key,$index,1);
$enc_string .= chr(ord($char) ^ ord($key_char));
$index++;
}
for (0..255) { $escapes{chr($_)} = sprintf("%2x", $_);
}
$index=0;
while ($index < length($enc_string)) {
$char = substr($enc_string,$index,1);
$encode = $escapes{$char};
$first = substr($encode,0,1);
$second = substr($encode,1,1);
$let1=substr($pub_key, hex($first),1);
$let2=substr($pub_key, hex($second),1);
$encrypted .= "$let1$let2";
$index++;
}
return $encrypted;
}
sub Decrypt {
my ($encrypted, $key, $pub_key) = @_;
$encrypted =~ s/[\n\r\t\f]//eg;
my
($cr,$index,$decode,$decode2,$char,$key_char,$dec_ string,$
decrypted) = '';
while ( length($key) < length($encrypted) ) { $key .=
$key }
$key=substr($key,0,length($encrypted));
while ($index < length($encrypted)) {
$decode = sprintf("%1x", index($pub_key,
substr($encrypted,$index,1)));
$index++;
$decode2 = sprintf("%1x", index($pub_key,
substr($encrypted,$index,1)));
$index++;
$dec_string .= chr(hex("$decode$decode2"));
}
$index=0;
while( $index < length($dec_string) ) {
$char = substr($dec_string,$index,1);
$key_char = substr($key,$index,1);
$decrypted .= chr(ord($char) ^ ord($key_char));
$index++;
}
$cr = '·¨*';
$decrypted =~ s/$cr/\r/g;
return &rot13( $decrypted );
}
sub rot13{
my $source = shift (@_);
$source =~ tr /[a-m][n-z]/[n-z][a-m]/;
$source =~ tr /[A-M][N-Z]/[N-Z][A-M]/;
$source = reverse($source);
return $source;
}
################################################## ########
################
##
##
##
The Executer
##
##
------------
##
## by Jimmy
([email protected])
##
##
http://www.smartCGIs.com
##
##
##
## This is a free script, if anyone sold it to you please
contact me. ##
## Please DO NOT remove any of the copyrights or links to
our site, ##
## they keep this CGI free for everyone. Thanks!
##
##
##
## (c) copyright 2000
SmartCGIs.com ##
################################################## ########
################
##
# This CGI will use the LWP module to grab the html output
from any web file (CGI, HTML, etc.)
# on any server and insert it into your own site. If all
you want to do is grab the contents of
# a normal (non-executable) file that is on your server,
you only need The Includer. Get it free
# at http://www.smartcgis.com . It has less requirements
and is faster.
#
# Tag to use:
# ==========
# Execute CGIs (on your server or externally) with a code
like this:
# <script
src="http://yourdomain.com/executer.cgi?http://domain.com/
test.cgi"></script>
# With "http://domain.com/test.cgi" being the URL to the
file you want to grab.
##
################################
## Edit the following... ##
################################
# Store the html data for later use?
# 1 = Yes
# 0 = No
# If this CGI will be run often for the same url/file it
is best to have this on.
# Instead of connecting to the same url it will store the
html for the next time it is requested.
$backup = "1";
# If you said yes above, how often should the data be
updated (in seconds)?
# 1 minute = 60 seconds
# 1 hour = 3600 seconds
# 1 day = 86400 seconds
# etc...
$bseconds = "3600";
# Optional: To keep others from using your CGI to grab
content from any site they want,
# you can specify the URLs that are allowed to be grabbed
with this CGI:
# (You can only grab files on the following sites...)
@sites =
('efirocom.siteprotect.net','www.efiro.com','efiro .com');
# Example: @sites =
('www.smartcgis.com','fr.smartcgis.com','yahoo.com ');
################################
## DO NOT edit anything below ##
################################
use LWP::Simple;
print "Content-type: text/html\n\n";
$url = $ENV{'QUERY_STRING'};
if($url eq "") {
print "document.writeln('<font color=red>( <b>Executer
Error:</b> No URL provided. )</font>');\n";
print "document.writeln('<p><center><small>Powered by <a
href=\"http://www.smartcgis.com\" target=\"_blank\">Smart
CGIs</a></small></center>');\n";
exit;
}
if($sites[0] ne "") {
$found = "1";
foreach $site(@sites) {
if($url =~ /$site/i) { $found = "0"; }
}
if($found eq "1") {
print "document.writeln('<font color=red>( <b>Executer
Error:</b> $url Not Approved by Admin. )</font>');\n";
print "document.writeln('<p><center><small>Powered by <a
href=\"http://www.smartcgis.com\" target=\"_blank\">Smart
CGIs</a></small></center>');\n";
exit;
}
}
if($backup eq 1) {
if(! -e "backup") { mkdir("backup", 0777) || print
"document.writeln('<center><font color=red>( Excluder
Error: Could not create directory \"backup\" ($!).
)</font><br> <small>Powered by <a
href=\"http://www.smartcgis.com\"
target=\"_blank\">SmartCGIs.com</a></small></center>');";
}
$time = time;
open(DATA,"lastbackup.txt");
$btime = <DATA>;
close(DATA);
if(($time - $btime) > $bseconds) { &deleteold; }
$eurl = '/home/www/efiro/index.html';
if(-e "$eurl2") {
open(DATA,"$eurl");
@html = <DATA>;
close(DATA);
} else {
$html = get($url);
@html = split(/\n/,$html);
open(DATA,">$eurl");
print DATA $html;
close(DATA);
open(DATA,"$eurl");
@html = <DATA>;
close(DATA);
}
} else {
$html = get($url);
@html = split(/\n/,$html);
}
if($html =~ /<frame/i) {
print "document.writeln('<font color=red>( <b>Executer
Error:</b> Does not work with pages that have frames on
them, sorry. )</font>');\n";
print "document.writeln('<p><center><small>Powered by <a
href=\"http://www.smartcgis.com\" target=\"_blank\">Smart
CGIs</a></small></center>');\n";
exit;
}
$count = 0;
foreach $line(@html) {
$count++;
chomp($line);
$line =~ s/\'/\\\'/g;
print "$line\n";
}
if($count eq 0) {
print "document.writeln('<font color=red>( <b>Executer
Error:</b> Unable to grab data from $url )</font>');\n";
}
# I can't stop you from removing this link to us, but I'd
appreciate it if you didn't, this is a free script.
# If you do remove, it'd be nice if you put up some other
form of link to SmartCGIs.com on your site, thanks!
print "document.writeln('<br><center><small>Powered by <a
href=\"http://www.smartcgis.com\" target=\"_blank\">Smart
CGIs</a></small></center>');\n";
sub deleteold {
opendir (DIR, "backup");
@files = grep { // } readdir(DIR);
close (DIR);
foreach $file(@files) { unlink("backup/$file"); }
open(DATA,">lastbackup.txt");
print DATA "$time";
close(DATA);
}
sub Encrypt {
my ($source,$key,$pub_key) = @_;
my
($cr,$index,$char,$key_char,$enc_string,$encode,$f irst,
$second,$let1,$let2,$encrypted,$escapes) = '';
$source = &rot13($source);
$cr = '·¨*';
$source =~ s/[\n\f]//g;
$source =~ s/[\r]/$cr/g;
while ( length($key) < length($source) ) { $key .=
$key }
$key=substr($key,0,length($source));
while ($index < length($source)) {
$char = substr($source,$index,1);
$key_char = substr($key,$index,1);
$enc_string .= chr(ord($char) ^ ord($key_char));
$index++;
}
for (0..255) { $escapes{chr($_)} = sprintf("%2x", $_);
}
$index=0;
while ($index < length($enc_string)) {
$char = substr($enc_string,$index,1);
$encode = $escapes{$char};
$first = substr($encode,0,1);
$second = substr($encode,1,1);
$let1=substr($pub_key, hex($first),1);
$let2=substr($pub_key, hex($second),1);
$encrypted .= "$let1$let2";
$index++;
}
return $encrypted;
}
sub Decrypt {
my ($encrypted, $key, $pub_key) = @_;
$encrypted =~ s/[\n\r\t\f]//eg;
my
($cr,$index,$decode,$decode2,$char,$key_char,$dec_ string,$
decrypted) = '';
while ( length($key) < length($encrypted) ) { $key .=
$key }
$key=substr($key,0,length($encrypted));
while ($index < length($encrypted)) {
$decode = sprintf("%1x", index($pub_key,
substr($encrypted,$index,1)));
$index++;
$decode2 = sprintf("%1x", index($pub_key,
substr($encrypted,$index,1)));
$index++;
$dec_string .= chr(hex("$decode$decode2"));
}
$index=0;
while( $index < length($dec_string) ) {
$char = substr($dec_string,$index,1);
$key_char = substr($key,$index,1);
$decrypted .= chr(ord($char) ^ ord($key_char));
$index++;
}
$cr = '·¨*';
$decrypted =~ s/$cr/\r/g;
return &rot13( $decrypted );
}
sub rot13{
my $source = shift (@_);
$source =~ tr /[a-m][n-z]/[n-z][a-m]/;
$source =~ tr /[A-M][N-Z]/[N-Z][A-M]/;
$source = reverse($source);
return $source;
}