Skip to content

Custom 802.11 Vendor Specific packet #4659

@Hoolean

Description

@Hoolean

Hello! Thank you for the excellent library :)

Scapy has specialised subclasses of Dot11EltVendorSpecific that interpret and parse the generic info field of the parent class:

scapy/scapy/layers/dot11.py

Lines 1428 to 1456 in c15a670

class Dot11EltVendorSpecific(Dot11Elt):
name = "802.11 Vendor Specific"
match_subclass = True
fields_desc = [
ByteEnumField("ID", 221, _dot11_id_enum),
ByteField("len", None),
OUIField("oui", 0x000000),
StrLenField("info", "", length_from=lambda x: x.len - 3)
]
@classmethod
def dispatch_hook(cls, _pkt=None, *args, **kargs):
if _pkt:
oui = struct.unpack("!I", b"\x00" + _pkt[2:5])[0]
if oui == 0x0050f2: # Microsoft
type_ = orb(_pkt[5])
if type_ == 0x01:
# MS WPA IE
return Dot11EltMicrosoftWPA
elif type_ == 0x02:
# MS WME IE TODO
# return Dot11EltMicrosoftWME
pass
elif type_ == 0x04:
# MS WPS IE TODO
# return Dot11EltWPS
pass
return Dot11EltVendorSpecific
return cls

For a project using Scapy as a library, how easiest can this be extended to cover an additional custom subclass? Is this possible with the current implementation and, if not, is another workaround accessible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions