mirror of
https://github.com/nfstream/nfstream.git
synced 2026-05-19 07:54:25 +00:00
Update ja4.py
Added protection against bugs in IPv6 signature extraction (to be fixed in future versions of the plugin)
This commit is contained in:
parent
2514f0bfde
commit
4e73bdca56
1 changed files with 4 additions and 0 deletions
|
|
@ -16,6 +16,10 @@ def get_protocol(packet):
|
|||
protocol (str): detected protocol, "t" for TCP, "q" for QUIC
|
||||
payload (scapy.layers.inet.TCP or scapy.layers.inet.UDP): payload of the packet (at transport layer level)
|
||||
"""
|
||||
# If the packet is not IPv4, None is returned
|
||||
# (only IPv4 packets are considered for JA4 fingerprint extraction)
|
||||
if packet.ip_version != 4:
|
||||
return None, None
|
||||
# TCP detection and TCP payload extraction
|
||||
ip_packet = IP(packet.ip_packet)
|
||||
if ip_packet.p == IP_PROTO_TCP:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue