scapy.contrib.eigrp¶
EIGRP Scapy Extension¶
- version
2009-08-13
- copyright
2009 by Jochen Bartl
- license
GPL v2
:TODO
- Replace TLV code with a more generic solution
Write function for calculating authentication data
- Known bugs
- Thanks
- TLV code derived from the CDP implementation of scapy. (Thanks to Nicolas Bareil and Arnaud Ebalard)
IOS / EIGRP Version Representation FIX by Dirk Loss
-
class
scapy.contrib.eigrp.EIGRP(*args, **kargs)¶ Bases:
scapy.packet.Packet-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VER | OPCODE | CHKSUM | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | FLAGS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SEQ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ACK | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ASN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TLVLIST | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EIGRPEIGRP fields¶ ver
2opcode
5chksum
Noneflags
FlagsField(32 bits)<Flag 0 ()>seq
0ack
0asn
100tlvlist
[]
-
mysummary()¶
-
post_build(p, pay)¶
-
-
class
scapy.contrib.eigrp.EIGRPAuthData(*args, **kargs)¶ Bases:
scapy.contrib.eigrp.EIGRPGeneric-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | AUTHTYPE | KEYSIZE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | KEYID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NULLPAD | AUTHDATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EIGRPAuthDataEIGRPAuthData fields¶ type
2len
Noneauthtype
2keysize
Nonekeyid
1nullpad
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'authdata
<RandString>
-
post_build(p, pay)¶
-
-
class
scapy.contrib.eigrp.EIGRPExtRoute(*args, **kargs)¶ Bases:
scapy.contrib.eigrp.EIGRPGeneric-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NEXTHOP | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ORIGINROUTER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ORIGINASN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TAG | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | EXTERNALMETRIC | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESERVED | EXTPROTOCOLID | FLAGS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DELAY | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | BANDWIDTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HOPCOUNT | RELIABILITY | LOAD | RESERVED2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PREFIXLEN | DST | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EIGRPExtRouteEIGRPExtRoute fields¶ type
259len
Nonenexthop
'192.168.0.0'originrouter
'192.168.0.1'originasn
0tag
0externalmetric
0reserved
0extprotocolid
3flags
FlagsField(8 bits)<Flag 0 ()>delay
0bandwidth
256mtu
1500hopcount
0reliability
255load
0reserved2
0prefixlen
24dst
'192.168.1.0'
-
-
class
scapy.contrib.eigrp.EIGRPGeneric(*args, **kargs)¶ Bases:
scapy.packet.Packet-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VALUE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EIGRPGenericEIGRPGeneric fields¶ type
0len
Nonevalue
b'\x00'
-
guess_payload_class(p)¶
-
-
class
scapy.contrib.eigrp.EIGRPIntRoute(*args, **kargs)¶ Bases:
scapy.contrib.eigrp.EIGRPGeneric-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NEXTHOP | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DELAY | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | BANDWIDTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HOPCOUNT | RELIABILITY | LOAD | RESERVED | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PREFIXLEN | DST | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EIGRPIntRouteEIGRPIntRoute fields¶ type
258len
Nonenexthop
'192.168.0.0'delay
128000bandwidth
256mtu
1500hopcount
0reliability
255load
0reserved
0prefixlen
24dst
'192.168.1.0'
-
-
class
scapy.contrib.eigrp.EIGRPNms(*args, **kargs)¶ Bases:
scapy.contrib.eigrp.EIGRPGeneric-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NMS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EIGRPNmsEIGRPNms fields¶ type
5len
8nms
2
-
-
class
scapy.contrib.eigrp.EIGRPParam(*args, **kargs)¶ Bases:
scapy.contrib.eigrp.EIGRPGeneric-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | K1 | K2 | K3 | K4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | K5 | RESERVED | HOLDTIME | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EIGRPParamEIGRPParam fields¶ type
1len
12k1
1k2
0k3
1k4
0k5
0reserved
0holdtime
15
-
-
class
scapy.contrib.eigrp.EIGRPSeq(*args, **kargs)¶ Bases:
scapy.contrib.eigrp.EIGRPGeneric-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ADDRLEN | IPADDR | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | IP6ADDR | +-+-+-+-+-+-+-+-+ + | | + + | | + + | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+ Fig. EIGRPSeqEIGRPSeq fields¶ type
3len
Noneaddrlen
4ipaddr
IPField(Cond)'192.168.0.1'ip6addr
IP6Field(Cond)'2001::'
-
post_build(p, pay)¶
-
-
class
scapy.contrib.eigrp.EIGRPStub(*args, **kargs)¶ Bases:
scapy.contrib.eigrp.EIGRPGeneric-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | FLAGS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EIGRPStubEIGRPStub fields¶ type
6len
6flags
FlagsField(16 bits)<Flag 13 (connected+summary+receive-only)>
-
-
class
scapy.contrib.eigrp.EIGRPSwVer(*args, **kargs)¶ Bases:
scapy.contrib.eigrp.EIGRPGeneric-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | IOS | EIGRP | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EIGRPSwVerEIGRPSwVer fields¶ type
4len
8ios
3072eigrp
258
-
-
class
scapy.contrib.eigrp.EIGRPv6ExtRoute(*args, **kargs)¶ Bases:
scapy.contrib.eigrp.EIGRPGeneric-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NEXTHOP | + + | | + + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ORIGINROUTER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ORIGINASN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TAG | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | EXTERNALMETRIC | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESERVED | EXTPROTOCOLID | FLAGS | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DELAY | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | BANDWIDTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HOPCOUNT | RELIABILITY | LOAD | RESERVED2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PREFIXLEN | DST | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EIGRPv6ExtRouteEIGRPv6ExtRoute fields¶ type
1027len
Nonenexthop
'::'originrouter
'192.168.0.1'originasn
0tag
0externalmetric
0reserved
0extprotocolid
3flags
FlagsField(8 bits)<Flag 0 ()>delay
0bandwidth
256000mtu
1500hopcount
1reliability
0load
1reserved2
0prefixlen
8dst
'::'
-
-
class
scapy.contrib.eigrp.EIGRPv6IntRoute(*args, **kargs)¶ Bases:
scapy.contrib.eigrp.EIGRPGeneric-
aliastypes¶
-
fields_desc¶ Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TYPE | LEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | NEXTHOP | + + | | + + | | + + | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DELAY | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | BANDWIDTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HOPCOUNT | RELIABILITY | LOAD | RESERVED | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PREFIXLEN | DST | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. EIGRPv6IntRouteEIGRPv6IntRoute fields¶ type
1026len
Nonenexthop
'::'delay
128000bandwidth
256000mtu
1500hopcount
1reliability
255load
0reserved
0prefixlen
16dst
'2001::'
-
-
class
scapy.contrib.eigrp.EigrpIP6Field(name, default, length=None, length_from=None)¶ Bases:
scapy.fields.StrField,scapy.fields.IP6FieldThis is a special field type for handling ip addresses of destination networks in internal and external route updates.
-
any2i(pkt, x)¶
-
getfield(pkt, s)¶
-
h2i(pkt, x)¶
-
i2len(pkt, x)¶
-
i2m(pkt, x)¶
-
i2repr(pkt, x)¶
-
length_from¶
-
m2i(pkt, x)¶
-
prefixlen_to_bytelen(plen)¶
-
randval()¶
-
-
class
scapy.contrib.eigrp.EigrpIPField(name, default, length=None, length_from=None)¶ Bases:
scapy.fields.StrField,scapy.fields.IPFieldThis is a special field type for handling ip addresses of destination networks in internal and external route updates.
EIGRP removes zeros from the host portion of the ip address if the netmask is 8, 16 or 24 bits.
-
getfield(pkt, s)¶
-
h2i(pkt, x)¶
-
i2len(pkt, x)¶
-
i2m(pkt, x)¶
-
length_from¶
-
m2i(pkt, x)¶
-
prefixlen_to_bytelen(tmp_len)¶
-
randval()¶
-
-
class
scapy.contrib.eigrp.RepeatedTlvListField(name, default, cls)¶ Bases:
scapy.fields.PacketListField-
addfield(pkt, s, val)¶
-
getfield(pkt, s)¶
-
-
class
scapy.contrib.eigrp.ShortVersionField(name, default)¶ Bases:
scapy.fields.ShortField-
h2i(pkt, x)¶ The field accepts string values like v12.1, v1.1 or integer values. String values have to start with a “v” followed by a floating point number. Valid numbers are between 0 and 255.
-
i2repr(pkt, x)¶
-
randval()¶
-