using QUERY_STRING in an exec command

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
pallie
-


Joined: 20 Feb 2005
Posts: 3

PostPosted: Sun Feb 20, 2005 10:34 pm    Post subject: using QUERY_STRING in an exec command Reply with quote

Hi, I want to be able to use a query string in an exec command, so that if I type
Code:
http://localhost/index.shtml?program.exe
it will run program.exe. I tried
Code:
<!-- #exec cmd=&QUERY_STRING -->
<!-- #exec cmd=QUERY_STRING -->
<!-- #exec cmd="&QUERY_STRING" -->
but none of them worked.

Thanks

Mike

PS: brilliant product!
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Feb 21, 2005 1:27 am    Post subject: Re: using QUERY_STRING in an exec command Reply with quote

pallie,

These SSI directives aren't conforming to the standard directives supported by Abyss Web Server. That's why it doesn't work.

A script in PHP, Perl or any other scripting language can solve the problem. For example in PHP:

Code:

<?php
      system($_SERVER['QUERY_STRING']);
?>


Of course, you should be careful with such a script/SSI page because it can open a security breach on your computer (it can be used to execute anything on your computer, adding a better security or some restrictions is a good idea.)
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
pallie
-


Joined: 20 Feb 2005
Posts: 3

PostPosted: Mon Feb 21, 2005 10:48 am    Post subject: Reply with quote

Thanks for your reply. I was hoping to do it without installing further components but I guess I'll need to.

Thanks for the warning - I want to be able to remotely run a program over my home network, for example to mute one PC by running a program on another. I have a script that will toggle the mute on the target PC, I want to be able to trigger it. I can do this by sending

<!-- #exec cmd="mute.exe"-->

but I have quite a few different things I want to do, for example volume up, volume down, next CD track so I thought I could have the program and parameters set dynamically from the URL such as
Code:

http://localhost/index.shtml?vol.exe up

http://localhost/index.shtml?vol.exe down

http://localhost/index.shtml?track.exe next

http://localhost/index.shtml?track.exe prev

I guess I could just have a different html file for each command I want - it only needs to be a one liner.

I'm assuming that as my LAN is behind a firewall, then it will not be possible for anyone outside to access it.

Mike
Back to top View user's profile Send private message
k1ll3rdr4g0n
-


Joined: 04 Jul 2004
Posts: 609

PostPosted: Mon Feb 21, 2005 6:10 pm    Post subject: Reply with quote

Do you want to control your computer remotely?
_________________
Back to top View user's profile Send private message AIM Address
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue Feb 22, 2005 1:10 am    Post subject: Reply with quote

pallie,

If you don't want to install PHP and want to have security, we recommend creating for each remote action you want to perform a SSI page. For example:

Code:

<HTML>
<BODY>
I will run mute...
<!-- #exec cmd="mute.exe"-->
</BODY>
</HTML>


Put the above code in mute.shtml .

Create also vol.shtml and track-prev.shtml for example using the same template.

This way, there is no risk of executing anything except mute.exe (and other commands you've coded.) You also rely only on SSI.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
pallie
-


Joined: 20 Feb 2005
Posts: 3

PostPosted: Tue Feb 22, 2005 2:54 pm    Post subject: Reply with quote

Thanks, I tried that and it works a treat

Mike
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group