scapy.layers.quic
QUIC
The draft of a very basic implementation of the structures from [RFC 9000]. This isn’t binded to UDP by default as currently too incomplete.
TODO: - payloads. - encryption. - automaton. - etc.
- class scapy.layers.quic.QUIC(_pkt, /)[source]
Bases:
Packet- aliastypes
- classmethod dispatch_hook(_pkt=None, *args, **kargs)[source]
Returns the right class for the given data.
- match_subclass = True
- class scapy.layers.quic.QUIC_0RTT(_pkt, /, *, HeaderForm=1, FixedBit=1, LongPacketType=1, Reserved=0, PacketNumberLen=None, Version=1, DstConnIDLen=None, DstConnID=b'', SrcConnIDLen=None, SrcConnID=b'', Length=0, PacketNumber=None)[source]
Bases:
QUIC- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H|F|LON|RES|PAC| VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | DSTCONNIDLEN | DSTCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCCONNIDLEN | SRCCONNID | LENGTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PACKETNUMBER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. QUIC_0RTTQUIC_0RTT fields HeaderForm
1FixedBit
BitField(1 bit)1LongPacketType
1Reserved
BitField(2 bits)0PacketNumberLen
QuicPacketNumberBitFieldLenField(2 bits)NoneVersion
1DstConnIDLen
NoneDstConnID
b''SrcConnIDLen
NoneSrcConnID
b''Length
0PacketNumber
MultipleTypeField(ByteField, ShortField, ThreeBytesField, IntField, ByteField)0
- class scapy.layers.quic.QUIC_1RTT(_pkt, /, *, HeaderForm=0, FixedBit=1, SpinBit=0, Reserved=0, KeyPhase=0, PacketNumberLen=None, PacketNumber=None)[source]
Bases:
QUIC- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H|F|S|RES|K|PAC| PACKETNUMBER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. QUIC_1RTTQUIC_1RTT fields HeaderForm
0FixedBit
BitField(1 bit)1SpinBit
BitField(1 bit)0Reserved
BitField(2 bits)0KeyPhase
BitField(1 bit)0PacketNumberLen
QuicPacketNumberBitFieldLenField(2 bits)NonePacketNumber
MultipleTypeField(ByteField, ShortField, ThreeBytesField, IntField, ByteField)0
- class scapy.layers.quic.QUIC_ACK(_pkt, /, *, Type=2)[source]
Bases:
Packet- aliastypes
- class scapy.layers.quic.QUIC_Handshake(_pkt, /, *, HeaderForm=1, FixedBit=1, LongPacketType=2, Reserved=0, PacketNumberLen=None, Version=1, DstConnIDLen=None, DstConnID=b'', SrcConnIDLen=None, SrcConnID=b'', Length=0, PacketNumber=None)[source]
Bases:
QUIC- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H|F|LON|RES|PAC| VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | DSTCONNIDLEN | DSTCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCCONNIDLEN | SRCCONNID | LENGTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PACKETNUMBER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. QUIC_HandshakeQUIC_Handshake fields HeaderForm
1FixedBit
BitField(1 bit)1LongPacketType
2Reserved
BitField(2 bits)0PacketNumberLen
QuicPacketNumberBitFieldLenField(2 bits)NoneVersion
1DstConnIDLen
NoneDstConnID
b''SrcConnIDLen
NoneSrcConnID
b''Length
0PacketNumber
MultipleTypeField(ByteField, ShortField, ThreeBytesField, IntField, ByteField)0
- class scapy.layers.quic.QUIC_Initial(_pkt, /, *, HeaderForm=1, FixedBit=1, LongPacketType=0, Reserved=0, PacketNumberLen=None, Version=1, DstConnIDLen=None, DstConnID=b'', SrcConnIDLen=None, SrcConnID=b'', TokenLen=None, Token=b'', Length=0, PacketNumber=None)[source]
Bases:
QUIC- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H|F|LON|RES|PAC| VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | DSTCONNIDLEN | DSTCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCCONNIDLEN | SRCCONNID | TOKENLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | TOKEN | LENGTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PACKETNUMBER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. QUIC_InitialQUIC_Initial fields HeaderForm
1FixedBit
BitField(1 bit)1LongPacketType
0Reserved
BitField(2 bits)0PacketNumberLen
QuicPacketNumberBitFieldLenField(2 bits)NoneVersion
1DstConnIDLen
NoneDstConnID
b''SrcConnIDLen
NoneSrcConnID
b''TokenLen
NoneToken
b''Length
0PacketNumber
MultipleTypeField(ByteField, ShortField, ThreeBytesField, IntField, ByteField)0
- class scapy.layers.quic.QUIC_PADDING(_pkt, /, *, Type=0)[source]
Bases:
Packet- aliastypes
- class scapy.layers.quic.QUIC_PING(_pkt, /, *, Type=1)[source]
Bases:
Packet- aliastypes
- class scapy.layers.quic.QUIC_Retry(_pkt, /, *, HeaderForm=1, FixedBit=1, LongPacketType=3, Unused=0, Version=1, DstConnIDLen=None, DstConnID=b'', SrcConnIDLen=None, SrcConnID=b'')[source]
Bases:
QUIC- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H|F|LON| UNUSED| VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | DSTCONNIDLEN | DSTCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCCONNIDLEN | SRCCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. QUIC_RetryQUIC_Retry fields HeaderForm
1FixedBit
BitField(1 bit)1LongPacketType
3Unused
BitField(4 bits)0Version
1DstConnIDLen
NoneDstConnID
b''SrcConnIDLen
NoneSrcConnID
b''
- class scapy.layers.quic.QUIC_Version(_pkt, /, *, HeaderForm=1, Unused=0, Version=0, DstConnIDLen=None, DstConnID=b'', SrcConnIDLen=None, SrcConnID=b'', SupportedVersions=[])[source]
Bases:
QUIC- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H| UNUSED | VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | DSTCONNIDLEN | DSTCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCCONNIDLEN | SRCCONNID |SUPPORTEDVERSIO| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+ Fig. QUIC_VersionQUIC_Version fields HeaderForm
1Unused
BitField(7 bits)0Version
0DstConnIDLen
NoneDstConnID
b''SrcConnIDLen
NoneSrcConnID
b''SupportedVersions
[]
- class scapy.layers.quic.QuicPacketNumberBitFieldLenField(name: str, default: I | None, size: int, tot_size: int = 0, end_tot_size: int = 0)[source]
Bases:
BitField
- class scapy.layers.quic.QuicVarEnumField(name: str, default: int | None, enum: Any)[source]
Bases:
QuicVarIntField,_EnumField[int]- i2s: Dict[I, str] | None
- i2s_cb: Callable[[I], str] | None
- s2i: Dict[str, I] | None
- s2i_cb: Callable[[str], I] | None
- class scapy.layers.quic.QuicVarIntField(name: str, default: Any, fmt: str = 'H')[source]
Bases:
Field[int,int]
- class scapy.layers.quic.QuicVarLenField(name: str, default: Optional[Any], length_of: Optional[str] = None, fmt: str = 'H', count_of: Optional[str] = None, adjust: Callable[[Packet, int], int] = <function FieldLenField.<lambda>>)[source]
Bases:
FieldLenField,QuicVarIntField