scapy.config

实现配置对象.

class scapy.config.CacheInstance(name='noname', timeout=None)

Bases: dict, object

flush()
get(item, default=None)
items()
iteritems()
iterkeys()
itervalues()
keys()
name
summary()
timeout
update(other)
values()
class scapy.config.CommandsList

Bases: list

register(cmd)
class scapy.config.Conf

Bases: scapy.config.ConfClass

该对象包含Scapy的配置.

session

会话将被保存的文件名

interactive_shell

可以是" ipython"," python"或" auto". 默认值:自动

stealth

如果为1,则阻止任何不需要的数据包出去(ARP,DNS等)

checkIPID

如果为0,则不检查发送的IP和收到的ICMP IP引用之间的IPID是否匹配如果为1,则检查它们是否相等或字节交换等于(在某些IP堆栈中出错),如果为2,则严格检查它们是否相等

checkIPsrc

如果为1,则检查IP和ICMP IP引用中的IP src是否匹配(某些NAT堆栈中的错误)

checkIPinIP

如果为True,则检查IP-in-IP层是否匹配. 如果为False,则不要检查封装另一个IP层的IP层

check_TCPerror_seqack

如果为1,则还要检查TCP seq和ack是否与ICMP引用中的匹配

iff

选择srp()和sendp()的默认输出接口.

verb

详细程度,从0(几乎静音)到3(详细)

promisc

监听套接字的默认模式(如果您欺骗局域网则可获得答案)

sniff_promisc

sniff()的默认模式

filter

向每个嗅探套接字添加了bpf过滤器,以将流量排除在分析之外

histfile

历史档案

padding

包括在分解后的数据包中填充

except_filter

BPF过滤器,可忽略数据包

debug_match

当为1时,将接收到的不匹配的数据包存储到debug.recv中

route

保存Scapy路由表并提供对其进行操作的方法

warning_threshold

来自同一位置的两次警告之间有多少时间

ASN1_default_codec

默认情况下用于ASN1对象的编解码器

mib

拥有MIB直接访问字典

resolve

保留需要解决的字段列表

noenum

保留枚举字段列表,不应该将其转换为字符串

AS_resolver

选择要使用的AS解析器类

extensions_paths

要寻找扩展名的路径或路径列表

contribs

贡献层可以用来存储本地配置的命令

debug_tls

为1时,在计算它们时打印一些TLS会话机密.

recv_poll_rate

多久检查一次新数据包. 默认值为0.05s.

raise_no_dst_mac

为True时,如果找不到其他广播的dst MAC,则引发异常. 默认值为False.

BTsocket = None
L2listen = None
L2socket = None
L3socket = None
L3socket6 = None
USBsocket = None
auto_crop_tables = True
auto_fragment = True
bufsize = 65536
cache_iflist = {}
checkIPID = False
checkIPaddr = True
checkIPinIP = True
checkIPsrc = True
check_TCPerror_seqack = False
color_theme
commands = bind_layers : Bind 2 layers on some specific fields' values. bridge_and_sniff : Forward traffic between interfaces if1 and if2, sniff and return chexdump : Build a per byte hexadecimal representation corrupt_bits : Flip a given percentage or number of bits from a string corrupt_bytes : Corrupt a given percentage or number of bytes from a string explore : Function used to discover the Scapy layers and protocols. fletcher16_checkbytes: Calculates the Fletcher-16 checkbytes returned as 2 byte binary-string. fletcher16_checksum : Calculates Fletcher-16 checksum of the given buffer. fuzz : hexdiff : Show differences between 2 binary strings hexdump : Build a tcpdump like hexadecimal view hexedit : Run hexedit on a list of packets, then return the edited packets. hexstr : Build a fancy tcpdump like hex from bytes. import_hexcap : Imports a tcpdump like hexadecimal view linehexdump : Build an equivalent view of hexdump() on a single line ls : List available layers, or infos on a given layer class or name. rdpcap : Read a pcap or pcapng file and return a packet list restart : Restarts scapy send : sendp : sendpfast : Send packets at layer 2 using tcpreplay for performance sniff : split_layers : Split 2 layers previously bound. sr : sr1 : sr1flood : Flood and receive packets at layer 3 and return only the first answer srflood : Flood and receive packets at layer 3 srloop : Send a packet at layer 3 in loop and print the answer each time srp : srp1 : srp1flood : Flood and receive packets at layer 2 and return only the first answer srpflood : Flood and receive packets at layer 2 srploop : Send a packet at layer 2 in loop and print the answer each time tcpdump : Run tcpdump or tshark on a list of packets. tdecode : tshark : Sniff packets and print them calling pkt.summary(). wireshark : wrpcap : Write a list of packets to a pcap file
contribs = {}
crypto_valid = False
crypto_valid_advanced = False
debug_dissector = False
debug_match = False
debug_tls = False
default_l2 = None
dot15d4_protocol = None
emph = <Emphasize []>
except_filter = ''
extensions_paths = '.'
fancy_prompt = True
geoip_city = None
histfile = '/home/docs/.scapy_history'
iface = None
iface6 = None
interactive = False
interactive_shell = ''
ipv6_enabled = True
l2types =
l3types =
layers = Packet : <member 'name' of 'Packet' objects> NoPayload : <member 'name' of 'Packet' objects> Raw : <member 'name' of 'Packet' objects> Padding : <member 'name' of 'Packet' objects> ASN1_Packet : <member 'name' of 'Packet' objects>
load_layers = ['bluetooth', 'bluetooth4LE', 'dhcp', 'dhcp6', 'dns', 'dot11', 'dot15d4', 'eap', 'gprs', 'hsrp', 'inet', 'inet6', 'ipsec', 'ir', 'isakmp', 'l2', 'l2tp', 'llmnr', 'lltd', 'mgcp', 'mobileip', 'netbios', 'netflow', 'ntp', 'ppi', 'ppp', 'pptp', 'radius', 'rip', 'rtp', 'sctp', 'sixlowpan', 'skinny', 'smb', 'snmp', 'tftp', 'vrrp', 'vxlan', 'x509', 'zigbee']
logLevel
min_pkt_size = 60
netcache =
noenum = <Resolve []>
padding = 1
prog = display = 'display' dot = 'dot' hexedit = 'hexer' ifconfig = 'ifconfig' pdfreader = 'xdg-open' psreader = 'xdg-open' svgreader = 'xdg-open' tcpdump = 'tcpdump' tcpreplay = 'tcpreplay' tshark = 'tshark' universal_open = 'xdg-open' wireshark = 'wireshark'
promisc = True
prompt
raise_no_dst_mac = False
raw_layer = None
raw_summary = False
recv_poll_rate = 0.05
resolve = <Resolve []>
route = None
route6 = None
session = ''
sniff_promisc = 1
stats_classic_protocols = []
stats_dot11_protocols = []
stealth = 'not implemented'
temp_files = []
use_bpf
use_dnet = False
use_npcap = False
use_pcap
use_pypy
verb = 2
version
warning_threshold = 5
wepkey = ''
class scapy.config.ConfClass

Bases: object

configure(cnf)
class scapy.config.ConfigFieldList

Bases: object

add(*flds)
remove(*flds)
class scapy.config.Emphasize

Bases: scapy.config.ConfigFieldList

class scapy.config.Interceptor(name=None, default=None, hook=None, args=None, kargs=None)

Bases: object

static set_from_hook(obj, name, val)
class scapy.config.LayersList

Bases: list

layers()
register(layer)
class scapy.config.NetCache

Bases: object

add_cache(cache)
flush()
new_cache(name, timeout=None)
update(other)
class scapy.config.Num2Layer

Bases: object

get(item, default=None)
register(num, layer)
register_layer2num(num, layer)
register_num2layer(num, layer)
class scapy.config.ProgPath

Bases: scapy.config.ConfClass

display = 'display'
dot = 'dot'
hexedit = 'hexer'
ifconfig = 'ifconfig'
pdfreader = 'xdg-open'
psreader = 'xdg-open'
svgreader = 'xdg-open'
tcpdump = 'tcpdump'
tcpreplay = 'tcpreplay'
tshark = 'tshark'
universal_open = 'xdg-open'
wireshark = 'wireshark'
class scapy.config.Resolve

Bases: scapy.config.ConfigFieldList

scapy.config.crypto_validator(func)

此修饰符可用于依赖于密码库的任何方法. #noqa:E501其行为取决于全局'conf'的'crypto_valid'属性.

scapy.config.isCryptographyAdvanced()

检查是否存在加密库,以及它是否支持X25519,ChaCha20Poly1305等(v2.0或更高版本).

scapy.config.isCryptographyValid()

检查密码库是否存在,以及对于scapy(v1.7或更高版本)中的大多数用法而言,它是否足够新.

scapy.config.isPyPy()

返回Scapy是否在PyPy下运行

scapy.config.lsc()

显示Scapy的默认命令