Closed caiqs-sys closed 7 years ago
Are you 100% sure all the bytes were correctly received? I got this when, for some reason, the receiver didn't get all of those bytes in the sock.recv()
I use it to deal with pcap file, but I have got the reason, it's like what you said. The record length is 0xe52, but the left payload is only 1390. The code at ssl_tls.py, line 439 set cls to TLSCiphertext, which means it can not deal with a "TCP segment of a reassembled PDU". I will remove the code and try to deal with it in my own app. Thanks!
def guess_payload_class(self, payload):
""" Sense for ciphertext
"""
cls = StackedLenPacket.guess_payload_class(self, payload)
p = cls(payload, _internal=1, _underlayer=self)
if p.haslayer(TLSHandshakes) and len(p[TLSHandshakes].handshakes) > 0:
p = p[TLSHandshakes].handshakes[0]
try:
if cls == Raw().__class__ or p.length > len(payload):
# length does not fit len raw_bytes, assume its corrupt or encrypted
cls = TLSCiphertext
except AttributeError:
# e.g. TLSChangeCipherSpec might land here
pass
return cls
Hi @deliciousdish,
likely a tcp stream reassembly issue. I worked around this with a minimalistic non-valid(!) stream reassembly class that reassembles based on some assumptions examples/sessionctx_sniffer.py. It is working in many settings but not all. Maybe it is of help to you. Let me know if you come across a python tcp stream reassembly project :)
tin
I got a TLSRecord, whoes show() is like the following:
It should be a Certificate message ,but not parsed correctly. How to solve this problem, thanks!