Note that there are some explanatory texts on larger screens.

plurals
  1. POApache able to execute file outside web server root directory
    primarykey
    data
    text
    <p>I have XAMP installed on my mac and I tried running the command - <code>ps axo user,group,comm | grep httpd</code> to know what user apache is running as. I am getting multiple results one for root and others as nobody. So what is apache running as? A root or nobody and why do I get both root and nobody? Is it because httpd started as a root and then became nobody?</p> <p>The result of <code>ps axo user,group,comm | grep httpd</code> I get is - </p> <pre> root 20 /Applications/XAMPP/xamppfiles/bin/httpd nobody -1 /Applications/XAMPP/xamppfiles/bin/httpd nobody -1 /Applications/XAMPP/xamppfiles/bin/httpd nobody -1 /Applications/XAMPP/xamppfiles/bin/httpd nobody -1 /Applications/XAMPP/xamppfiles/bin/httpd nobody -1 /Applications/XAMPP/xamppfiles/bin/httpd nobody -1 /Applications/XAMPP/xamppfiles/bin/httpd nobody -1 /Applications/XAMPP/xamppfiles/bin/httpd nobody -1 /Applications/XAMPP/xamppfiles/bin/httpd nobody -1 /Applications/XAMPP/xamppfiles/bin/httpd nobody -1 /Applications/XAMPP/xamppfiles/bin/httpd nobody -1 /Applications/XAMPP/xamppfiles/bin/httpd </pre> <p>Secondly, when I execute the following script - <code>echo shell_exec('whoami');</code> (from <a href="https://stackoverflow.com/questions/2509334/finding-out-what-user-apache-is-running-as">https://stackoverflow.com/questions/2509334/finding-out-what-user-apache-is-running-as</a>) I just get the result as - <code>nobody</code></p> <p>The reason I want to know the user is because the php engine is actually able to execute a php file(mysql_details.php) that's outside the web server root directory. And this mysql_details.php has following permissions - <code>rwxr--r--</code> i.e. just read permission for other and group. So if apache user is nobody then how can it execute mysql_details.php.</p> <p>Thanks, Prat.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload