温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

边界路由器安全设定笔记

发布时间:2020-05-31 23:11:35 来源:网络 阅读:920 作者:arckyli 栏目:安全技术

R1(conf)# no cdp run   #在边界路由器上关闭CDP协议,防止非法用户通过CDP检测内部网络

R1(conf)# no service tcp-small-service   #echo  17; chargen 19; daytime 13;

R1(conf)# no service udp-small-service  #关闭低端口服务,如防止***发送流量灌水到chargen服务端口,占用CPU资源,防止DoS***

R1(conf)# no ip finger   #关闭FINGER,防止***通过finger检查路由器登录的用户

R1(conf)# no ip identd #identD允许远程设备为了识别目的查询的一个TCP端口,端口号为113;

R1(conf)# no ip  source-route #关闭IP源路,防止***利用IP源由选择路由来绕过防火墙;

R1(conf)# no ftp-server enable #关闭FTP-SERVER功能,防止***在路由器上建立FTP服务器;

R1(conf)# no ip bootp server  #防止***通过路由器作为Boot启动;

R1(conf)# no service pad #PAD(packet assembler/disassemble)用于X.25网络

R1(conf)# no boot network #禁止通过路由器作为TFTP启动

R1(conf)# no service config # 关闭服务器设定

R1(conf)# no ip proxy-arp #有一种情况下,不应该关闭ARP代理:当路由器端远程接入IPSec ×××连接时,当地设备要通过×××远程防问客户端,路由器响应来自本地设备的arp请求,这种情况下要打开APR代理功能;

R1(conf)# no ip directed-broadcast #Dos***利用广播定向功能向特定的网络或是子网进行洪水***;

R1(conf)# no ip unreachable #***使用DoS***来使路由器生成ICMP不可达消息;

R1(conf)# no ip redirect  #***可能利用ip重定向方法,让路由产生环路由,造成网络瘫痪;

R1(conf)# no ip mask-reply #利用子网消息请求功能,***可进行定向广播DoS***子网;

--------------------------------------------------------------------------------------

ACL参数说明:

  • precedence :过滤特定的优先级别,范围为0到7级别。IP数据包头通常为服务质量保证(Quality of Service, Qos)和队列的目的进行流量分类。

  • dscp:过滤IP数据包头中的区分服务代码(Differentiated Services Code Point,DSCP)值进行过滤;

  • tos: 过滤IP数据包头中的服务类型域,用于QoS实施

  • log: 用于记录控制吧、内部缓存或是系统日志,被记录内容包括有TCP、UDP或是ICMP,记录源端口号和目的端口号等;

  • log-input: 记录的信息包括接收到的数据包的输入接口和数据包中的第二层源地址;

ACL例子:

  • access-list 100 permit tcp any host 200.1.1.2 eq 25         # 任何流量都可以发送E-mail流量到200.1.1.2

  • access-list 100 permit tcp any eq 25 host 200.1.1.2 established   #内部E-mail 服务器发送邮件到外部服务器,并接收回复。established是用户发送到去的TCP流量将允许返回,但此参数在边界路由器上会产生有一漏洞,即是***可以利用返回数据的ACK \ FIN \ PSH \ RST \ SYS等TCP标记位进行修改并进行***;

  • 在接口下利用ip accounting access-violations 进行IP 统计

--------------------------------------------------------------------------------------

  • 使用PAM和ACL来限制CBAC审查

      R1(config)# ip port-map http port 8080 list 1

      R1(config)#access-list permit 192.168.100.2     

      R1(config)# ip port-map http port 8090 list 2 

      R1(config)#access-list permit 192.168.100.3 

--------------------------------------------------------------------------------------

  • 使用ACL来处理TCP SYN洪水***

      R1(config)# ip access-list extended tcp-syn-flood

      R1(config-ext-nacl)# permit tcp any 200.1.1.0 0.0.0.255 establised

      R1(config-ext-nacl)# permit tcp any host 200.1.1.11 eq 25 

      R1(config-ext-acl)# deny ip any any

      R1(config)# interface g0/1

      R1(config-if)# ip access-group tcp-syn-flood in

      此例ACL不能阻止E-mail服务器TCP SYN洪水***,要结合CBAC审查;

--------------------------------------------------------------------------------------

* 使用ACL来阻塞Smurf和Fraggle,Smurf为icmp回声(echo)的Dos***,Fraggle是使用UDP回声进行***

      R1(config)# ip access-list extended Smurf-fraggle

      R1(config-ext-nacl)# deny icmp any any echo

      R1(config-ext-nacl)# deny icmp any any echo-reply

      R1(config-ext-nacl)# deny udp any any echo

      R1(config-ext-nacl)# deny udp any any echo-reply

      R1(config-ext-acl)#  deny ip any any

       R1(config)# interface g0/1

      R1(config-if)# ip access-group Smurf-fraggle in

      R1(config-if)# ip access-group Smurf-fraggle out

--------------------------------------------------------------------------------------

  •  过滤icmp、traceroute、RPC、SQL

      R1(config)# ip access-list extended ICMP-IN-OUT

      R1(config-ext-nacl)# deny icmp any any echo      

      R1(config-ext-nacl)# deny icmp any any  redirect

      R1(config-ext-nacl)# deny icmp any any  mask-request

      R1(config-ext-nacl)# permit icmp any host 200.1.1.5 echo-reply

      R1(config-ext-nacl)# deny icmp any any echo-reply

      R1(config-ext-nacl)#  permit icmp any 200.1.1.0 0.0.0.255

      R1(config-ext-nacl)# deny udp any any range 32400 34400   #过滤Traceroute

  R1(config-ext-nacl)# deny tcp any any eq 514         #过滤RPC

      R1(config-ext-nacl)# deny udp any any eq 1434      #过滤SQL

      R1(config-ext-nacl)# deny tcp  any any eq 1433      #过滤SQL

      R1(config-ext-nacl)# deny tcp  any any eq 445        #过滤SMB

      R1(config-ext-acl)#  deny ip any any

      R1(config)# interface g0/1

      R1(config-if)# ip access-group CMP-IN-OUT in

      R1(config-if)# ip access-group CMP-IN-OUT  out

--------------------------------------------------------------------------------------

  •  过滤Trinoo

      R1(config)# ip access-list extended trinoo

      R1(config-ext-nacl)# deny tcp any any eq 1524  

      R1(config-ext-nacl)# deny tcp  any any eq 1524

      R1(config-ext-nacl)# deny udp  any any eq 1524

      R1(config-ext-nacl)# deny tcp any any eq 27665

      R1(config-ext-nacl)# deny tcp any  any  eq 27665 

      R1(config-ext-nacl)# deny tcp any any eq 31335

      R1(config-ext-nacl)#  deny tcp any   any  eq 31335 

      R1(config-ext-acl)#  deny ip any any

      R1(config)# interface g0/1

      R1(config-if)# ip access-group trinoo in

      R1(config-if)# ip access-group trinoo   out

--------------------------------------------------------------------------------------

  •  过滤DCOM连接,***利用微软的RPC代码的缺陷进行***。微软在分布式对像模块(Distributed Component Object Module,DCOM)中发现漏洞。DCOM使用的端口是 135 139 445

      R1(config)# ip access-list extended Deny_RPC

      R1(config-ext-nacl)# deny tcp any any eq 135 

      R1(config-ext-nacl)# deny udp  any any  eq 135

      R1(config-ext-nacl)# deny tcp any any eq 139 

      R1(config-ext-nacl)# deny udp any any eq 139

      R1(config-ext-nacl)# deny tcp any  any eq 445

      R1(config-ext-nacl)# deny udp any any eq 445 

      R1(config-ext-nacl)# deny udp any any eq 593

        R1(config-ext-nacl)# deny udp any any eq 4444

      R1(config-ext-nacl)# permit ip any any

      R1(config)# interface g0/1

      R1(config-if)# ip access-group Deny_RPC in

      

--------------------------------------------------------------------------------------

  •  使用CBAC来阻止DoS***

     R1(config)#  ip inspect tcp synwait-time 20 

     R1(config)#  ip inspect tcp idle-time 60

     R1(config)#  ip inspect udp idle-time 20 

     R1(config)#  ip inspect max-incomplete high 400

     R1(config)#  ip inspect max-incomplete low 300

     R1(config)#  ip inspect one-minute high 600

     R1(config)#  ip inspect one-minute low 500

     R1(config)#  ip inspect tcp max-incomplete host 300 block-time 0 

  •  设置一个简单的CBAC的审查配置

      R1(config)# ip access-list extended extended_acl

      R1(config-ext-nacl)# deny tcp any any log 

      R1(config-ext-nacl)# deny udp any any log

      R1(config-ext-nacl)# deny icmp any any log

      R1(config-ext-nacl)# permit ip any any 

      R1(config)# ip inspect name cbac-example tcp

      R1(config)# ip inspect name cbac-example udp

      R1(config)# ip inspect name cbac-example icmp

      R1(config)# interface g0/1

      R1(config-if)# ip access-group extended_acl

      R1(config-if)# ipinspect cbac-example in

     

--------------------------------------------------------------------------------------

  •  使用CBAC来阻止DoS***

     R1(config)#  ip inspect tcp synwait-time 20 

     R1(config)#  ip inspect tcp idle-time 60

     R1(config)#  ip inspect udp idle-time 20 

     R1(config)#  ip inspect max-incomplete high 400

     R1(config)#  ip inspect max-incomplete low 300

     R1(config)#  ip inspect one-minute high 600

     R1(config)#  ip inspect one-minute low 500

     R1(config)#  ip inspect tcp max-incomplete host 300 block-time 0 

--------------------------------------------------------------------------------------

  •  使用TCP截取来保护区内部服务器

     R1(config)#  access-list 100 tcp permit tcp any host 192.168.1.1 eq 80

     R1(config)#  access-list 100 tcp permit tcp any host 192.168.1.2 eq25

     R1(config)#  ip tcp intercept list 100

     R1(config)#  ip tcp intercept mode watch

     R1(config)#  ip tcp intercept watch-timeout 20

     R1(config)#  ip tcp intercept connection-time 120

     R1(config)#  ip tcp intercept max-incomplete high 600

     R1(config)#  ip tcp intercept min-incomplete low 500

     R1(config)#  ip tcp intercept one-minute high 800

     R1(config)#  ip tcp intercept one-minute low 600


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI