前不久勒索病毒橫行,很多人都紛紛中招,從公司到個人,損失相當慘重。有些公司在網際網路入口上做了控制,但是這樣并非完全,萬一有人把中了毒的U盤插入網内裝置上呢?那我們的内網中很有可能集體中招(打過相關更新檔的除外)。
我們今天就說說如何在路由、交換機上實作相應的通路控制,封堵相關端口,防止病毒在網絡内部蔓延。以華為和H3C裝置配置為例。
什麼?為什麼沒有思科?要啥自行車,我們需要支援國産!
**************************************
華為
#
acl number 3100 //建立ALC控制規則
rule 5 deny tcp destination-port eq 445 //禁止TCP 445端口資料
rule 10 deny tcp destination-port eq 135
rule 15 deny tcp destination-port eq 137
rule 20 deny tcp destination-port eq 138
rule 25 deny tcp destination-port eq 139
rule 30 deny udp destination-port eq 445
rule 35 deny udp destination-port eq 135
rule 40 deny udp destination-port eq 137
rule 45 deny udp destination-port eq 138
rule 50 deny udp destination-port eq 139
#
traffic classifier anti_wana operator or precedence 5 //建立流分類
if-match acl 3100 //将ACL與流分類關聯
#
traffic behavior anti_wana //建立流行為
deny //動作為禁止
statistic enable //使能流量統計(可選)
#
traffic policy anti_wana match-order config //建立流政策
classifier anti_wana behavior anti_wana //将流分類和流行為進行關聯
[全局視圖]
traffic-policy anti_wana global inbound //全局應用入方向流政策
traffic-policy anti_wana global outbound //全局應用出方向流政策
[接口視圖] //也可以根據使用接口在接口上應用相關流政策
traffic-policy anti_wana inbound
traffic-policy anti_wana outbound
****************************************
H3C
大部配置設定置相同,畢竟本是同根生啊。
#
acl number 3100
rule 5 deny tcp destination-port eq 445
rule 10 deny tcp destination-port eq 135
rule 15 deny tcp destination-port eq 137
rule 20 deny tcp destination-port eq 138
rule 25 deny tcp destination-port eq 139
rule 30 deny udp destination-port eq 445
rule 35 deny udp destination-port eq 135
rule 40 deny udp destination-port eq 137
rule 45 deny udp destination-port eq 138
rule 50 deny udp destination-port eq 139
#
traffic classifier anti_wana operator and
if-match acl 3100
#
traffic behavior anti_wana
filter deny
#
qos policy anti_wana
classifier anti_wana behavior anti_wana
#
[接口視圖]
qos apply policy anti_wana inbound
qos apply policy anti_wana outbound
[全局視圖] //基于全局應用QoS政策僅在MPE單闆(僅入方向)和SPC單闆上生效;部分裝置無法使用此指令,隻能在接口上應用。
qos apply policy anti_wana global inbound
qos apply policy anti_wana global outbound
==========================================
近期勒索病毒發生了變異,3389端口也在攻擊之列中,請在ACL中添加相關規則,以防不測!
rule 55 deny udp destination-port eq 3389
rule 60 deny tcp destination-port eq 3389