PHP Trojans attack defense

Source: Internet
Author: User
Attack | Trojan Horse

1. To prevent out web directory
First Change httpd. conf, if you are only allowed to your PHP scripts in web directory in the operation, you can also modify the httpd. CONF file PHP limits the operation of the path. For example, your web directory is/usr/local/Apache/htdoCS, then in httpd. conf in with so few lines:

PHP_admin_value open_basedir/usr/local/Apache/htdoCS

In this way, if the script to read/usr/local/Apache/htdoCS file will not be allowed, if the error show open. php:

Warning: open_basedir restriction in effect. The File is in the wrong directory in

/Usr/local/Apache/htdoCS/open. PHP on line 4

And so on.

2. To prevent PHP Trojan executive webshell

Open the safe_mode,

In PHP. ini setting

Disable_functions = passthru, exec, shell_exec, System


Two. A can, can also be all.


3. To prevent PHP Trojan read and write files directory

In PHP. ini in

Disable_functions = passthru, exec, shell_exec, System

Add PHP files Function

The main

Fopen, mkdir, rmdir, chmod, unlink, Dir

Fopen, fread, fclose, fwrite, file_exists



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.