PHP Trojans attack experts teach you how to resist them

  

Trojans We should have heard a lot, but the PHP Trojan is rarely heard, but the Trojan's lethality is not small, not preventive. This article introduces some techniques to introduce a defense against PHP Trojan attacks, through which you can better prevent Trojans.

1, prevent jumping out of the web directory

First modify httpd.conf, if you only allow your php script to operate in the web directory, you can also modify the httpd.conf file to limit the operation of php path. For example, if your web directory is /usr/local/apache/htdocs, add a few lines to httpd.conf:

php_admin_value open_basedir /usr/local/apache

/htdocs

This way, if the script wants to read files other than /usr/local/apache/htdocs will not be allowed, if the error is displayed, it will prompt such an error:

Warning: open_basedir restriction in Effect. File is in wrong directory in

/usr/local/apache/htdocs/open.php on line 4

Wait.

2, prevent php Trojan from executing webshell

Open safe_mode,

In php.ini, set

disable_functions= passthru, exec, shell_exec, system

You can choose either one or both

3. Prevent php Trojans from reading and writing file directories


in php.ini Disable_functions= passthru, exec, shell_exec, system

Functions followed by php processing files

Mainly

fopen,mkdir,rmdir,chmod,unlink,dir

fopen,fread,fclose,fwrite,file_exists

closeir,is_dir,readdir.opendir

fileperms.copy,unlink,delfile

Copyright © Windows knowledge All Rights Reserved