httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pietro Cagnoni <pcagn...@mclink.net>
Subject Re: running system commands using perl script on linux
Date Wed, 27 Feb 2002 12:20:01 GMT
amit khatri wrote:
> 
> I have written a perl script which accepts input from a html
> page,and the job of the script is to execute what ever command is sent
> to it from the html page.
> 
>   I have used the post method to send the date, so the scrips reads
> the input from STDIN.
> 
> I execute the commands my placing them in the backquotes (`command`).
> 
> eg. @ans=`ls`;
> 
> I return the output in the form of html page to the client.
> 
> Some of my commands are executed, but some do not.
> 
> Commands that do not execute are
> 
> 1> "ipchains -n -L"
> 2> "netconf"
> 
> ------------------------------------------------------------------
> And also if i give an invalid command , i should get some error message
> like "command not present". But I don't get them either.
> 
> SHOULD I USE SOME MODULE LIKE "USE CGI" OR SOME OTHER.

0) IT'S A VERY DANGEROUS THING TO DO. BE CAREFUL WITH YOUR NETWORK
SECURITY.

1) the commands you can't execute are probably in /sbin or /usr/sbin,
which may be not in the script PATH.

2) if apache doesn't run as root, the commands ipchains and netconf will
probably fail anyway!

pietro.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message