I am going to simulate a DTLS initial handshake using Scapy. As DTLS is not supported in Scapy, I had to use scapy-ssl_tls
in order to build DTLS packets. I first tried it with TLS and sent a ClientHello
as follows:
p = TLSRecord() / TLSHandshakes(handshakes=[TLSHandshake() /
TLSClientHello(compression_methods=list(range(0xff))[::-1],
cipher_suites=list(range(0xff)))])
It works completely fine. However, when I am trying to send a DTLS ClientHello
, in Wireshark I get the error of Fragment runs past the end of message
. I use the following code to send DTLS Packet.
p = DTLSRecord(epoch = 0, sequence = 0) / DTLSHandshake() / DTLSClientHello(cipher_suites=list(range(0xff)))
If you also have any other ideas to craft DTLS packets, please inform me.