Home > CMS Tutorial > DEDECMS > body text

How to prevent dede website DDos from being attacked

藏色散人
Release: 2019-12-02 10:23:47
Original
2461 people have browsed it

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;
}
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template