A denial-of-service attack (DoS attack) or distributed denial-of-service attack (DDoS attack) is an attempt to make a computer or network resource unavailable to its intended users.
Method 1: Anti iframe
Method 2: Anti-reload malicious website
If you are attacked like this, you set up your files .htaccess with the content:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain.com [NC]
RewriteRule !antiddos.phtml http://www.domain.com/antiddos.phtml?%{REQUEST_URI} [QSA]
Then create a file antiddos.phtml with content
$text = $HTTP_SERVER_VARS['QUERY_STRING'];
$text = preg_replace("#php\&#si",'php?',$text);
echo("
'');
?>
You add the following code to the home page of the website.
function server_busy($numer) {
if (THIS_IS == 'WEBSITE' && PHP_OS == 'Linux' and @file_exists ( '/proc/loadavg' ) and $filestuff = @file_get_contents ( '/proc/loadavg' )) {
$loadavg = explode ( ' ', $filestuff );
if (trim ( $loadavg [0] ) > $numer) {
print '';
print 'Traffic is overloaded, please come back after a few minutes.';
exit ( 0 );
}
}
}
$srv = server_busy ( 1000 ); // 1000 is the number of visitors at a time


12:28 AM
Unknown

