Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The main problem for you is, <strong>how do these files came here</strong>?</p> <p>Several possibilities:</p> <ul> <li>the FTP client of someone having FTP access to the server is hit by a virus. This is an easy way to put PHP scripts on web server for hackers. So run a recent antivirus on all computers having access via FTP to your webserver</li> <li>the webserver uns several web applications and one of them is really bad, so do not forget to check all web applications, and maybe try to set different open_basedir restrictions on each web application (put that in virtualhosts). Study how to set per-application php settings with <code>php_value</code> instructions and adapt at least <code>open_basedir</code>, <code>upload_tmp_dir</code> and <code>session.save_path</code></li> <li>your current web application allows files to be uploaded on directories, check all your file uploads snippets, and read the <a href="http://phpsec.org/projects/guide/" rel="nofollow">PHPSec Security Guide</a> (and any other resource on PHP security like the Architect's Guide To PHP Security by Ilia Alshanetsky ) to fix them.</li> <li>if you cannot fix the application, then study solutions proxing the application with some security rules, filtering user inputs, like, maybe, <code>mod_security</code>, but they're others.</li> </ul> <p>To avoid execution of PHP scripts on directories which should not contain php scripts (like your upload folders) you can add this rule (either in a <code>&lt;Directory&gt;</code> section or .htaccess):</p> <pre><code>AddType text/plain .php AddType text/plain .phps AddType text/plain .php3 AddType text/plain .php4 AddType text/plain .php5 Options -Indexes </code></pre> <p>This will force all php files from this directory to be served as simple text. Another solution is to force a lot of extensions to become cgi scripts, and then to disallow execution of cgi-scripts:</p> <pre><code>Options -ExecCGI AddHandler cgi-script .php .php3 .php4 .php5 .phps .phtml .pl .py .jsp .asp .htm .shtml .sh .cgi </code></pre> <p>You could also limit the file allowed there based on extensions (here if it is not an image it's forbidden):</p> <pre><code>&lt;Files ^(*.jpeg|*.jpg|*.png|*.gif)&gt; order deny,allow deny from all &lt;/Files&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    1. VO
      singulars
      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