How to send TLS ClientHello using Scapy?

  python, scapy

I’m trying to send a TLS ClientHello Packet to an IP with a SNI to check if firewall returns RST Packets. How should I go about doing so with scapy within a script?

I have tried this:

from scapy.layers.tls.automaton_cli import TLSClientAutomaton

def tls_check(domain):
    t=TLSClientAutomaton(server="1.1.1.1",dport=443,server_name=domain)
    t.run()
tls_check("1337x.to")

While it does kinda work, in that it shows that connection is being reset. The problem is it outputs to the console.

enter image description here

Let’s say I wanted to see if the connection is being reset in a variable. What should I do? I just need to send the ClientHello packet and check if connection is being reset, no need for full handshake.

Thanks

Source: Python Questions

LEAVE A COMMENT