Ubuntu下OSPF插入恶意路由攻击测试


   前言:对于动态路由协议的攻击,向来是黑客关注的目标,OSPF协议作为园区网络中较为常见的路由协议,其配置的安全性和重要性自然不言而喻。如何有效防御OSPF的安全隐患,更多的网管往往将目标投向了路由器自身安全,习惯性的认为只要路由器保护得够安全,网络就够安全。其实,安全一直一来都是意识的竞争而技术仅仅是其中的表象。今天,我们就来看看一个简单的ospf插入恶意路由的方式。

    模型:本次实验,我们采用dynamips模拟路由器,Vmware+Ubuntu模拟攻击方,攻击程序采用一个安装在Ubuntu上的开源的路由软件quagga。拓扑如下:

    模型中,R0和R1是原本收敛完成的ospf路由,通过一台二层交换机连接,这是园区网络非常常见的方式;我们通过在交换机上接入一台计算机C0,运行相应的程序,将R0原本指向R1的172.16.0.2的路由指向我们的攻击端C0。

    原理:ospf的路由选择算法不在此赘述,简而言之。我们其实没有利用什么漏洞,而是针对没有设置校验的ospf路由进行握手和邻接,随后采用最小cost的方式强行压入路由。

    前期准备:
    路由器部分用dynamips,这里不再赘述用法,我们配置好的两台设备已经收敛完成,两台路由器采用f0/0链接交互ospf,此外R1新开启f0/1,用以将路由信息更新至R0,信息如下:
    R0:

   

 

R0#sh ip int bri
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.0.251   YES NVRAM  up                    up     
FastEthernet0/1            unassigned      YES NVRAM  administratively down down  R0#sh ip ospf ne Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.249     1   FULL/BDR        00:00:36    192.168.0.249   FastEthernet0/0 R0#sh ip route
Codes: C – connected, S – static, R – RIP, M – mobile, B – BGP
       D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF external type 1, E2 – OSPF external type 2
       i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS inter area, * – candidate default, U – per-user static route
       o – ODR, P – periodic downloaded static route Gateway of last resort is not set      172.16.0.0/24 is subnetted, 1 subnets
O       172.16.0.0 [110/20] via 192.168.0.249, 00:09:42, FastEthernet0/0
C    192.168.0.0/24 is directly connected, FastEthernet0/0

    R1:

   

 

R1#sh ip ospf ne Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.251     1   FULL/DR         00:00:30    192.168.0.251   FastEthernet0/0 R1#sh ip int bri
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.0.249   YES NVRAM  up                    up     
FastEthernet0/1            172.16.0.2      YES NVRAM  up                    up
 
R1#sh ip route 
Codes: C – connected, S – static, R – RIP, M – mobile, B – BGP
       D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF external type 1, E2 – OSPF external type 2
       i – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS inter area, * – candidate default, U – per-user static route
       o – ODR, P – periodic downloaded static route Gateway of last resort is not set      172.16.0.0/24 is subnetted, 1 subnets
C       172.16.0.0 is directly connected, FastEthernet0/1
C    192.168.0.0/24 is directly connected, FastEthernet0/0

相关内容