// ******************************************************** ***********
I wrote a php web shell, huh, I also feel powerful, so I don't feel the PHP function.
It must be able to control the corresponding PHP back door, let the server are safe, and find it online.
Article, very good, transferred! By Heiyeluren
// ******************************************************** ***********
This article introduces some tips to introduce PHP
Trojan attack defense, through these respects you can better prevent Trojans.
1, prevent the web directory
First modify httpd.conf, if you only allow your PHP script to operate in a web directory, you can also modify the HTTPD.conf file to limit the PHP's operation path. For example, your web directory is / usr / local / apache / htdocs, then plus such a few lines in httpd.conf:
PHP_ADMIN_VALUE OPEN_BASEDIR / USR / LOCAL / APACHE / HTDOCS
This way, if the script is read / usr / local / apache / htdoCs will not be allowed, if the error is displayed, this error is prompted:
Warning: Open_Basedir Restriction in Effect. File is in Wrong Directory in
/usr/local/apache/htdocs/open.php on line 4
and many more.
2. Prevent PHP Trojan to perform WebShell
Open SAFE_MODE,
Setting in pHP.INI
Disable_functions = passthru, exec, shell_exec, system
Options can be selected, and you can also choose 3 to prevent PHP Trojan read and write file directories.
In pHP.ini
Disable_functions = passthru, exec, shell_exec, system
After adding a function of PHP processing files
There are
Fopen, Mkdir, Rmdir, Chmod, Unlink, Dir
Fopen, Fread, Fclose, Fwrite, File_exists
CloseDir, is_dir, readdir.opendir
FILEPERMS.COPY, Unlink, Delfile
Be
Disable_functions = passthru, exec, shell_exec, system, fopen, mkdir, rmdir, chmod, unlink, DIR
, Fopen, Fread, Fclose, Fwrite, File_exists
, Closedir, IS_DIR, ReadDir.Opendir
Fileperms.copy, unlink, Delfile
OK, I am very gone, PHP Trojan is nothing, ^ _ ^
Unfortunately, this is what the text is used to use the text database.
If we need to pay attention to the Apache built under the Windos platform, Apache's default run is System permissions, which is terrible, which makes people feel very uncomfortable. Then we give apache to drop permission. Net User Apache FuckMicrosoft / Add
Net localgroup users apache / del
We established a user APCHE that is not belonging to any group.
We open the computer manager, select the service, click the properties of the Apache service. We choose LOG ON, select this Account, we fill in the account and password established above, restart the Apache service, OK, and apache run in low rights. In fact, we can also let the Apache users can do things that we want to make things to do by setting the permissions of each folder, and create a separately read-write user. This is also the popular configuration method of many virtual host providers, but this method is used to prevent a bit large material from which it will be significantly used.
// from:
Http://www.ty22.com/2004/12-5/14365710541.html
/ / The original text should be from 54hack.info