频道栏目
首页 > 资讯 > 路由器 > 正文

边界路由器如何进行安全设定

17-09-28        来源:[db:作者]  
收藏   我要投稿

边界路由器如何进行安全设定。

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 VPN连接时,当地设备要通过VPN远程防问客户端,路由器响应来自本地设备的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 anyeq 1524

R1(config-ext-nacl)# deny udp any anyeq 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-groupDeny_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

相关TAG标签
上一篇:php用代码实现递归获取一个数组中指定key的值
下一篇:SQLServer时间TimeDate()函数日期和时间问题教程
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站