Sponsored Content
Top Forums Web Development Accessing a Perl CGI script, security issue Post 302339150 by z1dane on Thursday 30th of July 2009 12:49:07 AM
Old 07-30-2009
Accessing a Perl CGI script, security issue

Hi Everybody,

I was wondering if it was possible for someone to gain access to my Perl CGI scripts before they are interpreted by Perl (mod_perl on apache2) i.e. getting a hold of my raw scripts and not the html output?

Let's say I use the DBI module where I have the hostname, user and password stored in my CGI script (currently I store these parameters in another file and the user only has select privileges anyway), is there a way to prevent someone from getting the script as it is (if it is possible)?

Many thanks,

Dave
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

concurrency issue while Accessing Mail Box from shell script

Hi Bros, I am in a serious trouble with concurrency issue while using mailx. I have a shell script which reads all the emails of a unix user account and create a copy (another mbox for processing and archive purpose). This script works fine for 99.99% of the time but sometime it start creating... (2 Replies)
Discussion started by: Sumit_Fundoo
2 Replies

2. Shell Programming and Scripting

[Perl] Accessing array elements within a sed command in Perl script

I am trying to use a script to replace the header of each file, whose filename are stored within the array $test, using the sed command within a Perl script as follows: $count = 0; while ( $count < $#test ) { `sed -e 's/BIOGRF 321/BIOGRF 332/g' ${test} > 0`; `cat 0 >... (2 Replies)
Discussion started by: userix
2 Replies

3. Shell Programming and Scripting

call shell script from perl cgi script problem

hi,, i have perl scipt with line : system('./try.sh $t $d $m'); in shell scipt try.sh i have the line: echo $1 its not printing value of $t that i hav passed..y is it so..i am running it from apache web server (2 Replies)
Discussion started by: raksha.s
2 Replies

4. Web Development

in cgi perl script a form

hi,i hav a form in cgi perl script.this script accepts a value from user from another html form, and depending upon this value,i need to disable /enable radio buttons in cgi-perl script wen second page is displayed on executing cgi perl script.how do i do it using javascript? (0 Replies)
Discussion started by: raksha.s
0 Replies

5. Web Development

perl cgi script not working

Hello, Met a problem learning perl cgi script. 1 #!/usr/bin/perl -wT 2 3 use strict; 4 use CGI qw(:standard); 5 6 my $q = new CGI; 7 8 my $filename = $q->param('/home/yifangt/hello.cgi'); 9 my $contenttype = $q->uploadInfo($filename)->{'Content-Type'}; 10... (5 Replies)
Discussion started by: yifangt
5 Replies

6. Web Development

problem with exporting vairable from one perl cgi to another perl cgi script while redirecting.

Can anyone tell me how to export a variable from one perl CGI script to another perl cgi script when using a redirect. Upon running the login.pl the user is prompted to enter user name and password. Upon entering the correct credentials (admin/admin) the user is redirected to welcome page. My... (3 Replies)
Discussion started by: Arun_Linux
3 Replies

7. Programming

CGI Perl script to execute bash script- unable to create folder

Hi I have a bash script which takes parameters sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash I have... (0 Replies)
Discussion started by: rakeshkumar
0 Replies

8. Shell Programming and Scripting

Perl : embedding java script with cgi perl script

Hi All, I am aware that html tags can be embedded in cgi script as below.. In the same way is it possible to embed the below javascript in perl cgi script ?? print("<form action="action.htm" method="post" onSubmit="return submitForm(this.Submitbutton)">"); print("<input type = "text"... (1 Reply)
Discussion started by: scriptscript
1 Replies

9. Shell Programming and Scripting

Perl cgi pages out of cgi-bin folder in WINDOWS

Hi team, I have a typical problem with cgi pages in apache webserver in WINDOWS I am able to execute(display) the pages that are saved in cgi-bin folder. But I am not able to execute the pages stored in htdocs or other folder other than cgi-bin folder. Could anyone please let me know how... (1 Reply)
Discussion started by: scriptscript
1 Replies

10. Shell Programming and Scripting

Perl CGI : unable to download the excel sheet from perl cgi page

Hi All, I have written an cgi perl script that displays an image(Excel image) and when clicked on that Image I need to download a excel sheet. I made sure that excel sheet exists in the folder with the given name but still I am not able to download the sheet. print "<center><table... (2 Replies)
Discussion started by: scriptscript
2 Replies
CGI::PSGI(3pm)						User Contributed Perl Documentation					    CGI::PSGI(3pm)

NAME
CGI::PSGI - Adapt CGI.pm to the PSGI protocol SYNOPSIS
use CGI::PSGI; my $app = sub { my $env = shift; my $q = CGI::PSGI->new($env); return [ $q->psgi_header, [ $body ] ]; }; DESCRIPTION
This module is for web application framework developers who currently uses CGI to handle query parameters, and would like for the frameworks to comply with the PSGI protocol. Only slight modifications should be required if the framework is already collecting the body content to print to STDOUT at one place (rather using the print-as-you-go approach). On the other hand, if you are an "end user" of CGI.pm and have a CGI script that you want to run under PSGI web servers, this module might not be what you want. Take a look at CGI::Emulate::PSGI instead. Your application, typically the web application framework adapter should update the code to do "CGI::PSGI->new($env)" instead of "CGI->new" to create a new CGI object. (This is similar to how CGI::Fast object is initialized in a FastCGI environment.) INTERFACES SUPPORTED
Only the object-oriented interface of CGI.pm is supported through CGI::PSGI. This means you should always create an object with "CGI::PSGI->new($env)" and should call methods on the object. The function-based interface like "use CGI ':standard'" does not work with this module. METHODS
CGI::PSGI adds the following extra methods to CGI.pm: env $env = $cgi->env; Returns the PSGI environment in a hash reference. This allows CGI.pm-based application frameworks such as CGI::Application to access PSGI extensions, typically set by Plack Middleware components. So if you enable Plack::Middleware::Session, your application and plugin developers can access the session via: $cgi->env->{'plack.session'}->get("foo"); Of course this should be coded carefully by checking the existence of "env" method as well as the hash key "plack.session". psgi_header my ($status_code, $headers_aref) = $cgi->psgi_header(%args); Works like CGI.pm's header(), but the return format is modified. It returns an array with the status code and arrayref of header pairs that PSGI requires. If your application doesn't use "$cgi->header", you can ignore this method and generate the status code and headers arrayref another way. psgi_redirect my ($status_code, $headers_aref) = $cgi->psgi_redirect(%args); Works like CGI.pm's redirect(), but the return format is modified. It returns an array with the status code and arrayref of header pairs that PSGI requires. If your application doesn't use "$cgi->redirect", you can ignore this method and generate the status code and headers arrayref another way. LIMITATIONS
Do not use CGI::Pretty or something similar in your controller. The module messes up CGI's DIY autoloader and breaks CGI::PSGI (and potentially other) inheritance. AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net> Mark Stosberg <mark@summersault.com> LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
CGI, CGI::Emulate::PSGI perl v5.12.4 2011-08-29 CGI::PSGI(3pm)
All times are GMT -4. The time now is 03:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy