勒索病毒,华为/H3C三层交换机/路由器用ACL访问控制实现端口禁用

        前不久勒索病毒横行,很多人都纷纷中招,从公司到个人,损失相当惨重。有些公司在互联网入口上做了控制,但是这样并非完全,万一有人把中了毒的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
posted @ 2019-09-11 11:39  it_逗逗  阅读(9796)  评论(2编辑  收藏  举报