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):

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.


Source: Python Questions