Why do exec and proc_open work under a different user in IIS?

I run my site on Windows Server 2012 R2 and IIS 8.5 and I have a problem.

  • When I run exec('whoami') , it returns nt authority\iusr .
  • When I run proc_open('whoami', $desc, $pipes) , the result is iis apppool\mysite .

Why is this happening?

+5
source share
1 answer

It is interesting. This should be due to the nature of proc_open. Somehow it goes to the iis file, which has different permissions than the standard user used in IIS. proc_open, maybe you already know the requests that a higher level of control and php under windows probably need extra permissions to get this.

0
source

Source: https://habr.com/ru/post/1235026/


All Articles