-
Notifications
You must be signed in to change notification settings - Fork 41
/
anti-ddos-lite.php
44 lines (37 loc) · 1.4 KB
/
anti-ddos-lite.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* Cleantalk base class
*
* @version 2.0.2
* @package Cleantalk
* @author Cleantalk team ([email protected])
* @copyright (C) CleanTalk team (https://cleantalk.org)
* @license MIT License 2022
*
*/
require 'src/anti-ddos-lib.php';
if (!checkRequirements()) {
return;
}
if (!isset($_SERVER['REMOTE_ADDR'])) {
return;
}
$data = [
'anti_ddos_protection_enable' => true, // Switch to control AntiDDoS state.
'anti_ddos_debug' => true, // Activate debug statements.
'skip_not_rated_ua' => false, // Test visitors against trusted UserAgent's list.
'secure_cookie_days' => 180, // Days to use secure cookie.
'redirect_delay' => 3, // Delay in seconds before redirection to original URL.
'remote_ip' => $_SERVER['REMOTE_ADDR'],
'secure_label' => 'ct_anti_ddos_key',
'test_headless' => true, //block visitors with headless mode (such a selenium)
'server_url' => isset($_SERVER['HTTPS']) ? 'https://' . $_SERVER['HTTP_HOST'] : 'http://' . $_SERVER['HTTP_HOST'],
// Secret key salt to avoid copy/past of the Cookie between visitors.
// ATTENTION!!!
// YOU MUST GENERATE NEW $anti_ddos_salt BEFORE USE IT ON YOUR OWN SITE.
// ATTENTION!!!
'anti_ddos_salt' => '4xU9mn2X7iPZpeW2'
];
if ($data['anti_ddos_protection_enable'] || antiDdosCheckDatFileExist()) {
antiDdosProtectionMain($data);
}