Bug #27051 [Fbk]: Impersonation with FastCGI does not EXEC process as impersonated user

From: Date: Wed, 24 Mar 2010 23:11:57 +0000
Subject: Bug #27051 [Fbk]: Impersonation with FastCGI does not EXEC process as impersonated user
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148970@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=27051&edit=1

 ID:               27051
 Updated by:       pajoye@php.net
 Reported by:      ghoffer at globalscape dot com
 Summary:          Impersonation with FastCGI does not EXEC process as
                   impersonated user
 Status:           Feedback
 Type:             Bug
 Package:          CGI related
 Operating System: Windows
 PHP Version:      5.3
 Assigned To:      pajoye

 New Comment:

echo exec('c:\Windows\System32\whoami'); can't work.

echo exec('c:\\Windows\\System32\\whoami'); should work.


Previous Comments:
------------------------------------------------------------------------
[2010-03-25 00:09:56] heer2351 at zonnet dot nl

Box is behind a company firewall so you can unfortunately not access
it.
This is an intranet site.

------------------------------------------------------------------------
[2010-03-25 00:08:31] heer2351 at zonnet dot nl

This is what I ran:
<?php
echo exec('c:\Windows\System32\whoami');
?> 

ProcMon shows cmd.exe being started by php-cgi.exe
A thread is created running as the correct user.
Excecuted command is: cmd.exe /c "c:\Windows\System32\whoami"

I do notice that the process exits with Exit Status 5, which is normally
access denied.

I have however already tried to give Everyone full access to the whole
machine, i.e. all drives. Still the same error.

------------------------------------------------------------------------
[2010-03-25 00:04:10] pajoye@php.net

btw, is it possible to access this box? I could try to debug what's
wrong there as it works just fine with the same constellation here (same
windows, IIS and fcgi versions).

------------------------------------------------------------------------
[2010-03-25 00:00:09] pajoye@php.net

It is not the same context using runas or impersonate.

Did you use "c:\\....\\whoami" or "cmd /c..."?

------------------------------------------------------------------------
[2010-03-24 23:58:27] heer2351 at zonnet dot nl

Result:
PHP Warning: exec(): Unable to fork [c:\Windows\System32\whoami] in
D:\Web\Public\Typo3\v4_2_6\fdha_hr\hr\forkTest.php on line 2

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=27051


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=27051&edit=1


Thread (50 messages)

« previous php.bugs (#148970) next »