前不久勒索病毒橫行,很多人都紛紛中招,從公司到個人,損失相當慘重。有些公司在互聯網入口上做了控制,但是這樣並非完全,萬一有人把中了毒的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