日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Linux系統(tǒng)中怎么防止CC攻擊-創(chuàng)新互聯(lián)

這篇文章將為大家詳細講解有關Linux系統(tǒng)中怎么防止CC攻擊,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。

創(chuàng)新互聯(lián)長期為近千家客戶提供的網(wǎng)站建設服務,團隊從業(yè)經(jīng)驗10年,關注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務;打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為南充企業(yè)提供專業(yè)的成都網(wǎng)站制作、成都做網(wǎng)站,南充網(wǎng)站改版等技術服務。擁有十載豐富建站經(jīng)驗和眾多成功案例,為您定制開發(fā)。

什么是CC攻擊

cc攻擊簡單就是(ChallengeCollapsar)

CC攻擊的原理就是攻擊者控制某些主機不停地發(fā)大量數(shù)據(jù)包給對方服務器造成服務器資源耗盡,一直到宕機崩潰。CC主要是用來攻擊頁面的,每個人都有這樣的體驗:當一個網(wǎng)頁訪問的人數(shù)特別多的時候,打開網(wǎng)頁就慢了,CC就是模擬多個用戶(多少線程就是多少用戶)不停地進行訪問那些需要大量數(shù)據(jù)操作(就是需要大量CPU時間)的頁面,造成服務器資源的浪費,CPU長時間處于100%,永遠都有處理不完的連接直至就網(wǎng)絡擁塞,正常的訪問被中止。

防止CC攻擊方法

用防止這CC攻擊有兩種方法

第一種就是利用本機的防火墻來解決可以安裝CSF之內(nèi)的防火墻,這種的弊端是只能防止小規(guī)模的CC攻擊和DDOS(我的站在阿里云,所以不用太擔心DDOS)CC攻擊比較猛的話機器也直接CUP跑滿了。

第二種方式是添加CDN,這種防止CC攻擊的方法是好的,不過CDN一般都要錢。

現(xiàn)在就來談談具體換防護,

首先安裝CSF防火墻,這個比較簡單而且不用改域名什么的,小規(guī)模的就直接解決了。

一、安裝依賴包:

yum install perl-libwww-perl perl iptables

二、下載并安裝 CSF:

wget http://www.configserver.com/free/csf.tgz

tar -xzf csf.tgz

cd csf

sh install.sh

三、測試 CSF 是否能正常工作:

[root@localhost csf]# perl /etc/csf/csftest.pl

Testing ip_tables/iptable_filter.。.OK

Testing ipt_LOG.。.OK

Testing ipt_multiport/xt_multiport.。.OK

Testing ipt_REJECT.。.OK

Testing ipt_state/xt_state.。.OK

Testing ipt_limit/xt_limit.。.OK

Testing ipt_recent.。.OK

Testing xt_connlimit.。.OK

Testing ipt_owner/xt_owner.。.OK

Testing iptable_nat/ipt_REDIRECT.。.OK

Testing iptable_nat/ipt_DNAT.。.OK

RESULT: csf should function on this server

四、csf的配置:

CSF的配置文件是

vim /etc/csf/csf.conf

# Allow incoming TCP ports

# 推薦您更改 SSH 的默認端口(22)為其他端口,但請注意一定要把新的端口加到下一行中

TCP_IN = “20,21,47,81,1723,25,53,80,110,143,443,465,587,993,995〃

# Allow outgoing TCP ports同上,把 SSH 的登錄端口加到下一行。

# 在某些程序要求打開一定范圍的端口的情況下,例如Pureftpd的passive mode,可使用類似 30000:35000 的方式打開30000-35000范圍的端口。

TCP_OUT = “20,21,47,81,1723,25,53,80,110,113,443〃

# Allow incoming UDP ports

UDP_IN = “20,21,53〃

# Allow outgoing UDP ports

# To allow outgoing traceroute add 33434:33523 to this list

UDP_OUT = “20,21,53,113,123〃

# Allow incoming PING 是否允許別人ping你的服務器,默認為1,允許。0為不允許。

ICMP_IN = “1〃

以上這些配置大家一看就懂了,下面再介紹幾個比較常用的:

上一頁12下一頁共2頁

免疫某些類型的小規(guī)模 DDos 攻擊:

# Connection Tracking. This option enables tracking of all connections from IP

# addresses to the server. If the total number of connections is greater than

# this value then the offending IP address is blocked. This can be used to help

# prevent some types of DOS attack.

#

# Care should be taken with this option. It’s entirely possible that you will

# see false-positives. Some protocols can be connection hungry, e.g. FTP, IMAPD

# and HTTP so it could be quite easy to trigger, especially with a lot of

# closed connections in TIME_WAIT. However, for a server that is prone to DOS

# attacks this may be very useful. A reasonable setting for this option might

# be arround 200.

#

# To disable this feature, set this to 0

CT_LIMIT = “200”##固定時間內(nèi)同一個IP請求的此數(shù)

# Connection Tracking interval. Set this to the the number of seconds between

# connection tracking scans

CT_INTERVAL = “30” ##指上面的固定時間,單位為秒

# Send an email alert if an IP address is blocked due to connection tracking

CT_EMAIL_ALERT = “1” ##是否發(fā)送郵件

# If you want to make IP blocks permanent then set this to 1, otherwise blocks

# will be temporary and will be cleared after CT_BLOCK_TIME seconds

# 是否對可疑IP采取永久屏蔽,默認為0,即臨時性屏蔽。

CT_PERMANENT = “0”

# If you opt for temporary IP blocks for CT, then the following is the interval

# in seconds that the IP will remained blocked for (e.g. 1800 = 30 mins)

# 臨時性屏蔽時間

CT_BLOCK_TIME = “1800”

# If you don’t want to count the TIME_WAIT state against the connection count

# then set the following to “1〃

CT_SKIP_TIME_WAIT = “0” ##是否統(tǒng)計TIME_WAIT鏈接狀態(tài)

# If you only want to count specific states (e.g. SYN_RECV) then add the states

# to the following as a comma separated list. E.g. “SYN_RECV,TIME_WAIT”

# Leave this option empty to count all states against CT_LIMIT

CT_STATES = “” ##是否分國家來統(tǒng)計,填寫的是國家名

# If you only want to count specific ports (e.g. 80,443) then add the ports

# to the following as a comma separated list. E.g. “80,443〃

#

# Leave this option empty to count all ports against CT_LIMIT

# 對什么端口進行檢測,為空則檢測所有,防止ssh的話可以為空,統(tǒng)計所有的。

CT_PORTS = “”

做了以上設置之后,可以先測試一下。如果沒有問題的話,就更改為正式模式,剛才只是測試模式。

# 把默認的1修改為0。

TESTING = “0”

在/etc/csf/下有csf.allow和csf.deny兩個文件,

allow是信任的IP,可以把自己的IP寫到這里面防止誤封。

deny就是被封的IP。

如果有調(diào)整需要重啟一下cfs服務

關于Linux系統(tǒng)中怎么防止CC攻擊就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。


網(wǎng)頁題目:Linux系統(tǒng)中怎么防止CC攻擊-創(chuàng)新互聯(lián)
文章分享:http://www.dlmjj.cn/article/dccjdi.html