scapy.volatile

包含随机数的字段.

class scapy.volatile.AutoTime(base=None, diff=None)

Bases: scapy.volatile._RandNumeral

class scapy.volatile.CorruptedBits(s, p=0.01, n=None)

Bases: scapy.volatile.CorruptedBytes

class scapy.volatile.CorruptedBytes(s, p=0.01, n=None)

Bases: scapy.volatile.VolatileValue

class scapy.volatile.DelayedEval(expr)

Bases: scapy.volatile.VolatileValue

使用示例:DelayedEval(" time.time()")

class scapy.volatile.GeneralizedTime(diff=0)

Bases: scapy.volatile.AutoTime

class scapy.volatile.IncrementalValue(start=0, step=1, restart=-1)

Bases: scapy.volatile.VolatileValue

class scapy.volatile.IntAutoTime(base=None, diff=None)

Bases: scapy.volatile.AutoTime

class scapy.volatile.RandBin(size=None)

Bases: scapy.volatile.RandString

class scapy.volatile.RandBinFloat(min, max)

Bases: scapy.volatile.RandNum

class scapy.volatile.RandByte

Bases: scapy.volatile.RandNum

class scapy.volatile.RandChoice(*args)

Bases: scapy.volatile.RandField

class scapy.volatile.RandEnum(min, max, seed=None)

Bases: scapy.volatile.RandNum

实例评估为整数采样,无需在给定间隔内进行替换

class scapy.volatile.RandEnumByte

Bases: scapy.volatile.RandEnum

class scapy.volatile.RandEnumInt

Bases: scapy.volatile.RandEnum

class scapy.volatile.RandEnumKeys(enum, seed=None)

Bases: scapy.volatile.RandEnum

从字典键列表中选择一个随机值.

class scapy.volatile.RandEnumLong

Bases: scapy.volatile.RandEnum

class scapy.volatile.RandEnumSByte

Bases: scapy.volatile.RandEnum

class scapy.volatile.RandEnumSInt

Bases: scapy.volatile.RandEnum

class scapy.volatile.RandEnumSLong

Bases: scapy.volatile.RandEnum

class scapy.volatile.RandEnumSShort

Bases: scapy.volatile.RandEnum

class scapy.volatile.RandEnumShort

Bases: scapy.volatile.RandEnum

class scapy.volatile.RandField

Bases: scapy.volatile.VolatileValue

class scapy.volatile.RandFloat(min, max)

Bases: scapy.volatile.RandNum

class scapy.volatile.RandIP(iptemplate='0.0.0.0/0')

Bases: scapy.volatile.RandString

class scapy.volatile.RandIP6(ip6template='**')

Bases: scapy.volatile.RandString

class scapy.volatile.RandInt

Bases: scapy.volatile.RandNum

class scapy.volatile.RandLong

Bases: scapy.volatile.RandNum

class scapy.volatile.RandMAC(template='*')

Bases: scapy.volatile.RandString

class scapy.volatile.RandNum(min, max)

Bases: scapy.volatile._RandNumeral

实例评估为选定范围内的随机整数

max = 0
min = 0
class scapy.volatile.RandNumExpo(lambd, base=0)

Bases: scapy.volatile._RandNumeral

class scapy.volatile.RandNumGamma(alpha, beta)

Bases: scapy.volatile._RandNumeral

class scapy.volatile.RandNumGauss(mu, sigma)

Bases: scapy.volatile._RandNumeral

class scapy.volatile.RandOID(fmt=None, depth=<RandNumExpo>, idnum=<RandNumExpo>)

Bases: scapy.volatile.RandString

class scapy.volatile.RandPool(*args)

Bases: scapy.volatile.RandField

class scapy.volatile.RandRegExp(regexp, lambda_=0.3)

Bases: scapy.volatile.RandField

static choice_expand(s)
static stack_fix(lst, index)
class scapy.volatile.RandSByte

Bases: scapy.volatile.RandNum

class scapy.volatile.RandSInt

Bases: scapy.volatile.RandNum

class scapy.volatile.RandSLong

Bases: scapy.volatile.RandNum

class scapy.volatile.RandSShort

Bases: scapy.volatile.RandNum

class scapy.volatile.RandShort

Bases: scapy.volatile.RandNum

class scapy.volatile.RandSingByte

Bases: scapy.volatile.RandSingNum

class scapy.volatile.RandSingInt

Bases: scapy.volatile.RandSingNum

class scapy.volatile.RandSingLong

Bases: scapy.volatile.RandSingNum

class scapy.volatile.RandSingNum(mn, mx)

Bases: scapy.volatile.RandSingularity

static make_power_of_two(end)
class scapy.volatile.RandSingSByte

Bases: scapy.volatile.RandSingNum

class scapy.volatile.RandSingSInt

Bases: scapy.volatile.RandSingNum

class scapy.volatile.RandSingSLong

Bases: scapy.volatile.RandSingNum

class scapy.volatile.RandSingSShort

Bases: scapy.volatile.RandSingNum

class scapy.volatile.RandSingShort

Bases: scapy.volatile.RandSingNum

class scapy.volatile.RandSingString

Bases: scapy.volatile.RandSingularity

class scapy.volatile.RandSingularity(*args)

Bases: scapy.volatile.RandChoice

class scapy.volatile.RandString(size=None, chars=b'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789')

Bases: scapy.volatile.RandField

class scapy.volatile.RandTermString(size, term)

Bases: scapy.volatile.RandBin

class scapy.volatile.RandUUID(template=None, node=None, clock_seq=None, namespace=None, name=None, version=None)

Bases: scapy.volatile.RandField

生成随机UUID.

默认情况下,这会生成RFC 4122版本4 UUID(完全随机).

有关更多信息,请参见Python的uuid模块文档.

Parameters
  • template可选 )–用于从其构建UUID的模板. 不适用于任何其他选项.

  • 节点可选 )– 48位主机ID. 仅对版本1(可选)有效.

  • clock_seq可选 )–序列号的最大14位整数. 仅对版本1(可选)有效.

  • 名称空间 –名称空间标识符,也是UUID. 版本3和5所必需,否则必须省略.

  • name –版本3和版本5必需的字符串,否则必须省略.

  • 版本 –要使用的UUID版本(1、3、4或5). 如果省略,则尝试猜测要生成哪个版本,默认为版本4(完全随机).

Raises

ValueError –无效的构造函数参数

VERSIONS = [1, 3, 4, 5]
class scapy.volatile.RandomEnumeration(inf, sup, seed=None, forever=1, renewkeys=0)

Bases: object

以随机顺序遍历序列. 绘制完所有值后,如果永远= 1,则再次进行绘制. #noqa:E501如果renewkeys = 0,则绘制顺序相同,保证相同的#noqa:E501数字将以不小于序列整数的数量绘制

next()
class scapy.volatile.VolatileValue

Bases: object

copy()
class scapy.volatile.ZuluTime(diff=0)

Bases: scapy.volatile.AutoTime