scapy.layers.inet6

IPv6(Internet协议v6).

class scapy.layers.inet6.AS_resolver6(server=None, port=43, options=None)

Bases: scapy.as_resolvers.AS_resolver_riswhois

class scapy.layers.inet6.DomainNameListField(name, default, fld=None, length_from=None, padded=False)

Bases: scapy.fields.StrLenField

i2len(pkt, x)
i2m(pkt, x)
islist = 1
m2i(pkt, x)
padded
padded_unit = 8
class scapy.layers.inet6.HAO

Bases: scapy.packet.Packet

aliastypes
alignment_delta(curpos)
extract_padding(p)
fields_desc
HAO fields

otype

_OTypeField

201

optlen

ByteField

16

hoa

IP6Field

'::'

class scapy.layers.inet6.HBHOptUnknown

Bases: scapy.packet.Packet

aliastypes
alignment_delta(curpos)

如RFC 2460第4.2节中所述,每个选项都有一个对齐要求,通常以xn + y表示,这意味着选项类型必须出现在从标头开始处加上y八位字节的x octest的整数倍.

该函数从标头的开头开始提供当前位置,并返回所需的填充长度.

classmethod dispatch_hook(_pkt=None, *args, **kargs)
extract_padding(p)
fields_desc
HBHOpt未知字段

otype

_OTypeField

1

optlen

FieldLenField

None

optdata

StrLenField

b''

class scapy.layers.inet6.ICMPv6DestUnreach

Bases: scapy.layers.inet6._ICMPv6Error

aliastypes
fields_desc
ICMPv6DestUnreach字段

type

ByteEnumField

1

code

ByteEnumField

0

cksum

XShortField

None

length

ByteField

0

unused

X3BytesField

0

post_dissection(pkt)
class scapy.layers.inet6.ICMPv6EchoReply

Bases: scapy.layers.inet6.ICMPv6EchoRequest

aliastypes
answers(other)
fields_desc
ICMPv6EchoReply字段

type

ByteEnumField

129

code

ByteField

0

cksum

XShortField

None

id

XShortField

0

seq

XShortField

0

data

StrField

b''

class scapy.layers.inet6.ICMPv6EchoRequest

Bases: scapy.layers.inet6._ICMPv6

aliastypes
fields_desc
ICMPv6EchoRequest字段

type

ByteEnumField

128

code

ByteField

0

cksum

XShortField

None

id

XShortField

0

seq

XShortField

0

data

StrField

b''

hashret()
mysummary()
class scapy.layers.inet6.ICMPv6HAADReply

Bases: scapy.layers.inet6._ICMPv6

aliastypes
answers(other)
fields_desc
ICMPv6HAAD答复字段

type

ByteEnumField

145

code

ByteField

0

cksum

XShortField

None

id

XShortField

None

R

BitEnumField (1位)

1

res

XBitField (15位)

0

addresses

IP6ListField

[]

hashret()
class scapy.layers.inet6.ICMPv6HAADRequest

Bases: scapy.layers.inet6._ICMPv6

aliastypes
fields_desc
ICMPv6HAADRequest字段

type

ByteEnumField

144

code

ByteField

0

cksum

XShortField

None

id

XShortField

None

R

BitEnumField (1位)

1

res

XBitField (15位)

0

hashret()
class scapy.layers.inet6.ICMPv6MLDMultAddrRec

Bases: scapy.packet.Packet

aliastypes
default_payload_class(packet)

组播地址记录,后跟另一个

fields_desc
ICMPv6MLDMultAddrRec字段

rtype

ByteField

4

auxdata_len

FieldLenField

None

sources_number

FieldLenField

None

dst

IP6Field

'::'

sources

IP6ListField

[]

auxdata

StrLenField

b''

class scapy.layers.inet6.ICMPv6MLDone

Bases: scapy.layers.inet6._ICMPv6ML

aliastypes
fields_desc
ICMPv6MLDone字段

type

ByteEnumField

132

code

ByteField

0

cksum

XShortField

None

mrd

ShortField

0

reserved

ShortField

0

mladdr

IP6Field

'::'

class scapy.layers.inet6.ICMPv6MLQuery

Bases: scapy.layers.inet6._ICMPv6ML

aliastypes
fields_desc
ICMPv6MLQuery字段

type

ByteEnumField

130

code

ByteField

0

cksum

XShortField

None

mrd

ShortField

10000

reserved

ShortField

0

mladdr

IP6Field

'::'

class scapy.layers.inet6.ICMPv6MLQuery2

Bases: scapy.layers.inet6._ICMPv6

aliastypes
fields_desc
ICMPv6MLQuery2字段

type

ByteEnumField

130

code

ByteField

0

cksum

XShortField

None

mrd

ShortField

10000

reserved

ShortField

0

mladdr

IP6Field

'::'

Resv

BitField (4位)

0

S

BitField (1位)

0

QRV

BitField (3位)

0

QQIC

ByteField

0

sources_number

ShortField

None

sources

IP6ListField

[]

post_build(packet, payload)

在需要时计算" sources_number"字段

class scapy.layers.inet6.ICMPv6MLReport

Bases: scapy.layers.inet6._ICMPv6ML

aliastypes
answers(query)

检查查询类型

fields_desc
ICMPv6MLReport字段

type

ByteEnumField

131

code

ByteField

0

cksum

XShortField

None

mrd

ShortField

0

reserved

ShortField

0

mladdr

IP6Field

'::'

class scapy.layers.inet6.ICMPv6MLReport2

Bases: scapy.layers.inet6._ICMPv6

aliastypes
answers(query)

检查查询类型

fields_desc
ICMPv6MLReport2字段

type

ByteEnumField

143

res

ByteField

0

cksum

XShortField

None

reserved

ShortField

0

records_number

ShortField

None

records

PacketListField

[]

post_build(packet, payload)

在需要时计算" records_number"字段

class scapy.layers.inet6.ICMPv6MPAdv

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.layers.inet6._ICMPv6

aliastypes
answers(other)
fields_desc
ICMPv6MPAdv字段

type

ByteEnumField

147

code

ByteField

0

cksum

XShortField

None

id

XShortField

None

flags

BitEnumField (2位)

2

res

XBitField (14位)

0

hashret()
class scapy.layers.inet6.ICMPv6MPSol

Bases: scapy.layers.inet6._ICMPv6

aliastypes
fields_desc
ICMPv6MPSol字段

type

ByteEnumField

146

code

ByteField

0

cksum

XShortField

None

id

XShortField

None

res

XShortField

0

class scapy.layers.inet6.ICMPv6MRD_Advertisement

Bases: scapy.layers.inet6._ICMPv6

aliastypes
extract_padding(s)
fields_desc
ICMPv6MRD_Advertisement字段

type

ByteEnumField

151

advinter

ByteField

20

cksum

XShortField

None

queryint

ShortField

0

robustness

ShortField

0

class scapy.layers.inet6.ICMPv6MRD_Solicitation

Bases: scapy.layers.inet6._ICMPv6

aliastypes
extract_padding(s)
fields_desc
ICMPv6MRD_Solicitation字段

type

ByteEnumField

152

res

ByteField

0

cksum

XShortField

None

class scapy.layers.inet6.ICMPv6MRD_Termination

Bases: scapy.layers.inet6._ICMPv6

aliastypes
extract_padding(s)
fields_desc
ICMPv6MRD_Termination字段

type

ByteEnumField

153

res

ByteField

0

cksum

XShortField

None

class scapy.layers.inet6.ICMPv6NDOptAdvInterval

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptAdvInterval字段

type

ByteField

7

len

ByteField

1

res

ShortField

0

advint

IntField

0

mysummary()
class scapy.layers.inet6.ICMPv6NDOptDNSSL

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptDNSSL字段

type

ByteField

31

len

FieldLenField

None

res

ShortField

None

lifetime

IntField

4294967295

searchlist

DomainNameListField

[]

mysummary()
class scapy.layers.inet6.ICMPv6NDOptDstLLAddr

Bases: scapy.layers.inet6.ICMPv6NDOptSrcLLAddr

aliastypes
fields_desc
ICMPv6NDOptDstLLAddr字段

type

ByteField

2

len

ByteField

1

lladdr

MACField

'00:00:00:00:00:00'

class scapy.layers.inet6.ICMPv6NDOptEFA

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptEFA字段

type

ByteField

26

len

ByteField

1

res

BitField (48位)

0

class scapy.layers.inet6.ICMPv6NDOptHAInfo

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptHAInfo字段

type

ByteField

8

len

ByteField

1

res

ShortField

0

pref

ShortField

0

lifetime

ShortField

1

mysummary()
class scapy.layers.inet6.ICMPv6NDOptIPAddr

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptIPAddr字段

type

ByteField

17

len

ByteField

3

optcode

ByteEnumField

1

plen

ByteField

64

res

IntField

0

addr

IP6Field

'::'

class scapy.layers.inet6.ICMPv6NDOptLLA

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptLLA字段

type

ByteField

19

len

ByteField

1

optcode

ByteEnumField

0

lla

MACField

'00:00:00:00:00:00'

class scapy.layers.inet6.ICMPv6NDOptMAP

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptMAP字段

type

ByteField

23

len

ByteField

3

dist

BitField (4位)

1

pref

BitField (4位)

15

R

BitField (1位)

1

res

BitField (7位)

0

validlifetime

IntField

4294967295

addr

IP6Field

'::'

class scapy.layers.inet6.ICMPv6NDOptMTU

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptMTU字段

type

ByteField

5

len

ByteField

1

res

XShortField

0

mtu

IntField

1280

mysummary()
class scapy.layers.inet6.ICMPv6NDOptNewRtrPrefix

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptNewRtrPrefix字段

type

ByteField

18

len

ByteField

3

optcode

ByteField

0

plen

ByteField

64

res

IntField

0

prefix

IP6Field

'::'

class scapy.layers.inet6.ICMPv6NDOptPrefixInfo

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptPrefixInfo字段

type

ByteField

3

len

ByteField

4

prefixlen

ByteField

None

L

BitField (1位)

1

A

BitField (1位)

1

R

BitField (1位)

0

res1

BitField (5位)

0

validlifetime

XIntField

4294967295

preferredlifetime

XIntField

4294967295

res2

XIntField

0

prefix

IP6Field

'::'

mysummary()
class scapy.layers.inet6.ICMPv6NDOptRDNSS

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptRDNSS字段

type

ByteField

25

len

FieldLenField

None

res

ShortField

None

lifetime

IntField

4294967295

dns

IP6ListField

[]

mysummary()
class scapy.layers.inet6.ICMPv6NDOptRedirectedHdr

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptRedirectedHdr字段

type

ByteField

4

len

FieldLenField

None

res

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00'

pkt

TruncPktLenField

b''

class scapy.layers.inet6.ICMPv6NDOptRouteInfo

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptRouteInfo字段

type

ByteField

24

len

FieldLenField

None

plen

ByteField

None

res1

BitField (3位)

0

prf

BitEnumField (2位)

0

res2

BitField (3位)

0

rtlifetime

IntField

4294967295

prefix

_IP6PrefixField

None

mysummary()
class scapy.layers.inet6.ICMPv6NDOptShortcutLimit

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptShortcutLimit字段

type

ByteField

6

len

ByteField

1

shortcutlim

ByteField

40

res1

ByteField

0

res2

IntField

0

class scapy.layers.inet6.ICMPv6NDOptSrcAddrList

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptSrcAddrList字段

type

ByteField

9

len

FieldLenField

None

res

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00'

addrlist

IP6ListField

[]

class scapy.layers.inet6.ICMPv6NDOptSrcLLAddr

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptSrcLLAddr字段

type

ByteField

1

len

ByteField

1

lladdr

MACField

'00:00:00:00:00:00'

mysummary()
class scapy.layers.inet6.ICMPv6NDOptTgtAddrList

Bases: scapy.layers.inet6.ICMPv6NDOptSrcAddrList

aliastypes
fields_desc
ICMPv6NDOptTgtAddrList字段

type

ByteField

10

len

FieldLenField

None

res

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00'

addrlist

IP6ListField

[]

class scapy.layers.inet6.ICMPv6NDOptUnknown

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6NDOptUnknown字段

type

ByteField

None

len

FieldLenField

None

data

StrLenField

b''

class scapy.layers.inet6.ICMPv6ND_INDAdv

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.layers.inet6._ICMPv6

aliastypes
fields_desc
ICMPv6ND_INDAdv字段

type

ByteEnumField

142

code

ByteField

0

cksum

XShortField

None

reserved

XIntField

0

class scapy.layers.inet6.ICMPv6ND_INDSol

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.layers.inet6._ICMPv6

aliastypes
fields_desc
ICMPv6ND_INDSol字段

type

ByteEnumField

141

code

ByteField

0

cksum

XShortField

None

reserved

XIntField

0

class scapy.layers.inet6.ICMPv6ND_NA

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.layers.inet6._ICMPv6, scapy.packet.Packet

aliastypes
answers(other)
fields_desc
ICMPv6ND_NA字段

type

ByteEnumField

136

code

ByteField

0

cksum

XShortField

None

R

BitField (1位)

1

S

BitField (1位)

0

O

BitField (1位)

1

res

XBitField (29位)

0

tgt

IP6Field

'::'

hashret()
mysummary()
class scapy.layers.inet6.ICMPv6ND_NS

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.layers.inet6._ICMPv6, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6ND_NS字段

type

ByteEnumField

135

code

ByteField

0

cksum

XShortField

None

res

IntField

0

tgt

IP6Field

'::'

hashret()
mysummary()
class scapy.layers.inet6.ICMPv6ND_RA

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.layers.inet6._ICMPv6

aliastypes
answers(other)
fields_desc
ICMPv6ND_RA字段

type

ByteEnumField

134

code

ByteField

0

cksum

XShortField

None

chlim

ByteField

0

M

BitField (1位)

0

O

BitField (1位)

0

H

BitField (1位)

0

prf

BitEnumField (2位)

1

P

BitField (1位)

0

res

BitField (2位)

0

routerlifetime

ShortField

1800

reachabletime

IntField

0

retranstimer

IntField

0

mysummary()
class scapy.layers.inet6.ICMPv6ND_RS

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.layers.inet6._ICMPv6

aliastypes
fields_desc
ICMPv6ND_RS字段

type

ByteEnumField

133

code

ByteField

0

cksum

XShortField

None

res

IntField

0

class scapy.layers.inet6.ICMPv6ND_Redirect

Bases: scapy.layers.inet6._ICMPv6NDGuessPayload, scapy.layers.inet6._ICMPv6, scapy.packet.Packet

aliastypes
fields_desc
ICMPv6ND_Redirect字段

type

ByteEnumField

137

code

ByteField

0

cksum

XShortField

None

res

XIntField

0

tgt

IP6Field

'::'

dst

IP6Field

'::'

class scapy.layers.inet6.ICMPv6NIQueryIPv4

Bases: scapy.layers.inet6.ICMPv6NIQueryNOOP

aliastypes
fields_desc
ICMPv6NIQueryIPv4字段

type

ByteEnumField

139

code

NIQueryCodeField

None

cksum

XShortField

None

qtype

ShortEnumField

4

unused

BitField (10位)

0

flags

FlagsField (6位)

<Flag 0 ()>

nonce

NonceField

<RandBin>

data

NIQueryDataField

(1, b'\x00\x00\x00')

class scapy.layers.inet6.ICMPv6NIQueryIPv6

Bases: scapy.layers.inet6.ICMPv6NIQueryNOOP

aliastypes
fields_desc
ICMPv6NIQueryIPv6字段

type

ByteEnumField

139

code

NIQueryCodeField

None

cksum

XShortField

None

qtype

ShortEnumField

3

unused

BitField (10位)

0

flags

FlagsField (6位)

62

nonce

NonceField

<RandBin>

data

NIQueryDataField

(1, b'\x00\x00\x00')

class scapy.layers.inet6.ICMPv6NIQueryNOOP

Bases: scapy.layers.inet6._ICMPv6NIHashret, scapy.layers.inet6._ICMPv6

aliastypes
fields_desc
ICMPv6NIQueryNOOP字段

type

ByteEnumField

139

code

NIQueryCodeField

None

cksum

XShortField

None

qtype

ShortEnumField

0

unused

BitField (10位)

0

flags

FlagsField (6位)

<Flag 0 ()>

nonce

NonceField

<RandBin>

data

NIQueryDataField

(1, b'\x00\x00\x00')

class scapy.layers.inet6.ICMPv6NIQueryName

Bases: scapy.layers.inet6.ICMPv6NIQueryNOOP

aliastypes
fields_desc
ICMPv6NIQueryName字段

type

ByteEnumField

139

code

NIQueryCodeField

None

cksum

XShortField

None

qtype

ShortEnumField

2

unused

BitField (10位)

0

flags

FlagsField (6位)

<Flag 0 ()>

nonce

NonceField

<RandBin>

data

NIQueryDataField

(1, b'\x00\x00\x00')

class scapy.layers.inet6.ICMPv6NIReplyIPv4

Bases: scapy.layers.inet6.ICMPv6NIReplyNOOP

aliastypes
fields_desc
ICMPv6NIReplyIPv4字段

type

ByteEnumField

140

code

ByteEnumField

0

cksum

XShortField

None

qtype

ShortEnumField

4

unused

BitField (10位)

0

flags

FlagsField (6位)

<Flag 0 ()>

nonce

NonceField

<RandBin>

data

NIReplyDataField

(0, None)

class scapy.layers.inet6.ICMPv6NIReplyIPv6

Bases: scapy.layers.inet6.ICMPv6NIReplyNOOP

aliastypes
fields_desc
ICMPv6NIReplyIPv6字段

type

ByteEnumField

140

code

ByteEnumField

0

cksum

XShortField

None

qtype

ShortEnumField

3

unused

BitField (10位)

0

flags

FlagsField (6位)

<Flag 0 ()>

nonce

NonceField

<RandBin>

data

NIReplyDataField

(0, None)

class scapy.layers.inet6.ICMPv6NIReplyNOOP

Bases: scapy.layers.inet6._ICMPv6NIAnswers, scapy.layers.inet6._ICMPv6NIHashret, scapy.layers.inet6._ICMPv6

aliastypes
fields_desc
ICMPv6NIReplyNOOP字段

type

ByteEnumField

140

code

ByteEnumField

0

cksum

XShortField

None

qtype

ShortEnumField

0

unused

BitField (10位)

0

flags

FlagsField (6位)

<Flag 0 ()>

nonce

NonceField

<RandBin>

data

NIReplyDataField

(0, None)

class scapy.layers.inet6.ICMPv6NIReplyName

Bases: scapy.layers.inet6.ICMPv6NIReplyNOOP

aliastypes
fields_desc
ICMPv6NIReplyName字段

type

ByteEnumField

140

code

ByteEnumField

0

cksum

XShortField

None

qtype

ShortEnumField

2

unused

BitField (10位)

0

flags

FlagsField (6位)

<Flag 0 ()>

nonce

NonceField

<RandBin>

data

NIReplyDataField

(0, None)

class scapy.layers.inet6.ICMPv6NIReplyRefuse

Bases: scapy.layers.inet6.ICMPv6NIReplyNOOP

aliastypes
fields_desc
ICMPv6NIReplyRefuse字段

type

ByteEnumField

140

code

ByteEnumField

1

cksum

XShortField

None

qtype

ShortEnumField

0

unused

BitField (10位)

0

flags

FlagsField (6位)

<Flag 0 ()>

nonce

NonceField

<RandBin>

data

NIReplyDataField

(0, None)

class scapy.layers.inet6.ICMPv6NIReplyUnknown

Bases: scapy.layers.inet6.ICMPv6NIReplyNOOP

aliastypes
fields_desc
ICMPv6NIReplyUnknown字段

type

ByteEnumField

140

code

ByteEnumField

2

cksum

XShortField

None

qtype

ShortEnumField

0

unused

BitField (10位)

0

flags

FlagsField (6位)

<Flag 0 ()>

nonce

NonceField

<RandBin>

data

NIReplyDataField

(0, None)

class scapy.layers.inet6.ICMPv6PacketTooBig

Bases: scapy.layers.inet6._ICMPv6Error

aliastypes
fields_desc
ICMPv6PacketTooBig字段

type

ByteEnumField

2

code

ByteField

0

cksum

XShortField

None

mtu

IntField

1280

class scapy.layers.inet6.ICMPv6ParamProblem

Bases: scapy.layers.inet6._ICMPv6Error

aliastypes
fields_desc
ICMPv6ParamProblem字段

type

ByteEnumField

4

code

ByteEnumField

0

cksum

XShortField

None

ptr

IntField

6

class scapy.layers.inet6.ICMPv6TimeExceeded

Bases: scapy.layers.inet6._ICMPv6Error

aliastypes
fields_desc
ICMPv6TimeExceeded fields

type

ByteEnumField

3

code

ByteEnumField

0

cksum

XShortField

None

length

ByteField

0

unused

X3BytesField

0

post_dissection(pkt)
class scapy.layers.inet6.ICMPv6Unknown

Bases: scapy.layers.inet6._ICMPv6

aliastypes
fields_desc
ICMPv6未知字段

type

ByteEnumField

1

code

ByteField

0

cksum

XShortField

None

msgbody

StrField

b''

class scapy.layers.inet6.IP6ListField(name, default, count_from=None, length_from=None)

Bases: scapy.fields.StrField

count_from
getfield(pkt, s)
i2count(pkt, i)
i2len(pkt, i)
i2m(pkt, x)
i2repr(pkt, x)
islist = 1
length_from
class scapy.layers.inet6.IPerror6

Bases: scapy.layers.inet6.IPv6

aliastypes
answers(other)
fields_desc
IPerror6字段

version

BitField (4位)

6

tc

BitField (8位)

0

fl

BitField (20位)

0

plen

ShortField

None

nh

ByteEnumField

59

hlim

ByteField

64

src

SourceIP6Field

None

dst

DestIP6Field

None

mysummary()
payload_guess

可能的子层: TCPerrorUDPerror

class scapy.layers.inet6.IPv6

Bases: scapy.layers.inet6._IPv6GuessPayload, scapy.packet.Packet, scapy.layers.inet.IPTools

aliastypes
answers(other)
extract_padding(data)

提取IPv6有效负载

fields_desc
IPv6字段

version

BitField (4位)

6

tc

BitField (8位)

0

fl

BitField (20位)

0

plen

ShortField

None

nh

ByteEnumField

59

hlim

ByteField

64

src

SourceIP6Field

None

dst

DestIP6Field

None

hashret()
mysummary()
payload_guess

可能的子层: EIGRPMPLSOSPFv3_HdrIPTCPUDPIPv6AHESPGRESCTPVRRPv3

post_build(p, pay)
route()

用于选择L2地址

class scapy.layers.inet6.IPv6ExtHdrDestOpt

Bases: scapy.layers.inet6._IPv6ExtHdr

aliastypes
fields_desc
IPv6ExtHdrDestOpt字段

nh

ByteEnumField

59

len

FieldLenField

None

autopad

_PhantomAutoPadField

1

options

_OptionsField

[]

class scapy.layers.inet6.IPv6ExtHdrFragment

Bases: scapy.layers.inet6._IPv6ExtHdr

aliastypes
fields_desc
IPv6ExtHdrFragment字段

nh

ByteEnumField

59

res1

BitField (8位)

0

offset

BitField (13位)

0

res2

BitField (2位)

0

m

BitField (1位)

0

id

IntField

None

class scapy.layers.inet6.IPv6ExtHdrHopByHop

Bases: scapy.layers.inet6._IPv6ExtHdr

aliastypes
fields_desc
IPv6ExtHdrHopByHop字段

nh

ByteEnumField

59

len

FieldLenField

None

autopad

_PhantomAutoPadField

1

options

_OptionsField

[]

class scapy.layers.inet6.IPv6ExtHdrRouting

Bases: scapy.layers.inet6._IPv6ExtHdr

aliastypes
fields_desc
IPv6ExtHdrRouting字段

nh

ByteEnumField

59

len

FieldLenField

None

type

ByteField

0

segleft

ByteField

None

reserved

BitField (32位)

0

addresses

IP6ListField

[]

post_build(pkt, pay)
class scapy.layers.inet6.IPv6ExtHdrSegmentRouting

Bases: scapy.layers.inet6._IPv6ExtHdr

aliastypes
fields_desc
IPv6ExtHdrSegmentRouting字段

nh

ByteEnumField

59

len

ByteField

None

type

ByteField

4

segleft

ByteField

None

lastentry

ByteField

None

unused1

BitField (1位)

0

protected

BitField (1位)

0

oam

BitField (1位)

0

alert

BitField (1位)

0

hmac

BitField (1位)

0

unused2

BitField (3位)

0

tag

ShortField

0

addresses

IP6ListField

['::1']

tlv_objects

PacketListField

[]

post_build(pkt, pay)
class scapy.layers.inet6.IPv6ExtHdrSegmentRoutingTLV

Bases: scapy.packet.Packet

aliastypes
classmethod dispatch_hook(pkt=None, *args, **kargs)
extract_padding(p)
fields_desc
IPv6ExtHdrSegmentRoutingTLV字段

type

ByteField

0

len

ByteField

0

reserved

ByteField

0

flags

ByteField

0

value

StrLenField

b''

classmethod register_variant()
registered_sr_tlv = {0: <class 'scapy.layers.inet6.IPv6ExtHdrSegmentRoutingTLV'>, 1: <class 'scapy.layers.inet6.IPv6ExtHdrSegmentRoutingTLVIngressNode'>, 2: <class 'scapy.layers.inet6.IPv6ExtHdrSegmentRoutingTLVEgressNode'>, 4: <class 'scapy.layers.inet6.IPv6ExtHdrSegmentRoutingTLVPadding'>}
class scapy.layers.inet6.IPv6ExtHdrSegmentRoutingTLVEgressNode

Bases: scapy.layers.inet6.IPv6ExtHdrSegmentRoutingTLV

aliastypes
fields_desc
IPv6ExtHdrSegmentRoutingTLVEgressNode字段

type

ByteField

2

len

ByteField

18

reserved

ByteField

0

flags

ByteField

0

egress_node

IP6Field

'::1'

class scapy.layers.inet6.IPv6ExtHdrSegmentRoutingTLVIngressNode

Bases: scapy.layers.inet6.IPv6ExtHdrSegmentRoutingTLV

aliastypes
fields_desc
IPv6ExtHdrSegmentRoutingTLVIngressNode字段

type

ByteField

1

len

ByteField

18

reserved

ByteField

0

flags

ByteField

0

ingress_node

IP6Field

'::1'

class scapy.layers.inet6.IPv6ExtHdrSegmentRoutingTLVPadding

Bases: scapy.layers.inet6.IPv6ExtHdrSegmentRoutingTLV

aliastypes
fields_desc
IPv6ExtHdrSegmentRoutingTLVP添加字段

type

ByteField

4

len

FieldLenField

None

padding

StrLenField

b'\x00'

scapy.layers.inet6.IPv6inIP(dst='203.178.135.36', src=None)
class scapy.layers.inet6.Jumbo

Bases: scapy.packet.Packet

aliastypes
alignment_delta(curpos)
extract_padding(p)
fields_desc
巨型领域

otype

_OTypeField

194

optlen

ByteField

4

jumboplen

IntField

None

class scapy.layers.inet6.L3RawSocket6(type=34525, filter=None, iface=None, promisc=None, nofilter=0)

Bases: scapy.supersocket.L3RawSocket

class scapy.layers.inet6.LifetimeField(name, default)

Bases: scapy.fields.ShortField

i2repr(pkt, x)
class scapy.layers.inet6.MIP6MH_BA

Bases: scapy.layers.inet6._MobilityHeader

aliastypes
answers(other)
fields_desc
MIP6MH_BA字段

nh

ByteEnumField

59

len

ByteField

None

mhtype

ByteEnumField

6

res

ByteField

None

cksum

XShortField

None

status

ByteEnumField

0

flags

FlagsField (3 bits)

<Flag 4 (K)>

res2

XBitField (5位)

None

seq

XShortField

None

mhtime

XShortField

0

autopad

_PhantomAutoPadField

1

options

_OptionsField

[]

hashret()
class scapy.layers.inet6.MIP6MH_BE

Bases: scapy.layers.inet6._MobilityHeader

aliastypes
fields_desc
MIP6MH_BE字段

nh

ByteEnumField

59

len

ByteField

None

mhtype

ByteEnumField

7

res

ByteField

0

cksum

XShortField

None

status

ByteEnumField

0

reserved

ByteField

0

ha

IP6Field

'::'

options

_OptionsField

[]

class scapy.layers.inet6.MIP6MH_BRR

Bases: scapy.layers.inet6._MobilityHeader

aliastypes
fields_desc
MIP6MH_BRR字段

nh

ByteEnumField

59

len

ByteField

None

mhtype

ByteEnumField

0

res

ByteField

None

cksum

XShortField

None

res2

ShortField

None

autopad

_PhantomAutoPadField

1

options

_OptionsField

[]

hashret()
class scapy.layers.inet6.MIP6MH_BU

Bases: scapy.layers.inet6._MobilityHeader

aliastypes
answers(other)
fields_desc
MIP6MH_BU字段

nh

ByteEnumField

59

len

ByteField

None

mhtype

ByteEnumField

5

res

ByteField

None

cksum

XShortField

None

seq

XShortField

None

flags

FlagsField (7位)

<Flag 104 (KHA)>

reserved

XBitField (9 bits)

0

mhtime

LifetimeField

3

autopad

_PhantomAutoPadField

1

options

_OptionsField

[]

hashret()
class scapy.layers.inet6.MIP6MH_CoT

Bases: scapy.layers.inet6.MIP6MH_HoT

aliastypes
answers(other)
fields_desc
MIP6MH_CoT字段

nh

ByteEnumField

59

len

ByteField

None

mhtype

ByteEnumField

4

res

ByteField

None

cksum

XShortField

None

index

ShortField

None

cookie

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00'

token

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00'

autopad

_PhantomAutoPadField

1

options

_OptionsField

[]

hashret()
class scapy.layers.inet6.MIP6MH_CoTI

Bases: scapy.layers.inet6.MIP6MH_HoTI

aliastypes
fields_desc
MIP6MH_CoTI字段

nh

ByteEnumField

59

len

ByteField

None

mhtype

ByteEnumField

2

res

ByteField

None

cksum

XShortField

None

reserved

StrFixedLenField

b'\x00\x00'

cookie

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00'

autopad

_PhantomAutoPadField

1

options

_OptionsField

[]

hashret()
class scapy.layers.inet6.MIP6MH_Generic

Bases: scapy.layers.inet6._MobilityHeader

aliastypes
fields_desc
MIP6MH_Generic fields

nh

ByteEnumField

59

len

ByteField

None

mhtype

ByteEnumField

None

res

ByteField

None

cksum

XShortField

None

msg

StrLenField

b'\x00\x00'

class scapy.layers.inet6.MIP6MH_HoT

Bases: scapy.layers.inet6._MobilityHeader

aliastypes
answers(other)
fields_desc
MIP6MH_HoT字段

nh

ByteEnumField

59

len

ByteField

None

mhtype

ByteEnumField

3

res

ByteField

None

cksum

XShortField

None

index

ShortField

None

cookie

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00'

token

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00'

autopad

_PhantomAutoPadField

1

options

_OptionsField

[]

hashret()
class scapy.layers.inet6.MIP6MH_HoTI

Bases: scapy.layers.inet6._MobilityHeader

aliastypes
fields_desc
MIP6MH_HoTI字段

nh

ByteEnumField

59

len

ByteField

None

mhtype

ByteEnumField

1

res

ByteField

None

cksum

XShortField

None

reserved

StrFixedLenField

b'\x00\x00'

cookie

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00'

autopad

_PhantomAutoPadField

1

options

_OptionsField

[]

hashret()
class scapy.layers.inet6.MIP6OptAltCoA

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptAltCoA字段

otype

ByteEnumField

3

olen

ByteField

16

acoa

IP6Field

'::'

x = 8
y = 6
class scapy.layers.inet6.MIP6OptBRAdvice

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptBRAdvice字段

otype

ByteEnumField

2

olen

ByteField

2

rinter

ShortField

0

x = 2
y = 0
class scapy.layers.inet6.MIP6OptBindingAuthData

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptBindingAuthData字段

otype

ByteEnumField

5

olen

ByteField

16

authenticator

BitField (96位)

0

x = 8
y = 2
class scapy.layers.inet6.MIP6OptCGAParams

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptCGAParams字段

otype

ByteEnumField

12

olen

FieldLenField

None

cgaparams

StrLenField

b''

x = 0
y = 0
class scapy.layers.inet6.MIP6OptCGAParamsReq

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptCGAParamsReq字段

otype

ByteEnumField

11

olen

ByteField

0

x = 0
y = 0
class scapy.layers.inet6.MIP6OptCareOfTest

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptCareOfTest fields

otype

ByteEnumField

16

olen

FieldLenField

None

cokt

StrLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00'

x = 0
y = 0
class scapy.layers.inet6.MIP6OptCareOfTestInit

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptCareOfTestInit字段

otype

ByteEnumField

15

olen

ByteField

0

x = 0
y = 0
class scapy.layers.inet6.MIP6OptHomeKeygenToken

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptHomeKeygenToken字段

otype

ByteEnumField

14

olen

FieldLenField

None

hkt

StrLenField

b''

x = 0
y = 0
class scapy.layers.inet6.MIP6OptLLAddr

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptLLAddr字段

otype

ByteEnumField

7

olen

ByteField

7

ocode

ByteEnumField

2

pad

ByteField

0

lla

MACField

'00:00:00:00:00:00'

x = 0
y = 0
class scapy.layers.inet6.MIP6OptMNID

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptMNID字段

otype

ByteEnumField

8

olen

FieldLenField

None

subtype

ByteEnumField

1

id

StrLenField

b''

x = 0
y = 0
class scapy.layers.inet6.MIP6OptMobNetPrefix

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptMobNetPrefix字段

otype

ByteEnumField

6

olen

ByteField

18

reserved

ByteField

0

plen

ByteField

64

prefix

IP6Field

'::'

x = 8
y = 4
class scapy.layers.inet6.MIP6OptMsgAuth

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptMsgAuth字段

otype

ByteEnumField

9

olen

FieldLenField

None

subtype

ByteEnumField

1

mspi

IntField

None

authdata

StrLenField

b'AAAAAAAAAAAA'

x = 4
y = 1
class scapy.layers.inet6.MIP6OptNonceIndices

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptNonceIndices字段

otype

ByteEnumField

4

olen

ByteField

16

hni

ShortField

0

coni

ShortField

0

x = 2
y = 0
class scapy.layers.inet6.MIP6OptReplayProtection

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptReplayProtection字段

otype

ByteEnumField

10

olen

ByteField

8

timestamp

NTPTimestampField

0

x = 8
y = 2
class scapy.layers.inet6.MIP6OptSignature

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
fields_desc
MIP6OptSignature字段

otype

ByteEnumField

13

olen

FieldLenField

None

sig

StrLenField

b''

x = 0
y = 0
class scapy.layers.inet6.MIP6OptUnknown

Bases: scapy.layers.inet6._MIP6OptAlign

aliastypes
classmethod dispatch_hook(_pkt=None, *_, **kargs)
fields_desc
MIP6Opt未知字段

otype

ByteEnumField

6

olen

FieldLenField

None

odata

StrLenField

b''

x = 0
y = 0
scapy.layers.inet6.NDP_Attack_DAD_DoS_via_NA(iface=None, mac_src_filter=None, tgt_filter=None, reply_mac=None)

使用RFC 3756第4.1.3节中所述的NS执行DAD DoS攻击.这是通过侦听从未指定地址发送的传入NS消息并发送针对目标地址的NA答复来完成的,从而导致对等方认为另一个节点也是为该地址执行DAD.

By default, the fake NA sent to create the DoS uses:
  • 作为目标地址,在收到的NS中找到目标地址.

  • 作为IPv6源地址:在接收到的NS中找到的目标地址.

  • 作为IPv6目的地址:从接收到的NS中的目标地址派生而来的链路本地被请求节点组播地址.

  • 接口的mac地址作为源地址(或reply_mac,请参见下文).

  • 从被请求节点多播地址派生的多播mac地址,用作IPv6目标地址.

  • 目标链接层地址选项(ICMPv6NDOptDstLLAddr)填充有用作NA来源的mac地址.

以下参数可用于更改行为:

iface: a specific interface (e.g. “eth0”) of the system on which the

应该启动DoS. 如果未提供,则使用conf.iface.

mac_src_filter: a mac address (e.g “00:13:72:8c:b5:69”) to filter on.

仅从此源接收到的NS消息将触发答复. 通过过滤其mac地址,可以将DoS的影响限制在单个目标上. 默认值为"无":DoS不限于特定的mac地址.

tgt_filter: Same as previous but for a specific target IPv6 address for

收到NS. 如果NS消息中的目标地址(不是IPv6目标地址)与该地址匹配,则将发送虚假答复,即,发送方将成为DoS的目标.

reply_mac: allow specifying a specific source mac address for the reply,

即防止使用接口的mac地址. 该地址还将在"目标链接层地址"选项中使用.

scapy.layers.inet6.NDP_Attack_DAD_DoS_via_NS(iface=None, mac_src_filter=None, tgt_filter=None, reply_mac=None)

使用RFC 3756第4.1.3节中描述的NS执行DAD DoS攻击.这是通过侦听从未指定地址发送的入站NS消息并发送针对目标地址的NS答复来完成的,从而导致对等方认为另一个节点也是为该地址执行DAD.

By default, the fake NS sent to create the DoS uses:
  • 作为目标地址,在收到的NS中找到目标地址.

  • 作为IPv6源地址:未指定的地址(::).

  • 作为IPv6目的地址:从接收到的NS中的目标地址派生而来的链路本地被请求节点组播地址.

  • 接口的mac地址作为源地址(或reply_mac,请参见下文).

  • 从被请求节点多播地址派生的多播mac地址,用作IPv6目标地址.

以下参数可用于更改行为:

iface: a specific interface (e.g. “eth0”) of the system on which the

应该启动DoS. 如果未提供,则使用conf.iface.

mac_src_filter: a mac address (e.g “00:13:72:8c:b5:69”) to filter on.

仅从此源接收到的NS消息将触发答复. 通过过滤其mac地址,可以将DoS的影响限制在单个目标上. 默认值为"无":DoS不限于特定的mac地址.

tgt_filter: Same as previous but for a specific target IPv6 address for

received NS. If the target address in the NS message (not the IPv6 destination address) matches that address, then a fake reply will be sent, i.e. the emitter will be a target of the DoS.

reply_mac: allow specifying a specific source mac address for the reply,

即防止使用接口的mac地址.

scapy.layers.inet6.NDP_Attack_Fake_Router(ra, iface=None, mac_src_filter=None, ip_src_filter=None)

此功能的目的是响应收到的RS消息在第2层发送提供的RA消息(即,提供以IPv6开头的数据包将不起作用). 最后,该函数是sendp()的简单包装,用于监视链接的RS消息.

最好用一个例子来解释一下:

>>> ra  = Ether()/IPv6()/ICMPv6ND_RA()
>>> ra /= ICMPv6NDOptPrefixInfo(prefix="2001:db8:1::", prefixlen=64)
>>> ra /= ICMPv6NDOptPrefixInfo(prefix="2001:db8:2::", prefixlen=64)
>>> ra /= ICMPv6NDOptSrcLLAddr(lladdr="00:11:22:33:44:55")
>>> NDP_Attack_Fake_Router(ra, iface="eth0")
Fake RA sent in response to RS from fe80::213:58ff:fe8c:b573
Fake RA sent in response to RS from fe80::213:72ff:fe8c:b9ae
...

以下参数可用于更改行为:

ra:响应收到的RS消息而发送的RA消息.

iface: a specific interface (e.g. “eth0”) of the system on which the

应该启动DoS. 如果未提供,则使用conf.iface.

mac_src_filter: a mac address (e.g “00:13:72:8c:b5:69”) to filter on.

仅从该源接收到的RS消息将触发答复. 请注意,没有对提供的RA进行任何更改,这意味着如果您打算使用此选项仅将RS的源作为目标,则必须在RA中将以太网目标地址设置为相同的值. 该参数的默认值为"无":不对RS源进行任何过滤.

ip_src_filter: an IPv6 address (e.g. fe80::21e:bff:fe4e:3b2) to filter

上. 仅从该源地址接收到的RS消息将触发答复. 适用与上一个参数相同的注释:如果使用该选项,则可能要在RA中设置特定的以太网目标地址.

scapy.layers.inet6.NDP_Attack_Kill_Default_Router(iface=None, mac_src_filter=None, ip_src_filter=None, reply_mac=None, tgt_mac=None)

该功能的目的是监视默认路由器(具有非零路由器生存时间值的RA)发送的传入RA消息,并通过立即用通告零路由器生存时间值的伪造RA消息进行答复来使它们无效.

The result on receivers is that the router is immediately invalidated, i.e. the associated entry is discarded from the default router list and destination cache is updated to reflect the change.

默认情况下,该功能考虑所有具有非零"路由器生存期"值的RA消息,但提供配置旋钮以允许过滤由特定路由器发送的RA(以太网源地址). 关于发射,默认情况下使用多播所有节点地址,但可以使用特定目标,以便DoS仅适用于特定主机.

更准确地说,可以使用以下参数来更改行为:

iface: a specific interface (e.g. “eth0”) of the system on which the

应该启动DoS. 如果未提供,则使用conf.iface.

mac_src_filter: a mac address (e.g “00:13:72:8c:b5:69”) to filter on.

仅从此源接收到的RA消息将触发答复. 如果其他默认路由器在链路上通告了它们的存在,则其客户端不会受到攻击的影响. 默认值为"无":DoS不限于特定的mac地址.

ip_src_filter: an IPv6 address (e.g. fe80::21e:bff:fe4e:3b2) to filter

上. 仅从该源地址接收到的RA消息将触发答复. 如果其他默认路由器在链路上通告了它们的存在,则其客户端不会受到攻击的影响. 默认值为"无":DoS不限于特定的IPv6源地址.

reply_mac: allow specifying a specific source mac address for the reply,

即防止使用接口的mac地址.

tgt_mac: allow limiting the effect of the DoS to a specific host,

通过仅将"无效RA"发送到其mac地址.

scapy.layers.inet6.NDP_Attack_NA_Spoofing(iface=None, mac_src_filter=None, tgt_filter=None, reply_mac=None, router=False)

此功能的主要目的是向受害者发送虚假的邻居广告消息. 由于主动发送邻居广告是毫无意义的(从攻击者的角度来看),因为它不会导致受害者邻居缓存的修改,因此该函数响应收到的NS(NS作为DAD的一部分发送,即与未指定地址作为来源).

By default, the fake NA sent to create the DoS uses:
  • 作为目标地址,在收到的NS中找到目标地址.

  • 作为IPv6源地址:目标地址

  • 作为IPv6目的地址:接收到的NS消息的源IPv6地址.

  • 接口的mac地址作为源地址(或reply_mac,请参见下文).

  • 接收到的NS的源mac地址作为发出的NA的目标mac地址.

  • 目标链接层地址选项(ICMPv6NDOptDstLLAddr)填充有用作NA来源的mac地址.

以下参数可用于更改行为:

iface: a specific interface (e.g. “eth0”) of the system on which the

应该启动DoS. 如果未提供,则使用conf.iface.

mac_src_filter: a mac address (e.g “00:13:72:8c:b5:69”) to filter on.

仅从此源接收到的NS消息将触发答复. 通过过滤其mac地址,可以将DoS的影响限制在单个目标上. 默认值为"无":DoS不限于特定的mac地址.

tgt_filter: Same as previous but for a specific target IPv6 address for

收到NS. 如果NS消息中的目标地址(不是IPv6目标地址)与该地址匹配,则将发送虚假答复,即,发送方将成为DoS的目标.

reply_mac: allow specifying a specific source mac address for the reply,

即防止使用接口的mac地址. 该地址还将在"目标链接层地址"选项中使用.

router: by the default (False) the ‘R’ flag in the NA used for the reply

未设置. 如果参数设置为True,则会在NA中设置" R"标志,从而将我们宣传为路由器.

使用该函数时,请记住以下几点:出于明显的原因(内核空间与Python速度),当地址解析的目标位于链接上时,NS的发送者连续接收2个NA消息,有效的和我们的假的. 第二个将覆盖第一个提供的信息,即Scapy的自然延迟在这里有所帮助.

实际上,在公共以太网链路上,从真正目标(内核堆栈)发出NA的时间通常与接收NS的时间相同. Scapy6生成的NA通常会在20毫秒后出现. 例如,在一个普通的测试台上,这种差异足以使第一个数据包从受害者发送到目的地,甚至还没有收到我们的伪造NA.

scapy.layers.inet6.NDP_Attack_NS_Spoofing(src_lladdr=None, src=None, target='2001:db8::1', dst=None, src_mac=None, dst_mac=None, loop=True, inter=1, iface=None)

此功能的主要目的是向受害者发送伪造的邻居请求消息,以便在其邻居缓存中创建新条目或更新现有条目. 在RFC 4861的7.2.3节中,声明了一个节点应该创建该条目或更新一个现有的条目(如果它当前不为NS的目标执行DAD). 条目的可达性#noqa:E501状态设置为STALE.

该功能的两个主要参数是源链路层地址(由NS中的"源链路层地址"选项携带)和数据包的源地址.

与其他NDP_Attack_ *函数不同,该函数不是基于刺激/响应模型. 调用时,它每秒循环发送相同的NS数据包(默认)

以下参数可用于更改数据包的格式:

src_lladdr: the MAC address used in the Source Link-Layer Address option

包含在NS数据包中. 这是对等方应在其邻居缓存中将其与数据包的IPv6源地址相关联的地址. 如果未提供,则使用接口的mac地址.

src: the IPv6 address used as source of the packet. If None is provided,

将使用与发射接口关联的地址(基于数据包的目标地址).

target: the target address of the NS packet. If no value is provided,

使用虚拟地址(2001:db8 :: 1). 如果未覆盖目标的值,则会直接影响数据包的目标地址. 默认情况下,与目标关联的被请求节点多播地址用作数据包的目标地址. 如果您打算使用不同于受害者之一的目标地址,请考虑指定一个特定的目标地址.

dst: The destination address of the NS. By default, the solicited node

如果未提供特定值,则使用与目标地址关联的多播地址(请参阅上一个参数). 预计受害者不会检查数据包的目标地址,因此,如果您希望攻击针对链接上的所有主机,则使用ff02 :: 1之类的多播地址应该有效. 相反,如果要隐身,则应为此参数提供目标地址,以便仅将数据包发送给受害者.

src_mac: the MAC address used as source of the packet. By default, this

是接口的地址. 如果您想更隐身,请随意使用其他东西. 注意,该地址不是受害者用来填充其邻居缓存的地址.

dst_mac: The MAC address used as destination address of the packet. If

IPv6目标地址是多播(所有节点,被请求的节点,…),将对其进行计算. 如果目的地址是单播的,则将执行邻居请求以获取关联的地址. 如果要使攻击隐身,则可以使用此参数提供MAC地址.

loop: By default, this parameter is True, indicating that NS packets

将以"间隔"秒(见下文)分隔的循环发送. 设置为False时,发送单个数据包.

inter: When loop parameter is True (the default), this parameter provides

发送NS数据包的时间间隔(以秒为单位).

iface:强制发送接口.

class scapy.layers.inet6.NIQueryCodeField(name, default, enum)

Bases: scapy.fields.ByteEnumField

i2m(pkt, x)
class scapy.layers.inet6.NIQueryDataField(name, default)

Bases: scapy.fields.StrField

addfield(pkt, s, val)
getfield(pkt, s)
h2i(pkt, x)
i2h(pkt, x)
i2repr(pkt, x)
class scapy.layers.inet6.NIReplyDataField(name, default, fmt='H', remain=0)

Bases: scapy.fields.StrField

addfield(pkt, s, val)
getfield(pkt, s)
h2i(pkt, x)
i2h(pkt, x)
i2repr(pkt, x)
class scapy.layers.inet6.NTPTimestampField(name, default)

Bases: scapy.fields.LongField

i2repr(pkt, x)
class scapy.layers.inet6.NonceField(name, default=None)

Bases: scapy.fields.StrFixedLenField

class scapy.layers.inet6.Pad1

Bases: scapy.packet.Packet

aliastypes
alignment_delta(curpos)
extract_padding(p)
fields_desc
Pad1字段

otype

_OTypeField

0

class scapy.layers.inet6.PadN

Bases: scapy.packet.Packet

aliastypes
alignment_delta(curpos)
extract_padding(p)
fields_desc
PadN字段

otype

_OTypeField

1

optlen

FieldLenField

None

optdata

StrLenField

b''

class scapy.layers.inet6.PseudoIPv6

Bases: scapy.packet.Packet

aliastypes
fields_desc
伪IPv6字段

src

IP6Field

'::'

dst

IP6Field

'::'

uplen

ShortField

None

zero

BitField (24位)

0

nh

ByteField

0

class scapy.layers.inet6.RouterAlert

Bases: scapy.packet.Packet

aliastypes
alignment_delta(curpos)
extract_padding(p)
fields_desc
RouterAlert字段

otype

_OTypeField

5

optlen

ByteField

2

value

ShortEnumField

None

class scapy.layers.inet6.TracerouteResult6(res=None, name='Traceroute', stats=None)

Bases: scapy.layers.inet.TracerouteResult

get_trace()
graph(ASres=<scapy.layers.inet6.AS_resolver6 object>, **kargs)
show()
class scapy.layers.inet6.TruncPktLenField(name, default, cls, cur_shift, length_from=None, shift=0)

Bases: scapy.fields.PacketLenField

cur_shift
getfield(pkt, s)
i2len(pkt, i)
i2m(pkt, x)
m2i(pkt, m)
scapy.layers.inet6.computeNIGroupAddr(name)

计算NI组地址. 可以将FQDN作为输入参数

scapy.layers.inet6.defragment6(packets)

对IPv6数据包列表执行碎片整理. 数据包被重新排序. 废话掉了. 缺少的内容由" X"字符完成.

scapy.layers.inet6.dnsrepr2names(x)

输入一个DNS编码的字符串(可能是压缩的)作为输入,并返回其中包含的DNS名称的列表. 如果提供的字符串已经是可打印的格式(不以空字符结尾,则返回一个元素列表). 结果是一个列表.

scapy.layers.inet6.fragment6(pkt, fragSize)

执行IPv6数据包的分段. 提供的数据包('pkt')必须已经包含IPv6ExtHdrFragment()类. 'fragSize'参数是预期的最大片段大小(MTU). 返回数据包列表.

如果数据包不包含IPv6ExtHdrFragment类,则将其返回到结果列表中.

scapy.layers.inet6.getmacbyip6(ip6, chainCC=0)

返回与IPv6地址相对应的MAC地址

neighborCache.get()方法用于实例化的邻居缓存. 解析机制在相关文档字符串中描述.

(chainCC parameter value ends up being passed to sending function

用于执行解析(如果需要)

scapy.layers.inet6.in6_chksum(nh, u, p)

如RFC 2460中所述-8.1高层校验和

执行IPv6上层校验和计算.

该函数通过以下方式填充伪头标类实例(PseudoIPv6):-下一个头标值-_final_目标的地址(如果底层类中存在某些具有非segleft字段的路由头,则使用最后一个地址.)-地址_real_ source(基本上是底层中可用的IPv6类实例的源地址,或者如果在底层中找到的某些Destination Option标头中包含此选项,则HAO选项中的源地址). -长度是提供的有效负载字符串('p')的长度

Parameters
  • nh –上层协议的值

  • u –上层实例(TCP,UDP,ICMPv6 *,). 必须为实例提供所有底层(例如,IPv6和所有扩展头)

  • p –以字符串形式提供的上层负载

scapy.layers.inet6.inet6_register_l3(l2, l3)
scapy.layers.inet6.names2dnsrepr(x)

输入DNS名称或单个DNS名称的列表作为输入,并以DNS格式进行编码(可能进行压缩).如果传递的字符串已经是DNS格式的DNS名称,则将其原样返回. 结果是一个字符串. !!! 目前,压缩尚未实现!

scapy.layers.inet6.neighsol(addr, src, iface, timeout=1, chainCC=0)

发送和接收ICMPv6邻居请求消息

该功能发送ICMPv6 Neighbor Solicitation消息,以获取具有指定IPv6地址地址的邻居的MAC地址.

" src"地址用作消息源. 消息在iface上发送. 缺省情况下,等待应答的超时时间是1秒.

如果未收集到答案,则不返回任何内容. 否则,返回答案(以太网帧).

scapy.layers.inet6.traceroute6(target, dport=80, minttl=1, maxttl=30, sport=<RandShort>, l4=None, timeout=2, verbose=None, **kargs)

使用IPv6 traceroute6(target,[maxttl = 30],[dport = 80],[sport = 80])的即时TCP Traceroute->无