定制 cleantalk/anti-ddos-lite 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cleantalk/anti-ddos-lite

Composer 安装命令:

composer require cleantalk/anti-ddos-lite

包简介

A small PHP app to protect your site against DDoS attack or crawling web site by bots.

README 文档

README

Build Status

Anti-DDoS-Lite (Anti-Crawler app) is a PHP app to protect your site against DDoS attack or crawling web site by bots.

Description

Anti-DDoS-Lite helps block bots and reduce server load and stops bad bots before they can reach your original web page. During the opening of the site page, the application performs a JS check and if the check fails, then a blocking page will be displayed.

Most of bots can't execute JavaScript code or can execute code partially. This app filters traffic from bots by using simple JavaScript code. Bots are denied to read original pages, they get only a single stop-page. As a result DDoS attack is reduced by elimination of bots traffic that participating in the DDoS attack.

In the same time, legitimate/real visitors get the original page after a short delay because the browser of legitimate/real visitors executes JavaScript code. The legitimate/real visitors see the stop-page only once, during first visit to the site.

How to use

  1. Include the app as first line in index.php by various way:

A Download, unzip and include the app:

<?php
// This file have to be very first included
require "anti-ddos-lite/anti-ddos-lite.php";

//
// index.php code bellow
// ...
//

?>

B Or install the app by composer package:

composer require cleantalk/anti-ddos-lite
<?php
// Init the app before your web app's main logic
\Cleantalk\CleantalkAntiDdosLite\CleantalkAntiDdosLite::init();
  1. Generate new value for anti_ddos_salt.

Skip protection for visitors from trusted networks, Autonomous systesm (AS)

Setup GeoIP and list excluded Autonomous systems in the $not_rated_as.

  $not_rated_as = '';

Skip trusted User-Agents

Skip trusted User-Agents. Regular expressions are allowed, example is bellow.

  $not_rated_ua = array(
        'CleanTalk Uptime bot.+',
        'Googlebot', 
        'Bingbot',
        'Baiduspider',
        'YandexBot',
        'facebot',
        'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)',
        'ia_archiver'
);

Changelog

Version 2.0.2

  • Fix. A document.write vulnerability fixed.
  • Fix. UA list converted to regular expressions.
  • Fix. UptimeRobot UA.
  • Fix. Trusted UA is skipped correctly.

Version 2.0.1

  • New. Headless mode detection.
  • Fix. Now visitors without JS will be blocked correctly.
  • Refactoring and minor fixes.

Contacts

Email: welcome@cleantalk.org

统计信息

  • 总下载量: 4.51k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 124
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 124
  • Watchers: 6
  • Forks: 46
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2023-01-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固