Simple Post Scanner in PHP.
Wednesday, December 21, 2011
Anti-DDoS PHP Script
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");