前言:在互联网发展迅速的网络时代下,现在每个人都会通过服务器在搭建网站,不管是商用也好,还是学习也好,都会受到来自互联网的非法请求。非法请求又分为很多种,今天我们重点介绍服务器受到DDOS和CC攻击怎么来防御。
科普DDoS和CC防御可以百度一下。其实防御都可以通过花钱升级防护来解决,但是很多人都是一些小网站,用更高的金钱来做防护,这显然是不现实的。而vDDoS是一款免费的用来防御和减轻DDOS攻击的脚本。官方更直接说了这是“HTTP(S) DDoS保护反向代理”下面我们来介绍一下安装方法。
什么是Vddos保护?
vDDoS Protection是提供反向代理服务器HTTP(S)协议的免费软件。它充当第7层防火墙过滤器并缓解DOS,DDOS,SYN洪水或HTTP洪水攻击,以保护您的网站
vDDOS特点
Reverse Proxy(反向代理)
DDoS Protection (DDoS保护)
Robot Mitigator(机器人攻击缓解器)
HTTP challenge/response (HTTP类型攻击防御)
reCaptcha Robot challenge (reCaptcha 机器人攻击)
HTTP Denial of Service tools (HTTP请求拦截工具)
Cookie challenge/response (Cookie 类型防御)
Block/Allow Country Code You Want (Status 403) (准许哪些国家可以访问,返回状态码403)
Limit the request connection coming from a single IP address (Status 503) (限制IP访问时间)
CDN Support (CloudFlare, Incapsula...) CDN支持(CloudFlare,Incapsula ......)
Whitelist for Botsearch (SEO Support, Allow Botsearch: Google, Alexa, Bing, Yahoo, Yandex, Facebook...) (SEO 搜索引擎白名单)
一、官方网站
https://vddos.voduy.com/ #目前无法访问
二、项目信息
vDDoS下载:https://github.com/duy13/vDDoS-Protection
SourceForge:https://sourceforge.net/projects/vddos-protection
Naxsi模块:https://github.com/nbs-system/naxsi
Kyprizel模块:https://github.com/kyprizel/testcookie-nginx-module
Nginx软件:https://github.com/nginx/nginx
三、系统要求
CentOS服务器5/6/7 x86_64(http://centos.org)
CloudLinux服务器5/6/7 x86_64(http://cloudlinux.com)
yum -y install epel-release
yum -y install curl wget gc gcc gcc-c++ pcre-devel zlib-devel make wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools gperftools-devel libatomic_ops-devel perl-ExtUtils-Embed gcc automake autoconf apr-util-devel gc gcc gcc-c++ pcre-devel zlib-devel make wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools gperftools-devel libatomic_ops-devel perl-ExtUtils-Embed
四、安装教程
从源代码下载:https://github.com/duy13/vDDoS-Protection
安装最新版本:(System CentOS 7 x86_64和vDDoS最新版本):
curl -L https://github.com/duy13/vDDoS-Protection/raw/master/latest.sh -o latest.sh
chmod 700 latest.sh
bash latest.sh
五、网站防护示例
# vi /vddos/conf.d/website.conf
# Website Listen Backend Cache Security SSL-Prikey SSL-CRTkey
default http://0.0.0.0:80 http://127.0.0.1:8080 no 200 no no
your-domain.com http://0.0.0.0:80 http://127.0.0.1:8080 no 200 no no
default https://0.0.0.0:443 https://127.0.0.1:8443 no 307 /vddos/ssl/your-domain.com.pri /vddos/ssl/your-domain.com.crt
your-domain.com https://0.0.0.0:443 https://127.0.0.1:8443 no 307 /vddos/ssl/your-domain.com.pri /vddos/ssl/your-domain.com.crt
your-domain.com https://0.0.0.0:4343 https://103.28.249.200:443 yes click /vddos/ssl/your-domain.com.pri /vddos/ssl/your-domain.com.crt
编辑完成后记得输入:wq来保存website.conf配置文件
六、启动防护
vddos restart
七、配置文件名称解释
your-domain.com为你想要保护的域名listen为本地监听IP端口backend为后端IP端口(可以当作为使用CDN或者反代源网站)cache是否进行缓存。
security是保护强度 可选no, 307, 200, click, 5s, high, captcha。
强度阶梯:no < 307 < 200 < click < 5s < high < captcha。
5s类似于Cloudflare的五秒盾。
captcha为启用谷歌人机验证码后面会详细说。
SSL-Prikey为SSL密匙。
SSL-CRTket为SSL证书。
八.vDDoS白名单、黑名单、获取真实访问者IP配置
https://www.cnblogs.com/shenjingwa/p/14457180.html
原文链接: https://www.cnblogs.com/shenjingwa/p/14457150.html
欢迎关注
微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍
原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/208472
非原创文章文中已经注明原地址,如有侵权,联系删除
关注公众号【高性能架构探索】,第一时间获取最新文章
转载文章受原作者版权保护。转载请注明原作者出处!