Forum Moderators: coopster & phranque

Message Too Old, No Replies

cgiwrap question

Can I turn it off?

         

WebGuerrilla

5:04 pm on Jun 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've got a perl script that was written to grab the file name from the environmental variable script_filename

The problem I'm having is that server (Cobalt Raq) is returning
/usr/cgiwrap/cgiwrap as the script name.

That's causing the links and forms on the generated page to look like

[mysite.com...]

Instead of

[mysite.com...]

Will turning off cgiwrap on this virtual site fix the problem?

toolman

5:43 pm on Jun 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm no scripting guru by any means but I have Cobalt sites and yes this is a pain.

Perhaps manually placing the absolute path into the script (/home/sites/www.mysite.com/web )instead of allowing it to try and determine it will fix it. Unless you are the admin for the server don't count on getting the cgiwrap turned off.

sugarkane

6:27 pm on Jun 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've never used a Cobalt, but it might be worth trying script_name rather than script_filename

If you're on a shared server I wouldn't recommend turning cgiwrap off...

WebGuerrilla

6:47 pm on Jun 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




A couple of thingd I forgot to mention. The Raq is a dedicated box that I lease. The only other sites on it are ones I run.

The script in question is encrypted, so I can't view or edit the code. The author is in Malaysia. The lag time in his responses is quite long, and when he does reply, he hasn't been much help.

his last reply:

>you get cgiwrap as filename probably because you have another script named cgiwrap and you massed them up. try to install the script in some other directories which do not have conflicts.

I waited 24 hours for that.. :(

Is there a way I can get to the source so I can look at it?

sugarkane

7:01 pm on Jun 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>The only other sites on it are ones I run

Ah, that removes the major need to have cgiwrap. Yes, turning it off should fix the problem.

>get to the source

Not sure, the only way I can think of encrypting is using the compiler - if that's the case you could try

perl -MO=Deparse script.pl

from the command line to reconstruct the perl source.

WebGuerrilla

7:21 pm on Jun 11, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




Thanks SK,

I'll give it a try.

WebGuerrilla

6:29 am on Jun 13, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



O.K., I got the initial problem fixed. The strange thing is that editing the virtual site entry in the httpd.conf file didn't seem to have any effect.

I changed

AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl

to

AddHandler cgi-script .cgi
AddHandler cgi-script .pl

Shouldn't that turn off cgiwrap for that individual site?

Since it didn't work, I put a .htaccess in the script directory with

Options +ExecCGI
AddHandler cgi-script .cgi
AddHandler cgi-script .pl

And that seemed to do the trick.

As far as trying to view the source goes, running the compiler didn't work. I'm really bummed it didn't because now that I've got it working I've discovered that all the html output the script generates was done in FrontPage. Since the output is going to be dumped into optimized templates, I want the code to match.

I'm determined to edit this script!

Here's what a chunk looks like.

#!/usr/bin/perl
# >>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
$lBEAXDEAXCCAXADDDXACCXACCXABDDXBABXECDXDBDDXECBXDDDXABAAXDEBXADEXB

Does it look familiar to anyone? I've found a few perl modules that do this, but I don't know how to figure out how to reverse it.

evinrude

7:04 pm on Jun 13, 2001 (gmt 0)

10+ Year Member



Just a sidenote..... I think I've already admitted to being a paranoid SOB....

>>The only other sites on it are ones I run
>Ah, that removes the major need to have cgiwrap. Yes, turning it off
>should fix the problem.

I'd suggest that even if you own all the sites, if you are running CGIs that you haven't read (ie...they are encrypted) or tested, then cgi-wrapper is a good thing to use. :)

Froggyman

8:48 pm on Jun 13, 2001 (gmt 0)



I don't know if this is the same cgiwrap but maybe it will help.
[download.sourceforge.net...]

sugarkane

11:24 pm on Jun 14, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>Does it look familiar to anyone?

It certainly looks like some form of compiled code (byteperl maybe?)

AFAIK there's no way of decompiling it other than the MO=Deparse method without getting into some serious coding :(