PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
alexus
Forum Contributor
Posts: 159 Joined: Fri Jul 04, 2003 10:49 pm
Post
by alexus » Tue Jul 15, 2003 6:59 pm
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
redhair
Forum Contributor
Posts: 300 Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:
Post
by redhair » Tue Jul 15, 2003 7:28 pm
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.
alexus
Forum Contributor
Posts: 159 Joined: Fri Jul 04, 2003 10:49 pm
Post
by alexus » Tue Jul 15, 2003 7:30 pm
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
redhair
Forum Contributor
Posts: 300 Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:
Post
by redhair » Tue Jul 15, 2003 7:38 pm
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');
?>
alexus
Forum Contributor
Posts: 159 Joined: Fri Jul 04, 2003 10:49 pm
Post
by alexus » Tue Jul 15, 2003 7:39 pm
hey, I have normal version of Windows here... the CMD is always in system32 folder...
Stoker
Forum Regular
Posts: 782 Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:
Post
by Stoker » Tue Jul 15, 2003 7:42 pm
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?
alexus
Forum Contributor
Posts: 159 Joined: Fri Jul 04, 2003 10:49 pm
Post
by alexus » Tue Jul 15, 2003 7:45 pm
cool, now what, turn security Off or give everyone execute permission?
alexus
Forum Contributor
Posts: 159 Joined: Fri Jul 04, 2003 10:49 pm
Post
by alexus » Tue Jul 15, 2003 7:46 pm
and if I'll set up new permission... is php using <machine_name>_IUSR or it uses some other service permission?
redhair
Forum Contributor
Posts: 300 Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:
Post
by redhair » Tue Jul 15, 2003 7:54 pm
Stoker wrote: fork is a unix/posix term, when a process starts another it's forking
Thx
Stoker
Forum Regular
Posts: 782 Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:
Post
by Stoker » Tue Jul 15, 2003 7:57 pm
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)..