scapy.contrib.vtp¶
VTP Scapy Extension¶
- version
2009-02-15
- copyright
2009 by Jochen Bartl
- license
GPL v2
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- TODO
Join messages
RE MD5 hash calculation
Have a closer look at 8 byte padding in summary adv:
“debug sw-vlan vtp packets” says the TLV length is invalid, when I change the values:
b'\x00\x00\x00\x01\x06\x01\x00\x02'
x00x00 ?
x00x01 tlvtype?
x06 length?
x00x02 value?
h2i function for VTPTimeStampField
- References
- Understanding VLAN Trunk Protocol (VTP)
-
class
scapy.contrib.vtp.
VTP
(*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 | CODE | FOLLOWERS | SEQ | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | RESERVED | DOMNAMELEN | DOMNAME | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | REV | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | UID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TIMESTAMP | MD5 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VLANINFO | STARTVALUE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. VTP
VTP fields¶ ver
2
code
1
followers
ByteField
(Cond)1
seq
ByteField
(Cond)1
reserved
ByteField
(Cond)0
domnamelen
None
domname
b'manbearpig'
rev
SignedIntField
(Cond)0
uid
IPField
(Cond)'192.168.0.1'
timestamp
VTPTimeStampField
(Cond)b'930301000000'
md5
StrFixedLenField
(Cond)b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
vlaninfo
PacketListField
(Cond)[]
startvalue
ShortField
(Cond)0
-
post_build
(p, pay)¶
-
-
class
scapy.contrib.vtp.
VTPTimeStampField
(name, default)¶ Bases:
scapy.fields.StrFixedLenField
-
i2repr
(pkt, x)¶
-
-
class
scapy.contrib.vtp.
VTPVlanInfo
(*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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | LEN | STATUS | TYPE | VLANNAMELEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VLANID | MTU | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DOT10INDEX | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | VLANNAME | TLVLIST | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. VTPVlanInfo
VTPVlanInfo fields¶ len
None
status
0
type
1
vlannamelen
None
vlanid
1
mtu
1500
dot10index
None
vlanname
b'default'
tlvlist
PacketListField
(Cond)[]
-
guess_payload_class
(p)¶
-
post_build
(p, pay)¶
-
-
class
scapy.contrib.vtp.
VTPVlanInfoTlv
(*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 | LENGTH | VALUE | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. VTPVlanInfoTlv
VTPVlanInfoTlv fields¶ type
0
length
0
value
None
-
guess_payload_class
(p)¶
-