网络交换机勒索病毒端口防护配置分享


1、概述

  本人是一个普通的网络工程师,某天安全检查后,发现单位里的交换机对勒索病毒的网络端口号没有做限制规则,要求在交换机层面对一些高危端口号做限制,由于内部有部署服务器使用域控、文件共享等,若无差别的把高危端口全部禁止会导致本地业务受到影响,后面通过网上查找资料加上自己测试,解决了把本地服务器除外,其他都禁止的方法。

  需求总结:

    1、本地服务器业务不受影响,如域控、文件共享服务等

    2、禁止其余全部IP访问高危端口号,本地PC之间也禁止

2、H3C具体配置如下:

########## H3C配置 ###########

以下是检查提供的高危端口号:

TCP:137、139、445、593、1025、2745、3127、6129、3389
UDP:135、139、445

// 下面有两条acl 策略,第一个是干脆对服务器网段不做限制,全放同(懒的设端口号);第二个是只对服务器的业务端口号放通。(根据情况调整使用)

acl number 3001
  rule 5 permit ip destination 172.16.10.0 0.0.0.255
  rule 10 permit ip source 172.16.10.0 0.0.0.255

 

acl number 3001 

  rule 5 permit tcp source 10.100.0.0 0.0.0.255 destination 172.16.10.0 0.0.0.255 destination-port eq 137

  rule 10 permit tcp source 10.100.0.0 0.0.0.255 destination 172.16.10.0 0.0.0.255 destination-port eq 139

  rule 15 permit tcp source 10.100.0.0 0.0.0.255 destination 172.16.10.0 0.0.0.255 destination-port eq 445

  如此类推,自行添加(10.100.0.0/24 是本地用户段  ,172.16.10.0/24  是本地服务器段)

 

//  这条作为禁止高危端口(根据需求调整)
acl number 3002
  rule 0 deny tcp destination-port eq 137
  rule 5 deny tcp destination-port eq 139
  rule 10 deny tcp destination-port eq 445
  rule 15 deny tcp destination-port eq 593
  rule 20 deny tcp destination-port eq 1025
  rule 25 deny tcp destination-port eq 2745
  rule 30 deny tcp destination-port eq 3127 
  rule 35 deny tcp destination-port eq 6129
  rule 40 deny tcp destination-port eq 3389
  rule 45 deny udp destination-port eq netbios-ns
  rule 50 deny udp destination-port eq netbios-ssn
  rule 55 deny udp destination-port eq 445
  rule 60 deny tcp source-port eq 137
  rule 65 deny tcp source-port eq 139
  rule 75 deny tcp source-port eq 445
  rule 85 deny tcp source-port eq 593
  rule 90 deny tcp source-port eq 1025
  rule 95 deny tcp source-port eq 2745
  rule 100 deny tcp source-port eq 3127
  rule 105 deny tcp source-port eq 6129 
  rule 110 deny tcp source-port eq 3389
  rule 115 deny udp source-port eq netbios-ns
  rule 120 deny udp source-port eq netbios-ssn
  rule 125 deny udp source-port eq 445

# 配置类型流控,建立c1 c2  分别设置匹配对应acl规则
traffic classifier c2 operator and
  if-match acl 3002 

traffic classifier c1 operator and
  if-match acl 3001


# 配置b1 和 b2 ,对匹配流量分别允许与拒绝

traffic behavior b2
  filter deny

traffic behavior b1
  filter permit


# 配置类型与访问控制

//  这里解释就是把c1 中对应的acl 3001 匹配的流量 b1 处理,b1 是permit  就是允许通过

//  而c2 中对应的acl 3002 匹配的流量 b2 处理,b2是deny  就是禁止通过

qos policy lesuofh
  classifier c1 behavior b1
  classifier c2 behavior b2 


# 最后使配置生效流控策略lesuofh,效果:对本地服务器不受限制,其余用户PC之间外部IP等都收到限制。
qos apply policy lesuofh global inbound

 

########## H3C配置 ###########

 

华为类似H3C配置,可以看下参考网站相对调整下。

为啥没思科锐捷?我支持下国产吧,哈哈哈哈。

参考网站:https://www.cnblogs.com/chling/archive/2019/09/11/11505353.html 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM