【问题标题】:Scapy verbose mode documentation [closed]Scapy详细模式文档[关闭]
【发布时间】:2017-01-30 19:29:20
【问题描述】:

我明白:

conf.verb = 0

禁用 Scapy 详细模式,但确认这一点的文档在哪里?

我的谷歌搜索失败了。

【问题讨论】:

    标签: python documentation scapy verbose


    【解决方案1】:

    实际上,conf 的文档字符串指定配置 conf.verb = 0 会将详细级别设置为几乎静音,这意味着它不会完全禁用它。

    文档字符串的相关摘录如下:

    verb     : level of verbosity, from 0 (almost mute) to 3 (verbose)
    

    这是整个文档字符串:

    In [1]: from scapy.all import conf
    WARNING: No route found for IPv6 destination :: (no default route?)
    
    In [2]: conf?
    Type:       Conf
    String Form:
    ASN1_default_codec = <ASN1Codec BER[1]>
               AS_resolver = <scapy.as_resolvers.AS_resolver_multi insta <...> alse
               use_pcap   = False
               verb       = 2
               version    = '2.3.2'
               warning_threshold = 5
               wepkey     = ''
    File:       /usr/local/lib/python2.7/dist-packages/scapy/config.py
    Docstring:
    This object contains the configuration of scapy.
    session  : filename where the session will be saved
    interactive_shell : If set to "ipython", use IPython as shell. Default: Python 
    stealth  : if 1, prevents any unwanted packet to go out (ARP, DNS, ...)
    checkIPID: if 0, doesn't check that IPID matches between IP sent and ICMP IP citation received
               if 1, checks that they either are equal or byte swapped equals (bug in some IP stacks)
               if 2, strictly checks that they are equals
    checkIPsrc: if 1, checks IP src in IP and ICMP IP citation match (bug in some NAT stacks)
    check_TCPerror_seqack: if 1, also check that TCP seq and ack match the ones in ICMP citation
    iff      : selects the default output interface for srp() and sendp(). default:"eth0")
    verb     : level of verbosity, from 0 (almost mute) to 3 (verbose)
    promisc  : default mode for listening socket (to get answers if you spoof on a lan)
    sniff_promisc : default mode for sniff()
    filter   : bpf filter added to every sniffing socket to exclude traffic from analysis
    histfile : history file
    padding  : includes padding in desassembled packets
    except_filter : BPF filter for packets to ignore
    debug_match : when 1, store received packet that are not matched into debug.recv
    route    : holds the Scapy routing table and provides methods to manipulate it
    warning_threshold : how much time between warnings from the same place
    ASN1_default_codec: Codec used by default for ASN1 objects
    mib      : holds MIB direct access dictionnary
    resolve   : holds list of fields for which resolution should be done
    noenum    : holds list of enum fields for which conversion to string should NOT be done
    AS_resolver: choose the AS resolver class to use
    extensions_paths: path or list of paths where extensions are to be looked for
    
    In [3]: 
    

    【讨论】:

    • 在哪里可以找到文档字符串?
    • scapy 的安装目录中的文件 config.py 中。在我的机器 (Ubuntu) 上,它位于 /usr/local/lib/python2.7/dist-packages/scapy/config.py。或者,您也可以导入conf 并打印conf.__doc__
    猜你喜欢
    • 1970-01-01
    • 2015-10-23
    • 1970-01-01
    • 2020-01-16
    • 1970-01-01
    • 1970-01-01
    • 2021-05-25
    • 1970-01-01
    • 2010-10-13
    相关资源
    最近更新 更多