Create a directory anti_ddos and throw all the scripts there:
index.php (DDOS attacks detection module):
index.php (DDOS attacks detection module):
anti_ddos.php (module redemption DDOS attacks):
PHP Code:
Also, for the script will need 4 files check.txt, white_ip.txt, black_ip.txt all_ip.txt and create them in the same directory and all the rights set 666 (read and write).
It is also desirable during the attack lists of IP addresses the attackers machine, the file transfer black_ip.txt gradually. Htaccess file and block them out, then the load is still considerably lower.
Example of a file. Htaccess
Code:
Deny from 11.11.11.11 22.22.22.22 etc. through gap
To connect the script at the beginning of each file, which can be subjected to attack, add the line:
PHPCode:
require ("anti_ddos/index.php");
Just bookmarked this blog. Big thanks for great and useful articles. Keep posting :)
ReplyDeleteBTW is the index.php and i cant replace on the index ~~ how to do help me
ReplyDeletePlease correct your Scripts. There are a lot of Spaces !
ReplyDeleteExample:
if (! file_exists ("{$ ad_dir} / {$ ad_check_file}")...
must be:
if (!file_exists("{$ ad_dir}/{$ ad_check_file}") ...
Thank You
i have also posted an effective anti ddos plugin. please check it out here: http://www.w3tools.info/2012/05/protect-ddos-attack-with-medialayer.html
ReplyDeleteporque al abrir el anti_ddos.php me da el error 500 , tiene que ser asi o esta bien?
ReplyDelete