简体   繁体   中英

Python scapy OSPF

I have a requirement of testing OSPF v2 and OSPF v3 routing protocols against their respective RFCs. Scapy module for python seems interesting solution to craft OSPF packets, but are there any open source OSPF libraries over scapy that one could use to create the test cases. Would appreciate any pointers in this direction.

I love using Scapy any change I get. Being in Python, it has a pretty low learning curve. You can modify any portion of the packet (Eth, IP, TCP/UDP, Payload). Any layer below the payload Scapy comes with an option to fuzz any fields. You have the option to recalculate the checksum/len fields. You can load traffic from a PCAP and utilize packets from there. Scapy won't complain if you make a really odd packet; eg

from scapy.all import *
packet = IP()/ICMP()/ICMP()
packet.show()

I've used it to produce a MITM attack on virtual routers utilizing RIP. It bypasses the rules of the iptables, so pairing it with rules can do a lot of stuff. It can be used as a server if you drop RST packets. It can even be used to modify incoming and outgoing traffic utilizing nfqueue.

In general, Scapy gives you a ton of flexibility with ease of use.

Have a look at this page: https://github.com/secdev/scapy/wiki/Contrib:-Code:-OSPF It hasn't been updated in a while, so it's probably not Python 3 compatible. Feel free to debug it and submit your changes :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM