Get the App
SLTechnology News&Howtos  ›  Servers  › 

Methods to prevent DDos from being attacked on dedecms website

Shulou Source: shulou.com Published: 2022-06-02 05:08:41 11月16日 Update

Editor to share with you how to prevent the dedecms website DDos from being attacked. I hope you will gain a lot after reading this article. Let's discuss it together.

Step 1: enter the background, system-"add a new variable name: cfg_anquan_cc

Variable type: Boolean (YUnip N)

Parameter description: whether to enable anti-CC attacks:

Variable value: y

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

If ($cfg_anquan_cc = ='Y') {

/ / php Anti-CC attacks will point to native / / www.jb51.net/404.htm if you refresh the page more than 5 times in 3 seconds

$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) = 5) {

Header (sprintf ("Location:% s",'/ / www.jb51.net/404.htm'))

Exit

}

} else {

$ll_times = 0

$_ SESSION ['ll_lasttime'] = $ll_nowtime

$_ SESSION ['ll_times'] = $ll_times

}

}

After reading this article, I believe you have a certain understanding of the methods to prevent dedecms website DDos from being attacked. You want to know more about it. Welcome to follow the industry information channel. Thank you for your reading!

Tags: Attacks variables methods websites articles Admirals Code parameters name background done Boolean pointing more knowledge Type system Industry Information Information Channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Linux Shulou Tech Info Shulou Technology Xiaomi