scapy.contrib.tcpao

Packet-processing utilities implementing RFC5925 and RFC5926

class scapy.contrib.tcpao.TCPAOAlg[源代码]

基类:object

classmethod kdf(master_key: bytes, context: bytes) bytes[源代码]
classmethod mac(traffic_key: bytes, context: bytes) bytes[源代码]
maclen = -1
class scapy.contrib.tcpao.TCPAOAlg_CMAC_AES[源代码]

基类:TCPAOAlg

classmethod kdf(master_key: bytes, context: bytes) bytes[源代码]
classmethod mac(traffic_key: bytes, message: bytes) bytes[源代码]
maclen = 12
class scapy.contrib.tcpao.TCPAOAlg_HMAC_SHA1[源代码]

基类:TCPAOAlg

classmethod kdf(master_key: bytes, context: bytes) bytes[源代码]
classmethod mac(traffic_key: bytes, message: bytes) bytes[源代码]
maclen = 12
scapy.contrib.tcpao.build_context(saddr: bytes, daddr: bytes, sport: int, dport: int, src_isn: int, dst_isn: int) bytes[源代码]

Build context bytes as specified by RFC5925 section 5.2

scapy.contrib.tcpao.build_context_from_packet(p: Packet, src_isn: int, dst_isn: int) bytes[源代码]

Build context bytes as specified by RFC5925 section 5.2

scapy.contrib.tcpao.build_message_from_packet(p: Packet, include_options: bool = True, sne: int = 0) bytes[源代码]

Build message bytes as described by RFC5925 section 5.1

scapy.contrib.tcpao.calc_tcpao_mac(p: Packet, alg: TCPAOAlg, traffic_key: bytes, include_options: bool = True, sne: int = 0) bytes[源代码]

Calculate TCP-AO MAC from packet and traffic key

scapy.contrib.tcpao.calc_tcpao_traffic_key(p: Packet, alg: TCPAOAlg, master_key: bytes, sisn: int, disn: int) bytes[源代码]

Calculate TCP-AO traffic-key from packet and initial sequence numbers

This is constant for an established connection.

scapy.contrib.tcpao.get_alg(name: str) TCPAOAlg[源代码]
scapy.contrib.tcpao.sign_tcpao(p: Packet, alg: TCPAOAlg, traffic_key: bytes, keyid: int = 0, rnextkeyid: int = 0, include_options: bool = True, sne: int = 0) None[源代码]

Calculate TCP-AO option value and insert into packet