You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def extract_sni(packet):
if packet.haslayer(tls.TLSClientHello):
client_hello = packet[tls.TLSClientHello]
for ext_type, ext_data in client_hello.extensions:
if ext_type == tls.TLSExtensionType.SERVER_NAME:
sni_info = tls.TLSServerName.parse(ext_data)
return sni_info[0].data.decode("utf-8")
return None
def process_packet(packet):
if IP in packet and TCP in packet:
if (
packet[IP].src == source_ip
and packet[TCP].sport == source_port
and packet[IP].dst == destination_ip
and packet[TCP].dport == destination_port
):
sni = extract_sni(packet)
if sni:
print(f"Session: {source_ip}:{source_port} -> {destination_ip}:{destination_port}")
print(f"SNI: {sni}")
print("=====================================")
Hi there,
my use case is the following:
Is it possible? How would the example look like?
Thanks and regards
The text was updated successfully, but these errors were encountered: