Hey thanks for the reply, I created two files: index.php:
$user = posix_getpwuid(posix_geteuid())['name']; print "Executing as {$user}<br />\n";print shell_exec("php hello.php");
and hello.php
print "Hello<br />\n";
Running the index.php from command line works fine, outputting "Executing as <user><br />Hello", as expected
php index.php
Running the same file from localhost/index.php outputs "Executing as Nobody" as expected, but does not output the shell_exec() command. (Presumably because it's running as Nobody) But then when I run the following command:
sudo -u nobody php index.php
I get the same output as through localhost, but it does show the output of the shell_exec().Any ideas as to why?