Entire root readable?

Discussion in 'General' started by NeeChee, Apr 28, 2010.

  1. NeeChee

    NeeChee New Member

    When using the following PHPcode, I could access literally any file I want... I don't suppose it's supposed to do that...

    PHP:
    echo file_get_contents("/etc/<ANYFILE>");
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    That depends on your php.ini settings and the php method that you selected for the website.
     
  3. NeeChee

    NeeChee New Member

    What would be the cause for php.ini to allow this? Which setting?

    PHPmode is on Fast-CGI. The options CGI scripts, SSI (CGI)and SuEXEC are all disabled
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    If you use fastcgi, you should always enable suexec as this ensures that the php scripts run uner the user of the website. Also you should set the open_basedir path in the cgi php.ini to /var/www and then disable function like exec, passthru and system in the php.ini
     
  5. NeeChee

    NeeChee New Member

    Won't disabling these functions affect any php-scripts?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Of course it affects some php scripts, especially backdoors ;) but not any common php scripts like cms sytems as they dont call extrnal shell scripts.
     
  7. NeeChee

    NeeChee New Member

    Thanks a million!
     
  8. NeeChee

    NeeChee New Member

    After I did the above, some website suddenly stopped working and I got a "No input file specified." line when visiting them.
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Check the error log file of the websites. Most likely the files were owned by a wrong Linux user.
     

Share This Page