You are here: Re: Key-passing from PHP to TCL CGI script - how is it done (web security issue)? « PHP Programming Language « IT news, forums, messages
Re: Key-passing from PHP to TCL CGI script - how is it done (web security issue)?

Posted by Steve on 10/07/05 00:10

> Unfortunately that is not the case. The provider does not allow
> storage outside of the docroot, else, that would of course solve
> everything as all of the TCL scripts would work outside of the docroot
> in that case.

Fair enough. Making this setup more secure must depend on where you
think the threat is coming from and how likely further exploits are.

If your hacked script was exploited randomly from the web with no
internal knowledge of how the form data would be used, you could just
use something simple like a password on the command line. That could
only be exploited by someone on the same server spying on ps (for
example.) I'm not sure you have really got to the bottom of how your
script got exploited so effectively to the extent that a payload was
delivered to your filesystem and executed (is that what happened?)

So I would recommend setting up a shared secret for both scripts. Pass
whatever arguments are required in clear on the command line plus a
hashed* combination of all the arguments and your password. The tcl
script should recreate this value and compare it with the passed
argument, rejecting the whole request if it doesn't match.

I can offer the PHP side, over to comp.lang.tcl for the other end...

$secret = "I like cheese";
$args = "$arg1 $arg2 $arg3 ";
$hash = md5( $args . $secret );

exec( "/path/to/tclscript $args $hash", $result );


*Yes, I know md5() could be compromised but, really, life is too
short...

---
Steve

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация