search
HomeCMS TutorialDEDECMSHow to prevent dede website DDos from being attacked

How to prevent dede website DDos from being attacked

How to prevent dede website DDos from being attacked?

Step one: Enter the background, system-》Add new variable Variable name: cfg_anquan_cc

Recommended learning: 梦Weavercms

Variable type: Boolean (Y/N)

Parameter description: Whether to enable CC attack prevention:

Variable value: Y

Step 2: Edit, /member/config .php Add code under require_once(DEDEINC.'/dedetemplate.class.php');

if($cfg_anquan_cc == 'Y'){
//php防CC攻击 在3秒内连续刷新页面5次以上将指向本机 //www.jb51.net/404.htm
 
$P_S_T = $t_array[0] + $t_array[1];
$timest amp = time();
session_start();
$ll_nowtime = $timestamp ;
if (session_is_registered('ll_lasttime')){
$ll_lasttime = $_SESSION['ll_lasttime'];
$ll_times = $_SESSION['ll_times'] + 1;
$_SESSION['ll_times'] = $ll_times;
}else{
$ll_lasttime = $ll_nowtime;
$ll_times = 1;
$_SESSION['ll_times'] = $ll_times;
$_SESSION['ll_lasttime'] = $ll_lasttime;
}
if (($ll_nowtime - $ll_lasttime)<3){
if ($ll_times>=5){
header(sprintf("Location: %s",&#39;//www.jb51.net/404.htm&#39;));
exit;
}
}else{
$ll_times = 0;
$_SESSION[&#39;ll_lasttime&#39;] = $ll_nowtime;
$_SESSION[&#39;ll_times&#39;] = $ll_times;
}
}

The above is the detailed content of How to prevent dede website DDos from being attacked. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools