Page 1 of 1
Post subject: Need help with System() or exec()
Posted: Tue Jul 15, 2003 6:59 pm
by alexus
For some reason system() doesn’t want to work…
I used this code:
Code: Select all
exec('C:\WINDOWS\system32\cmd.exe');
I’m running: WinXP SP1, IIS 5.1, PHP 4.3.2
Safe Mode is Off
You can check phpinfo() at
24.188.105.39:88/php/info.php
Re: Post subject: Need help with System() or exec()
Posted: Tue Jul 15, 2003 7:28 pm
by redhair
Change to:
Code: Select all
<?php
exec('C:\\WINDOWS\\system32\\cmd.exe');
?>
It's mentioned in the php manual, availible here:
http://www.php.net
When you would have typed 'exec' in the function list search box, you would have know the answer instantly, since one of the first comments in it refferes to your problem.
Posted: Tue Jul 15, 2003 7:30 pm
by alexus
I tried that before: it gives the same error:
Warning: exec(): Unable to fork [C:\WINDOWS\system32\cmd.exe] in c:\inetpub\wwwroot\php\mac\test_1.php on line 13
Posted: Tue Jul 15, 2003 7:38 pm
by redhair
Warning: exec(): Unable to fork [C:\WINDOWS\system32\cmd.exe] in c:\inetpub\wwwroot\php\mac\test_1.php on line 13
LOL unable to fork?
Thats a weird php version you have there, i never seen such cool error messages.
Maybe it would work if you tried?:
Code: Select all
<?php
exec('C:\\WINDOWS\\cmd.exe');
?>
Posted: Tue Jul 15, 2003 7:39 pm
by alexus
hey, I have normal version of Windows here... the CMD is always in system32 folder...
Posted: Tue Jul 15, 2003 7:42 pm
by Stoker
fork is a unix/posix term, when a process starts another it's forking
Somehow your webserver does not allow PHP for start another process, some sort of safety settings in IIS perhaps?
Posted: Tue Jul 15, 2003 7:45 pm
by alexus
cool, now what, turn security Off or give everyone execute permission?
Posted: Tue Jul 15, 2003 7:46 pm
by alexus
and if I'll set up new permission... is php using <machine_name>_IUSR or it uses some other service permission?
Posted: Tue Jul 15, 2003 7:54 pm
by redhair
Stoker wrote:fork is a unix/posix term, when a process starts another it's forking
Thx

Posted: Tue Jul 15, 2003 7:57 pm
by Stoker
I have no idea how Bill Gates compromised software does such.. simply put, the process owner must be allowed to execute the required process (as itself or with run-as permissions for the owner or whatever)..