scapy.data

Global variables and functions for handling external data sets.

class scapy.data.EtherDA(_name: str = 'DADict', **kargs: Any)[源代码]

基类:DADict[int, str]

class scapy.data.KnowledgeBase(filename: Any | None)[源代码]

基类:object

get_base() str | List[Tuple[str, Dict[str, Dict[str, str]]]][源代码]
lazy_init() None[源代码]
reload(filename: Any | None = None) None[源代码]
class scapy.data.ManufDA(_name: str = 'DADict', **kargs: Any)[源代码]

基类:DADict[str, Tuple[str, str]]

ident(v: Any) str[源代码]
lookup(mac: str) Tuple[str, str][源代码]

Find OUI name matching to a MAC

reverse_lookup(name: str, case_sensitive: bool = False) Dict[str, str][源代码]

Find all MACs registered to a OUI

参数:
  • name -- the OUI name

  • case_sensitive -- default to False

返回:

a dict of mac:tuples (Name, Extended Name)

scapy.data.load_ethertypes(filename: str | None) EtherDA[源代码]

"Parse /etc/ethertypes and return values as a dictionary. If unavailable, use the copy bundled with Scapy.

scapy.data.load_manuf(filename: str) ManufDA[源代码]

Loads manuf file from Wireshark.

参数:

filename -- the file to load the manuf file from

返回:

a ManufDA filled object

scapy.data.load_protocols(filename: str, _fallback: bytes | None = None, _integer_base: int = 10, _cls: type = scapy.dadict.DADict[int, str]) DADict[int, str][源代码]

"Parse /etc/protocols and return values as a dictionary.

scapy.data.load_services(filename: str) Tuple[DADict[int, str], DADict[int, str], DADict[int, str]][源代码]
scapy.data.select_path(directories: List[str], filename: str) str | None[源代码]

Find filename among several directories