惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
S
Securelist
MyScale Blog
MyScale Blog
Jina AI
Jina AI
罗磊的独立博客
The Cloudflare Blog
美团技术团队
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
雷峰网
雷峰网
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
博客园 - 聂微东
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MongoDB | Blog
MongoDB | Blog
T
Tailwind CSS Blog
Attack and Defense Labs
Attack and Defense Labs
博客园_首页
Latest news
Latest news
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Hacker News
The Hacker News
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
U
Unit 42
D
Docker
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
B
Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Security Latest
Security Latest
V2EX - 技术
V2EX - 技术
N
News | PayPal Newsroom
Microsoft Security Blog
Microsoft Security Blog

Rat's Blog - DDOS

Linux VPS 使用DDOS deflate来抵御DDOS攻击 - Rat's Blog
Linux VPS安装vDDoS Proxy防御DDOS CC攻击 - Rat's Blog
博主: Rat's · 2017-09-29 · via Rat's Blog - DDOS

说明:之前发过一篇防DDOS的文章,参考:Linux VPS 使用DDOS deflate来抵御DDOS攻击,今天又看到一个使用vDDoS Proxy防御DDOS CC攻击的教程,就说下。

Vddos proxy是什么

引用原文“

vDDoS Protection is Nginx bundled with module HTTP/2; GeoIP; Limit Req, Testcookie; reCaptcha processor…

Working like CloudFlare, but vDDoS is software help you build your own System Firewall.

Github地址:https://github.com/duy13/vDDoS-Protection
作者主页:http://vddos.voduy.com/
原作者还提供了更强大的功能以及更详细的说明,有能力的MJJ可以前去研究。

安装

vDDos proxy必须安装在WEB程序以前例如(cPanel, VestaCP, LAMP, LEMP…)。

vDDos proxy暂只支持Centos 5/6/7 64位和CloudLinux Server 5/6/7 64位。

接下来以Centos 7为例。

运行以下命令:

yum -y install epel-release 
yum -y update
yum -y install curl wget gc gcc gcc-c++ pcre-devel zlib-devel make openssl-devel libxml2-devel libxslt-devel
yum -y install gd-devel perl-ExtUtils-Embed GeoIP-devel gperftools gperftools-devel libatomic_ops-devel
yum -y install automake autoconf apr-util-devel GeoIP-devel libatomic_ops-devel

目前最新版本为1.13.1

curl -L https://github.com/duy13/vDDoS-Protection/raw/master/vddos-1.13.1-centos7 -o /usr/bin/vddos
#curl -L https://github.com/duy13/vDDoS-Protection/raw/master/vddos-1.13.1-centos6 -o /usr/bin/vddos #Centos6.X
#curl -L https://github.com/duy13/vDDoS-Protection/raw/master/vddos-1.13.1-centos5 -o /usr/bin/vddos #Centos5.X
chmod 700 /usr/bin/vddos
/usr/bin/vddos help
/usr/bin/vddos setup

至此,安装完毕

使用

Welcome to vDDoS, a HTTP(S) DDoS Protection Reverse Proxy. Thank you for using!
 
               Command Line Usage:
       vddos setup             :installing vDDoS service for the first time into /vddos
       vddos start             :start vDDoS service
       vddos stop              :stop vDDoS service
       vddos restart           :restart vDDoS service
       vddos autostart         :auto-start vDDoS services on boot
       vddos attack            :create a DDoS attacks to HTTP target (in 30 min)
       vddos stopattack        :stop "vddos attack" command
       vddos help              :display this help
 
                                       Please sure download vDDoS source from: vddos.voduy.com

保护某一个网站

# 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   /ssl/key.pri /ssl/crt.crt
your-domain.com https://0.0.0.0:443  https://127.0.0.1:8443   no    307   /ssl/key.pri /ssl/crt.crt

参数解释

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-PrikeySSL密匙。

SSL-CRTketSSL证书。

5S盾

5s盾的默认文件储存于

/vddos/html/5s.html

如有需要,可自行DIY

captcha谷歌验证码

因为国内无法使用谷歌验证码,所以本虾也没有去测试。

下面贴出LET上给出的使用方法,请自行测试。

# vi /vddos/conf.d/recaptcha-sitekey.conf
# Website       reCaptcha-sitekey (View KEY in https://www.google.com/recaptcha/admin#list)
your-domain.com     6Lcr6QkUAAAAAxxxxxxxxxxxxxxxxxxxxxxxxxxx
...
# vi /vddos/conf.d/recaptcha-secretkey.conf
DEBUG=False
RE_SECRETS = { 'your-domain.com': '6Lcr6QkUAAAAxxxxxxxxxxxxxxxxxxxxxxxxxxx',
               'your-domain.org': '6LcKngoUAAAAxxxxxxxxxxxxxxxxxxxxxxxxxxx' }

所需的KEY需要在https://www.google.com/recaptcha/admin#list申请,似乎是一个域名对应了一个key

禁止某个国家的IP访问

修改文件/vddos/conf.d/blacklist-countrycode.conf

#vi /vddos/conf.d/blacklist-countrycode.conf
 
geoip_country /usr/share/GeoIP/GeoIP.dat;
map $geoip_country_code $allowed_country {
    default yes;
    US yes;
    CN no;#这个。。自带禁止中国是啥意思 mjj
 
}
deny 1.1.1.1;

添加白名单

修改文件/vddos/conf.d/whitelist-botsearch.conf

# vi /vddos/conf.d/whitelist-botsearch.conf
 
#Alexa Bot IP Addresses
204.236.235.245; 75.101.186.145;
...

添加白名单之后,启用的如5s盾 验证码将不会对白名单IP访客生效。

设置IP直接访问源站

修改文件/vddos/conf.d/cdn-ip.conf

# vi /vddos/conf.d/cdn-ip.conf
 
# Cloudflare
set_real_ip_from 103.21.244.0/22;
...

文章来源:安装vDDoS Proxy防御 DDOS CC攻击


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/324/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。