CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
system commands via perl

 



rmartin
stranger

Aug 12, 2001, 7:29 AM

Post #1 of 4 (921 views)
system commands via perl Can't Post

I am trying to find out how to perform system commands via a web browser... eg) creating a directory on a server.

I have see similar things whereby a command such as

http://domain.com/cgi-bin/filename.cgi?make_dir

can anyone provide me with any examples, plus how would i need to set up permissions, as this would seem dangerous if anyone could just do it remotely

Thanks in advance

R Martin



fashimpaur
User / Moderator

Aug 13, 2001, 10:46 AM

Post #2 of 4 (907 views)
Re: system commands via perl [In reply to] Can't Post

Do you really want to do this?

Because, if I can execute system commands, then I
could call perl outside of cgi and if I can to that, then anyone who gets the URL can do the same. If they do, then they can try to do 'unlink *.*' and delete all files on your hard drive, or worse.

Think about it. I would not okay a script on my web server that could do that.

Just some advice,

Dennis

$a="c323745335d3221214b364d545a362532582521254c3640504c37292f493759214b3635554c3040606a0",print unpack"u*",pack "h*",$a,"\n\n"


rmartin
stranger

Aug 13, 2001, 10:54 AM

Post #3 of 4 (904 views)
Re: system commands via perl [In reply to] Can't Post

thanks for the reply....

i was thinking more about how this is achieved. I am interesting in doing a small web based control panel for customers and want to find out how existing control panel achieve things such as creating directorys and configuring email via the control panel as what you mentioned is quite an issue.

I am looking for an example of the script i would need to perform and action


any help is appreciated



fashimpaur
User / Moderator

Aug 13, 2001, 1:19 PM

Post #4 of 4 (902 views)
Re: system commands via perl [In reply to] Can't Post

In this case, give them a form that limits the choices of system commands that you will let it do. Then, have the script evaluate in advance what is being requested and if it is okay to perform, then do the system call from the script. Some scripts may have limits based on the fact that a web user is user 'Nobody' on most web servers and may have severely limited options. So, it may have to execute a stand alone script on the server that is run via the system() command which is passed the value as an argument.

HTH,

Dennis

$a="c323745335d3221214b364d545a362532582521254c3640504c37292f493759214b3635554c3040606a0",print unpack"u*",pack "h*",$a,"\n\n"

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives